File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2029,6 +2029,7 @@ JNIEXPORT jstring JNICALL Java_com_wolfssl_WolfSSL_getAvailableCipherSuitesIana
20292029 byte cipherSuite0 ;
20302030 byte cipherSuite ;
20312031#endif
2032+ long noOpts = 0 ;
20322033 const char * cipherName = NULL ;
20332034 const char * ianaName = NULL ;
20342035 WOLFSSL_METHOD * method = NULL ;
@@ -2067,11 +2068,16 @@ JNIEXPORT jstring JNICALL Java_com_wolfssl_WolfSSL_getAvailableCipherSuitesIana
20672068#ifndef WOLFSSL_NO_TLS12
20682069 case 3 :
20692070 method = wolfTLSv1_2_client_method ();
2071+ noOpts = SSL_OP_NO_TLSv1_3 ;
20702072 break ;
20712073#endif
20722074#ifdef WOLFSSL_TLS13
20732075 case 4 :
20742076 method = wolfTLSv1_3_client_method ();
2077+ noOpts = SSL_OP_NO_SSLv3 |
2078+ SSL_OP_NO_TLSv1 |
2079+ SSL_OP_NO_TLSv1_1 |
2080+ SSL_OP_NO_TLSv1_2 ;
20752081 break ;
20762082#endif
20772083 case 5 :
@@ -2112,6 +2118,11 @@ JNIEXPORT jstring JNICALL Java_com_wolfssl_WolfSSL_getAvailableCipherSuitesIana
21122118 return NULL ;
21132119 }
21142120
2121+ /* Filter cipher suites to only target protocol version */
2122+ if (noOpts != 0 ) {
2123+ wolfSSL_set_options (ssl , noOpts );
2124+ }
2125+
21152126 supportedCiphers = wolfSSL_get_ciphers_compat (ssl );
21162127 if (supportedCiphers == NULL ) {
21172128 wolfSSL_free (ssl );
You can’t perform that action at this time.
0 commit comments