]> granicus.if.org Git - rtmpdump/commitdiff
PolarSSL version fixes
authorHoward Chu <hyc@highlandsun.com>
Tue, 30 Oct 2012 21:40:14 +0000 (14:40 -0700)
committerHoward Chu <hyc@highlandsun.com>
Tue, 30 Oct 2012 21:40:14 +0000 (14:40 -0700)
Fix commit a312ac7770207bd7d07725c1aef43725206e803a

librtmp/dh.h
librtmp/rtmp.c
librtmp/rtmp_sys.h

index fa264f87f007d9b94380bdfb699d49ff2b6faf56..e29587bcb3f5d0b93cfa83f66d6aa6ccf27fcb6e 100644 (file)
@@ -29,9 +29,6 @@
 
 #ifdef USE_POLARSSL
 #include <polarssl/dhm.h>
-#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)
index d72f1051a8427a66b756640fb8d74cb3c39e902f..720669ebd6803166560185436ddefb1e49e30f87 100644 (file)
@@ -34,7 +34,6 @@
 
 #ifdef CRYPTO
 #ifdef USE_POLARSSL
-#include <polarssl/version.h>
 #include <polarssl/havege.h>
 #include <polarssl/md5.h>
 #include <polarssl/base64.h>
@@ -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
index 2cdb7057de139bc1be3ecfb6959e7b909691db43..6e2356a0c806ce2b2e4045c56a137fd309930833 100644 (file)
@@ -65,7 +65,7 @@
 #include <polarssl/net.h>
 #include <polarssl/ssl.h>
 #include <polarssl/havege.h>
-#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);\