Browse Source

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
Richard Stanway 5 years ago
parent
commit
1dc2c6a3be
2 changed files with 5 additions and 6 deletions
  1. 1 1
      plugins/obs-outputs/librtmp/rtmp.c
  2. 4 5
      plugins/obs-outputs/librtmp/rtmp.h

+ 1 - 1
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)

+ 4 - 5
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