From ab384ee945de6b2d1c9630b568462792f99d6c6e Mon Sep 17 00:00:00 2001 From: Anthony Hu Date: Wed, 4 Dec 2024 12:38:22 -0500 Subject: [PATCH] wolfSSL_CTX_set_tlsext_use_srtp() should return 1 on failure and 0 upon success. Same with wolfSSL_set_tlsext_use_srtp(). See https://docs.openssl.org/1.1.1/man3/SSL_CTX_set_tlsext_use_srtp/ --- src/ssl.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/ssl.c b/src/ssl.c index b11ed59a7..30ef63632 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -2073,6 +2073,13 @@ int wolfSSL_CTX_set_tlsext_use_srtp(WOLFSSL_CTX* ctx, const char* profile_str) if (ctx != NULL) { ret = DtlsSrtpSelProfiles(&ctx->dtlsSrtpProfiles, profile_str); } + + if (ret == WC_NO_ERR_TRACE(WOLFSSL_FAILURE)) { + ret = 1; + } else { + ret = 0; + } + return ret; } int wolfSSL_set_tlsext_use_srtp(WOLFSSL* ssl, const char* profile_str) @@ -2081,6 +2088,13 @@ int wolfSSL_set_tlsext_use_srtp(WOLFSSL* ssl, const char* profile_str) if (ssl != NULL) { ret = DtlsSrtpSelProfiles(&ssl->dtlsSrtpProfiles, profile_str); } + + if (ret == WC_NO_ERR_TRACE(WOLFSSL_FAILURE)) { + ret = 1; + } else { + ret = 0; + } + return ret; }