Merge pull request #1915 from JacobBarthelmeh/Testing

fix side init for set connect/accept functions
This commit is contained in:
David Garske 2018-11-07 09:24:44 -08:00 committed by GitHub
commit 6e4ab91ccf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11700,10 +11700,7 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
#if defined(OPENSSL_EXTRA) || defined(WOLFSSL_EXTRA)
void wolfSSL_set_accept_state(WOLFSSL* ssl)
{
word16 haveRSA = 1;
word16 havePSK = 0;
WOLFSSL_ENTER("SSL_set_accept_state");
WOLFSSL_ENTER("wolfSSL_set_accept_state");
if (ssl->options.side == WOLFSSL_CLIENT_END) {
#ifdef HAVE_ECC
ecc_key key;
@ -11729,19 +11726,10 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
}
#endif
}
ssl->options.side = WOLFSSL_SERVER_END;
/* reset suites in case user switched */
#ifdef NO_RSA
haveRSA = 0;
#endif
#ifndef NO_PSK
havePSK = ssl->options.havePSK;
#endif
InitSuites(ssl->suites, ssl->version, ssl->buffers.keySz, haveRSA,
havePSK, ssl->options.haveDH, ssl->options.haveNTRU,
ssl->options.haveECDSAsig, ssl->options.haveECC,
ssl->options.haveStaticECC, ssl->options.side);
if (InitSSL_Side(ssl, WOLFSSL_SERVER_END) != WOLFSSL_SUCCESS) {
WOLFSSL_MSG("Error initializing server side");
}
}
#endif /* OPENSSL_EXTRA || WOLFSSL_EXTRA */
@ -15689,9 +15677,6 @@ int wolfSSL_ASN1_STRING_to_UTF8(unsigned char **out, WOLFSSL_ASN1_STRING *in)
void wolfSSL_set_connect_state(WOLFSSL* ssl)
{
word16 haveRSA = 1;
word16 havePSK = 0;
if (ssl == NULL) {
WOLFSSL_MSG("WOLFSSL struct pointer passed in was null");
return;
@ -15711,19 +15696,9 @@ void wolfSSL_set_connect_state(WOLFSSL* ssl)
ssl->buffers.serverDH_G.buffer = NULL;
#endif
if (ssl->options.side == WOLFSSL_SERVER_END) {
#ifdef NO_RSA
haveRSA = 0;
#endif
#ifndef NO_PSK
havePSK = ssl->options.havePSK;
#endif
InitSuites(ssl->suites, ssl->version, ssl->buffers.keySz, haveRSA,
havePSK, ssl->options.haveDH, ssl->options.haveNTRU,
ssl->options.haveECDSAsig, ssl->options.haveECC,
ssl->options.haveStaticECC, WOLFSSL_CLIENT_END);
if (InitSSL_Side(ssl, WOLFSSL_CLIENT_END) != WOLFSSL_SUCCESS) {
WOLFSSL_MSG("Error initializing client side");
}
ssl->options.side = WOLFSSL_CLIENT_END;
}
#endif /* OPENSSL_EXTRA || WOLFSSL_EXTRA */