We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2f388dd + 4c0c51f commit cd88ec5Copy full SHA for cd88ec5
2 files changed
src/internal.c
@@ -2253,6 +2253,16 @@ int InitSSL_Side(WOLFSSL* ssl, word16 side)
2253
}
2254
#endif /* WOLFSSL_DTLS && !NO_WOLFSSL_SERVER */
2255
2256
+ /* Forcefully reinitialize suites here as the side may have changed,
2257
+ * unless the user has explicitly set cipher suites.
2258
+ * Two separate checks to ensure suites are always allocated, to avoid
2259
+ * failing suites == NULL check in InitSSL_Suites. */
2260
+ if (ssl->suites && !ssl->suites->setSuites) {
2261
+ FreeSuites(ssl);
2262
+ }
2263
+ if (!ssl->suites) {
2264
+ AllocateSuites(ssl);
2265
2266
return InitSSL_Suites(ssl);
2267
2268
#endif /* OPENSSL_EXTRA || WOLFSSL_EITHER_SIDE ||
src/ssl.c
@@ -17162,7 +17162,15 @@ long wolfSSL_set_options(WOLFSSL* ssl, long op)
17162
if (AllocateSuites(ssl) != 0)
17163
return 0;
17164
if (!ssl->suites->setSuites) {
17165
- InitSuites(ssl->suites, ssl->version, keySz, haveRSA,
+ /* Client side won't set DH params, so it needs haveDH set to TRUE. */
17166
+ if (ssl->options.side == WOLFSSL_CLIENT_END)
17167
+ InitSuites(ssl->suites, ssl->version, keySz, haveRSA,
17168
+ havePSK, TRUE, ssl->options.haveECDSAsig,
17169
+ ssl->options.haveECC, TRUE, ssl->options.haveStaticECC,
17170
+ ssl->options.useAnon,
17171
+ TRUE, TRUE, TRUE, TRUE, ssl->options.side);
17172
+ else
17173
17174
havePSK, ssl->options.haveDH, ssl->options.haveECDSAsig,
17175
ssl->options.haveECC, TRUE, ssl->options.haveStaticECC,
17176
ssl->options.useAnon,
0 commit comments