From 1dc2c6a3be105c5032bd5aca8eb56f2fbe1d393a Mon Sep 17 00:00:00 2001 From: Richard Stanway Date: Mon, 23 Mar 2020 16:16:58 +0100 Subject: [PATCH] obs-outputs: Fix mbed TLS build issues Version test macro was using the wrong version, and the non-crypto MD5 only code was accidentally moved into an #ifdef which ended up disabling it. Fixes https://github.com/obsproject/obs-studio/issues/2426 --- plugins/obs-outputs/librtmp/rtmp.c | 2 +- plugins/obs-outputs/librtmp/rtmp.h | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/obs-outputs/librtmp/rtmp.c b/plugins/obs-outputs/librtmp/rtmp.c index 81ab5c862..119bb6259 100644 --- a/plugins/obs-outputs/librtmp/rtmp.c +++ b/plugins/obs-outputs/librtmp/rtmp.c @@ -2583,7 +2583,7 @@ b64enc(const unsigned char *input, int length, char *output, int maxsize) #if defined(USE_MBEDTLS) typedef mbedtls_md5_context MD5_CTX; -#if MBEDTLS_VERSION_NUMBER >= 0x02040000 +#if MBEDTLS_VERSION_NUMBER >= 0x02070000 #define MD5_Init(ctx) mbedtls_md5_init(ctx); mbedtls_md5_starts_ret(ctx) #define MD5_Update(ctx,data,len) mbedtls_md5_update_ret(ctx,(unsigned char *)data,len) #define MD5_Final(dig,ctx) mbedtls_md5_finish_ret(ctx,dig); mbedtls_md5_free(ctx) diff --git a/plugins/obs-outputs/librtmp/rtmp.h b/plugins/obs-outputs/librtmp/rtmp.h index 0441fac8e..a4b5355c2 100644 --- a/plugins/obs-outputs/librtmp/rtmp.h +++ b/plugins/obs-outputs/librtmp/rtmp.h @@ -156,11 +156,6 @@ typedef struct tls_ctx #define TLS_shutdown(s) gnutls_bye(s, GNUTLS_SHUT_RDWR) #define TLS_close(s) gnutls_deinit(s) -#elif defined(USE_ONLY_MD5) -#include "md5.h" -#include "cencode.h" -#define MD5_DIGEST_LENGTH 16 - #else /* USE_OPENSSL */ #define TLS_CTX SSL_CTX * #define TLS_client(ctx,s) s = SSL_new(ctx) @@ -173,6 +168,10 @@ typedef struct tls_ctx #define TLS_close(s) SSL_free(s) #endif +#elif defined(USE_ONLY_MD5) +#include "md5.h" +#include "cencode.h" +#define MD5_DIGEST_LENGTH 16 #endif #ifdef __cplusplus