On Thu, Jul 12, 2012 at 03:04:35PM +0200, Samuel Pitoiset wrote:
> --- a/configure
> +++ b/configure
> @@ -1541,6 +1543,10 @@ mmsh_protocol_select="http_protocol"
> mmst_protocol_deps="network"
> rtmp_protocol_deps="!librtmp_protocol"
> rtmp_protocol_select="tcp_protocol"
> +rtmpe_protocol_deps="!librtmp_protocol"
> +rtmpe_protocol_select="rtmpenc_protocol"
> +rtmpenc_protocol_deps_any="!librtmp_protocol gnutls openssl"
So if librtmp is not enabled I do not need either gnutls or openssl?
I'm not sure this is the intended semantics, but this is how _deps_any
entries work.
> @@ -3002,6 +3008,14 @@ enabled openssl && { check_lib openssl/ssl.h
> SSL_library_init -lssl -lcrypto
>
> +# gnutls nettle/gcrypt check
redundant comment is redundant
> +if enabled gnutls; then
> + { check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed
> -lgmp &&
> + enable nettle; } ||
> + { check_lib gcrypt.h gcry_mpi_new -lgcrypt &&
> + enable gcrypt; }
Merge the last two lines.
> --- /dev/null
> +++ b/libavformat/rtmpdh.c
> @@ -0,0 +1,497 @@
> +
> +#include "rtmpdh.h"
config.h is missing
> +#if CONFIG_GNUTLS && (CONFIG_NETTLE || CONFIG_GCRYPT)
> +#if CONFIG_NETTLE
> +
> +#elif CONFIG_GCRYPT
> +}
> +#endif
> +
> +#elif CONFIG_OPENSSL
> +}
> +#endif
I wonder if some of the code duplication can be avoided by setting function
pointers. Martin, do you have an opinion?
> +FF_DH *ff_dh_init(int key_len)
In general init functions can be marked av_cold. Please check all your
code for opportunities to use av_cold.
> --- /dev/null
> +++ b/libavformat/rtmpdh.h
> @@ -0,0 +1,104 @@
> +
> +#ifndef AVFORMAT_RTMPDH_H
> +#define AVFORMAT_RTMPDH_H
> +
> +#include "../config.h"
Drop the "../".
> +#if CONFIG_GNUTLS && (CONFIG_NETTLE || CONFIG_GCRYPT)
> +#if CONFIG_NETTLE
> +#elif CONFIG_GCRYPT
> +#endif
> +
> +#elif CONFIG_OPENSSL
> +#endif
What happens if neither nettle nor gcrypt are available in the gnutls case?
> +/**
> + * Initialize a Diffie-Hellmann context.
> + *
> + * @param key_len length of the key
> + */
> +FF_DH *ff_dh_init(int key_len);
> +
> +/**
> + * Free a Diffie-Hellmann context.
> + *
> + * @param dh a Diffie-Hellmann context.
.. to free
> +/**
> + * Write the public key into big-endian form.
> + *
> + * @param dh a Diffie-Hellmann context
> + * @param pub_key public key
> + * @param pub_key_len length of the public key
> + * @return zero on success, negative value otherwise
> + */
> +int ff_dh_write_public_key(FF_DH *dh, uint8_t *pub_key, int pub_key_len);
The purpose of this function is to transform a key from little-endian to
big-endian? If yes, then the name is poor, else the description is poor.
> --- /dev/null
> +++ b/libavformat/rtmpenc.h
> @@ -0,0 +1,67 @@
> +
> +#include <stdint.h>
> +#include "url.h"
Add an empty line between system and local headers.
> +/**
> + * Compute the shared secret key and initialize the RC4 encryption.
> + *
> + * @param h an URLContext
> + * @param buf server data (1536 bytes)
> + * @param buf client data (1536 bytes)
> + * @return zero on success, negative value otherwise
> + */
> +int ff_rtmpe_compute_secret_key(URLContext *h, const uint8_t *serverdata,
> + const uint8_t *clientdata, int type);
The parameter descriptions are incorrect.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel