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
> +int main(void) {
{ --> next line
> + return 0;
> +}
> +#endif
nit: comment the #endif
> --- 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. Does "make check" still pass
with --disable-protocol=srtp?
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel