Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions native/com_wolfssl_WolfSSL.c
Original file line number Diff line number Diff line change
Expand Up @@ -2029,6 +2029,7 @@ JNIEXPORT jstring JNICALL Java_com_wolfssl_WolfSSL_getAvailableCipherSuitesIana
byte cipherSuite0;
byte cipherSuite;
#endif
long noOpts = 0;
const char* cipherName = NULL;
const char* ianaName = NULL;
WOLFSSL_METHOD* method = NULL;
Expand Down Expand Up @@ -2067,11 +2068,16 @@ JNIEXPORT jstring JNICALL Java_com_wolfssl_WolfSSL_getAvailableCipherSuitesIana
#ifndef WOLFSSL_NO_TLS12
case 3:
method = wolfTLSv1_2_client_method();
noOpts = SSL_OP_NO_TLSv1_3;
break;
#endif
#ifdef WOLFSSL_TLS13
case 4:
method = wolfTLSv1_3_client_method();
noOpts = SSL_OP_NO_SSLv3 |
SSL_OP_NO_TLSv1 |
SSL_OP_NO_TLSv1_1 |
SSL_OP_NO_TLSv1_2;
break;
#endif
case 5:
Expand Down Expand Up @@ -2112,6 +2118,11 @@ JNIEXPORT jstring JNICALL Java_com_wolfssl_WolfSSL_getAvailableCipherSuitesIana
return NULL;
}

/* Filter cipher suites to only target protocol version */
if (noOpts != 0) {
wolfSSL_set_options(ssl, noOpts);
}

supportedCiphers = wolfSSL_get_ciphers_compat(ssl);
if (supportedCiphers == NULL) {
wolfSSL_free(ssl);
Expand Down
Loading