From: Howard Chu Date: Sun, 25 Sep 2011 10:07:14 +0000 (-0700) Subject: PolarSSL support now requires version 1.0.0. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6230845ab0fba07289d4b2d9b97269e4b2d90766;p=rtmpdump PolarSSL support now requires version 1.0.0. --- diff --git a/README b/README index 865c6c4..dcf5f52 100644 --- 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. diff --git a/librtmp/dh.h b/librtmp/dh.h index efef0fd..a9f3763 100644 --- a/librtmp/dh.h +++ b/librtmp/dh.h @@ -30,14 +30,14 @@ #ifdef USE_POLARSSL #include 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; } diff --git a/librtmp/rtmp_sys.h b/librtmp/rtmp_sys.h index 638374f..c3fd4a6 100644 --- a/librtmp/rtmp_sys.h +++ b/librtmp/rtmp_sys.h @@ -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)