Răsfoiți Sursa

obs-outputs: Fix TLS_client init for mbedTLS 3.1.0+

When trying to update to mbedTLS 3.2.1, I ran into failures with RTMPS
output. After consulting an mbedTLS implementation example, I determined
that we were not setting up the SSL/TLS context config in the correct
order, causing the connection to fail. Performing the setup in the
recommended order fixes that.
Ryan Foster 3 ani în urmă
părinte
comite
614ff22e8d
1 a modificat fișierele cu 3 adăugiri și 3 ștergeri
  1. 3 3
      plugins/obs-outputs/librtmp/rtmp.h

+ 3 - 3
plugins/obs-outputs/librtmp/rtmp.h

@@ -92,10 +92,10 @@ typedef tls_ctx *TLS_CTX;
 #define TLS_client(ctx,s)	\
   s = malloc(sizeof(mbedtls_ssl_context));\
   mbedtls_ssl_init(s);\
-  mbedtls_ssl_setup(s, &ctx->conf);\
-	mbedtls_ssl_config_defaults(&ctx->conf, MBEDTLS_SSL_IS_CLIENT, MBEDTLS_SSL_TRANSPORT_STREAM, MBEDTLS_SSL_PRESET_DEFAULT);\
+  mbedtls_ssl_config_defaults(&ctx->conf, MBEDTLS_SSL_IS_CLIENT, MBEDTLS_SSL_TRANSPORT_STREAM, MBEDTLS_SSL_PRESET_DEFAULT);\
+  mbedtls_ssl_conf_rng(&ctx->conf, mbedtls_ctr_drbg_random, &ctx->ctr_drbg);\
   mbedtls_ssl_conf_authmode(&ctx->conf, MBEDTLS_SSL_VERIFY_REQUIRED);\
-	mbedtls_ssl_conf_rng(&ctx->conf, mbedtls_ctr_drbg_random, &ctx->ctr_drbg)
+  mbedtls_ssl_setup(s, &ctx->conf)
 
 #define TLS_setfd(s,fd)	mbedtls_ssl_set_bio(s, fd, mbedtls_net_send, mbedtls_net_recv, NULL)
 #define TLS_connect(s)	mbedtls_ssl_handshake(s)