forked from wolfSSL/wolfssl
Merge pull request #8330 from dgarske/compat
Fix for SSL_set_mtu compat function return code
This commit is contained in:
12
src/ssl.c
12
src/ssl.c
@@ -2124,14 +2124,17 @@ int wolfSSL_dtls_set_mtu(WOLFSSL* ssl, word16 newMtu)
|
||||
return WOLFSSL_SUCCESS;
|
||||
}
|
||||
|
||||
#if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA)
|
||||
int wolfSSL_set_mtu_compat(WOLFSSL* ssl, unsigned short mtu) {
|
||||
if (wolfSSL_dtls_set_mtu(ssl, mtu) == 0)
|
||||
#ifdef OPENSSL_EXTRA
|
||||
/* Maps to compatibility API SSL_set_mtu and is same as wolfSSL_dtls_set_mtu,
|
||||
* but expects only success or failure returns. */
|
||||
int wolfSSL_set_mtu_compat(WOLFSSL* ssl, unsigned short mtu)
|
||||
{
|
||||
if (wolfSSL_dtls_set_mtu(ssl, mtu) == WOLFSSL_SUCCESS)
|
||||
return WOLFSSL_SUCCESS;
|
||||
else
|
||||
return WOLFSSL_FAILURE;
|
||||
}
|
||||
#endif /* OPENSSL_ALL || OPENSSL_EXTRA */
|
||||
#endif /* OPENSSL_EXTRA */
|
||||
|
||||
#endif /* WOLFSSL_DTLS && (WOLFSSL_SCTP || WOLFSSL_DTLS_MTU) */
|
||||
|
||||
@@ -12596,6 +12599,7 @@ cleanup:
|
||||
#endif /* OPENSSL_EXTRA || WOLFSSL_EXTRA || WOLFSSL_WPAS_SMALL */
|
||||
|
||||
/* return true if connection established */
|
||||
/* this works for TLS and DTLS */
|
||||
int wolfSSL_is_init_finished(const WOLFSSL* ssl)
|
||||
{
|
||||
if (ssl == NULL)
|
||||
|
@@ -90249,6 +90249,10 @@ static int test_wolfSSL_dtls_set_mtu(void)
|
||||
ExpectIntEQ(wolfSSL_CTX_dtls_set_mtu(ctx, 1488), WOLFSSL_SUCCESS);
|
||||
ExpectIntEQ(wolfSSL_dtls_set_mtu(ssl, 1488), WOLFSSL_SUCCESS);
|
||||
|
||||
#ifdef OPENSSL_EXTRA
|
||||
ExpectIntEQ(SSL_set_mtu(ssl, 1488), WOLFSSL_SUCCESS);
|
||||
#endif
|
||||
|
||||
wolfSSL_free(ssl);
|
||||
wolfSSL_CTX_free(ctx);
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user