]> granicus.if.org Git - rtmpdump/commitdiff
PolarSSL support now requires version 1.0.0.
authorHoward Chu <hyc@highlandsun.com>
Sun, 25 Sep 2011 10:07:14 +0000 (03:07 -0700)
committerHoward Chu <hyc@highlandsun.com>
Sun, 25 Sep 2011 10:07:14 +0000 (03:07 -0700)
README
librtmp/dh.h
librtmp/rtmp_sys.h

diff --git a/README b/README
index 865c6c467ba86dba5c476440327d5b7c914cdbc9..dcf5f52c425ab89563b383519edff45fc9b6c3ea 100644 (file)
--- a/README
+++ b/README
@@ -50,6 +50,7 @@ library. You can also turn it off if desired
 The rtmpdump programs still link to the static library, regardless.
 
 Note that if using OpenSSL, you must have version 0.9.8 or newer.
+For Polar SSL you must have version 1.0.0 or newer.
 
 Credit goes to team boxee for the XBMC RTMP code originally used in RTMPDumper.
 The current code is based on the XBMC code but rewritten in C by Howard Chu.
index efef0fd5a879a3d1b5fa1a4ffb0dede4dd5afd92..a9f37630a4d2fe61faf2f0cfe125ceb9e6f95569 100644 (file)
 #ifdef USE_POLARSSL
 #include <polarssl/dhm.h>
 typedef mpi * MP_t;
-#define MP_new(m)      m = malloc(sizeof(mpi)); mpi_init(m, NULL)
+#define MP_new(m)      m = malloc(sizeof(mpi)); mpi_init(m)
 #define MP_set_w(mpi, w)       mpi_lset(mpi, w)
 #define MP_cmp(u, v)   mpi_cmp_mpi(u, v)
 #define MP_set(u, v)   mpi_copy(u, v)
 #define MP_sub_w(mpi, w)       mpi_sub_int(mpi, mpi, w)
 #define MP_cmp_1(mpi)  mpi_cmp_int(mpi, 1)
 #define MP_modexp(r, y, q, p)  mpi_exp_mod(r, y, q, p, NULL)
-#define MP_free(mpi)   mpi_free(mpi, NULL); free(mpi)
+#define MP_free(mpi)   mpi_free(mpi); free(mpi)
 #define MP_gethex(u, hex, res) MP_new(u); res = mpi_read_string(u, 16, hex) == 0
 #define MP_bytes(u)    mpi_size(u)
 #define MP_setbin(u,buf,len)   mpi_write_binary(u,buf,len)
@@ -71,9 +71,8 @@ static int MDH_generate_key(MDH *dh)
 
 static int MDH_compute_key(uint8_t *secret, size_t len, MP_t pub, MDH *dh)
 {
-  int n = len;
   MP_set(&dh->ctx.GY, pub);
-  dhm_calc_secret(&dh->ctx, secret, &n);
+  dhm_calc_secret(&dh->ctx, secret, &len);
   return 0;
 }
 
index 638374fd9656a0dec1b75a552267fdee7d9d95e2..c3fd4a6488f3aadc362fb54c33cc726f686227d5 100644 (file)
@@ -71,7 +71,8 @@ typedef struct tls_ctx {
 #define TLS_CTX tls_ctx *
 #define TLS_client(ctx,s)      s = malloc(sizeof(ssl_context)); ssl_init(s);\
        ssl_set_endpoint(s, SSL_IS_CLIENT); ssl_set_authmode(s, SSL_VERIFY_NONE);\
-       ssl_set_rng(s, havege_rand, &ctx->hs); ssl_set_ciphers(s, ssl_default_ciphers);\
+       ssl_set_rng(s, havege_rand, &ctx->hs);\
+       ssl_set_ciphersuites(s, ssl_default_ciphersuites);\
        ssl_set_session(s, 1, 600, &ctx->ssn)
 #define TLS_setfd(s,fd)        ssl_set_bio(s, net_recv, &fd, net_send, &fd)
 #define TLS_connect(s) ssl_handshake(s)