On Tue, 15 Jan 2013, Diego Biurrun wrote:

On Tue, Jan 15, 2013 at 03:12:57PM +0200, Martin Storsjö wrote:
--- a/libavformat/srtp.c
+++ b/libavformat/srtp.c
@@ -291,3 +291,131 @@ int ff_srtp_encrypt(struct SRTPContext *s, const uint8_t 
*in, int len,
     len += s->hmac_size;
     return buf + len - out;
 }
+
+#ifdef TEST
+#include <stdio.h>
+
+    len = ff_srtp_encrypt(&enc, data, in_len, buf, sizeof(buf));
+    if (!ff_srtp_decrypt(&dec, buf, &len)) {
+        if (len == in_len && !memcmp(buf, data, len))
+            printf("Decrypted content match input\n");

matches

Fixed

+int main(void) {

{ --> next line

Fixed

+    return 0;
+}
+#endif

nit: comment the #endif

Fixed

--- a/tests/fate/libavformat.mak
+++ b/tests/fate/libavformat.mak
@@ -1,3 +1,7 @@
+FATE_LIBAVFORMAT += fate-srtp
+fate-srtp: libavformat/srtp-test$(EXESUF)
+fate-srtp: CMD = run libavformat/srtp-test

I assume this will need the SRTP protocol.

No, it doesn't - it tests the internal decrypt/encrypt functions straight away without using the public protocol interface. (The protocol is only one possible entry point to using the internal API.)

Does "make check" still pass with --disable-protocol=srtp?

Yes.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to