From: Howard Chu Date: Tue, 30 Oct 2012 21:40:14 +0000 (-0700) Subject: PolarSSL version fixes X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e79a07c8625b56ebb182c12343518faff4902de7;p=rtmpdump PolarSSL version fixes Fix commit a312ac7770207bd7d07725c1aef43725206e803a --- diff --git a/librtmp/dh.h b/librtmp/dh.h index fa264f8..e29587b 100644 --- a/librtmp/dh.h +++ b/librtmp/dh.h @@ -29,9 +29,6 @@ #ifdef USE_POLARSSL #include -#if POLARSSL_VERSION_NUMBER < 0x01010100 -#define havege_random havege_rand -#endif typedef mpi * MP_t; #define MP_new(m) m = malloc(sizeof(mpi)); mpi_init(m) #define MP_set_w(mpi, w) mpi_lset(mpi, w) diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c index d72f105..720669e 100644 --- a/librtmp/rtmp.c +++ b/librtmp/rtmp.c @@ -34,7 +34,6 @@ #ifdef CRYPTO #ifdef USE_POLARSSL -#include #include #include #include @@ -2435,7 +2434,7 @@ static int b64enc(const unsigned char *input, int length, char *output, int maxsize) { #ifdef USE_POLARSSL - int buf_size = maxsize; + size_t buf_size = maxsize; if(base64_encode((unsigned char *) output, &buf_size, input, length) == 0) { output[buf_size] = '\0'; @@ -2481,7 +2480,7 @@ b64enc(const unsigned char *input, int length, char *output, int maxsize) #ifdef USE_POLARSSL #define MD5_CTX md5_context #define MD5_Init(ctx) md5_starts(ctx) -#define MD5_Update(ctx,data,len) md5_update(ctx,data,len) +#define MD5_Update(ctx,data,len) md5_update(ctx,(unsigned char *)data,len) #define MD5_Final(dig,ctx) md5_finish(ctx,dig) #elif defined(USE_GNUTLS) typedef struct md5_ctx MD5_CTX diff --git a/librtmp/rtmp_sys.h b/librtmp/rtmp_sys.h index 2cdb705..6e2356a 100644 --- a/librtmp/rtmp_sys.h +++ b/librtmp/rtmp_sys.h @@ -65,7 +65,7 @@ #include #include #include -#if POLARSSL_VERSION_NUMBER < 0x01010100 +#if POLARSSL_VERSION_NUMBER < 0x01010000 #define havege_random havege_rand #endif typedef struct tls_ctx { @@ -88,7 +88,7 @@ typedef struct tls_server_ctx { ssl_set_session(s, 1, 600, &ctx->ssn) #define TLS_server(ctx,s) s = malloc(sizeof(ssl_context)); ssl_init(s);\ ssl_set_endpoint(s, SSL_IS_SERVER); ssl_set_authmode(s, SSL_VERIFY_NONE);\ - ssl_set_rng(s, havege_rand, ((tls_server_ctx*)ctx)->hs);\ + ssl_set_rng(s, havege_random, ((tls_server_ctx*)ctx)->hs);\ ssl_set_ciphersuites(s, ssl_default_ciphersuites);\ ssl_set_session(s, 1, 600, &((tls_server_ctx*)ctx)->ssn);\ ssl_set_own_cert(s, &((tls_server_ctx*)ctx)->cert, &((tls_server_ctx*)ctx)->key);\