mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 20:24:39 +02:00
Merge pull request #8252 from anhu/use_srtp_retcode
wolfSSL_CTX_set_tlsext_use_srtp() should return 1 on failure and 0 up…
This commit is contained in:
14
src/ssl.c
14
src/ssl.c
@@ -2073,6 +2073,13 @@ int wolfSSL_CTX_set_tlsext_use_srtp(WOLFSSL_CTX* ctx, const char* profile_str)
|
|||||||
if (ctx != NULL) {
|
if (ctx != NULL) {
|
||||||
ret = DtlsSrtpSelProfiles(&ctx->dtlsSrtpProfiles, profile_str);
|
ret = DtlsSrtpSelProfiles(&ctx->dtlsSrtpProfiles, profile_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret == WC_NO_ERR_TRACE(WOLFSSL_FAILURE)) {
|
||||||
|
ret = 1;
|
||||||
|
} else {
|
||||||
|
ret = 0;
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
int wolfSSL_set_tlsext_use_srtp(WOLFSSL* ssl, const char* profile_str)
|
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) {
|
if (ssl != NULL) {
|
||||||
ret = DtlsSrtpSelProfiles(&ssl->dtlsSrtpProfiles, profile_str);
|
ret = DtlsSrtpSelProfiles(&ssl->dtlsSrtpProfiles, profile_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret == WC_NO_ERR_TRACE(WOLFSSL_FAILURE)) {
|
||||||
|
ret = 1;
|
||||||
|
} else {
|
||||||
|
ret = 0;
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
tests/api.c
14
tests/api.c
@@ -8461,6 +8461,13 @@ static int test_client_nofail(void* args, cbType cb)
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WOLFSSL_SRTP
|
||||||
|
/* make sure that NULL (error condition) returns 1 */
|
||||||
|
if (wolfSSL_CTX_set_tlsext_use_srtp(ctx, NULL) != 1) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CRL
|
#ifdef HAVE_CRL
|
||||||
if (cbf != NULL && cbf->crlPemFile != NULL) {
|
if (cbf != NULL && cbf->crlPemFile != NULL) {
|
||||||
if (wolfSSL_CTX_EnableCRL(ctx, WOLFSSL_CRL_CHECKALL) != WOLFSSL_SUCCESS)
|
if (wolfSSL_CTX_EnableCRL(ctx, WOLFSSL_CRL_CHECKALL) != WOLFSSL_SUCCESS)
|
||||||
@@ -8503,6 +8510,13 @@ static int test_client_nofail(void* args, cbType cb)
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef WOLFSSL_SRTP
|
||||||
|
/* make sure that NULL (error condition) returns 1 */
|
||||||
|
if (wolfSSL_set_tlsext_use_srtp(ssl, NULL) != 1) {
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!doUdp) {
|
if (!doUdp) {
|
||||||
if (wolfSSL_set_fd(ssl, sockfd) != WOLFSSL_SUCCESS) {
|
if (wolfSSL_set_fd(ssl, sockfd) != WOLFSSL_SUCCESS) {
|
||||||
/*err_sys("SSL_set_fd failed");*/
|
/*err_sys("SSL_set_fd failed");*/
|
||||||
|
Reference in New Issue
Block a user