Skip to content

Commit

Permalink
PolarSSL support now requires version 1.0.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard Chu committed Sep 25, 2011
1 parent c58cfb3 commit 6230845
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 3 additions & 4 deletions librtmp/dh.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
#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)
Expand Down Expand Up @@ -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;
}

Expand Down
3 changes: 2 additions & 1 deletion librtmp/rtmp_sys.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6230845

Please sign in to comment.