From 19d36368f6c1ec6fa55df319173ca93048309f9a Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 9 Nov 2012 07:58:08 -0800 Subject: [PATCH] PolarSSL 1.2.x compat --- librtmp/rtmp_sys.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/librtmp/rtmp_sys.h b/librtmp/rtmp_sys.h index 6e2356a..85d7e53 100644 --- a/librtmp/rtmp_sys.h +++ b/librtmp/rtmp_sys.h @@ -68,6 +68,11 @@ #if POLARSSL_VERSION_NUMBER < 0x01010000 #define havege_random havege_rand #endif +#if POLARSSL_VERSION_NUMBER >= 0x01020000 +#define SSL_SET_SESSION(S,resume,timeout,ctx) ssl_set_session(S,ctx) +#else +#define SSL_SET_SESSION(S,resume,timeout,ctx) ssl_set_session(S,resume,timeout,ctx) +#endif typedef struct tls_ctx { havege_state hs; ssl_session ssn; @@ -85,12 +90,12 @@ typedef struct tls_server_ctx { ssl_set_endpoint(s, SSL_IS_CLIENT); ssl_set_authmode(s, SSL_VERIFY_NONE);\ ssl_set_rng(s, havege_random, &ctx->hs);\ ssl_set_ciphersuites(s, ssl_default_ciphersuites);\ - ssl_set_session(s, 1, 600, &ctx->ssn) + 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_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_SESSION(s, 1, 600, &((tls_server_ctx*)ctx)->ssn);\ ssl_set_own_cert(s, &((tls_server_ctx*)ctx)->cert, &((tls_server_ctx*)ctx)->key);\ ssl_set_dh_param(s, ((tls_server_ctx*)ctx)->dhm_P, ((tls_server_ctx*)ctx)->dhm_G) #define TLS_setfd(s,fd) ssl_set_bio(s, net_recv, &fd, net_send, &fd) -- 2.40.0