forked from wolfSSL/wolfssl
disable-asn, disable-rsa, enable-psk fixed
This commit is contained in:
@ -1499,7 +1499,9 @@ int InitSSL(WOLFSSL* ssl, WOLFSSL_CTX* ctx)
|
|||||||
int ret;
|
int ret;
|
||||||
byte haveRSA = 0;
|
byte haveRSA = 0;
|
||||||
byte havePSK = 0;
|
byte havePSK = 0;
|
||||||
|
#ifdef HAVE_ANON
|
||||||
byte haveAnon = 0;
|
byte haveAnon = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
ssl->ctx = ctx; /* only for passing to calls, options could change */
|
ssl->ctx = ctx; /* only for passing to calls, options could change */
|
||||||
ssl->version = ctx->method->version;
|
ssl->version = ctx->method->version;
|
||||||
@ -1886,7 +1888,11 @@ int InitSSL(WOLFSSL* ssl, WOLFSSL_CTX* ctx)
|
|||||||
#endif
|
#endif
|
||||||
#ifndef NO_CERTS
|
#ifndef NO_CERTS
|
||||||
/* make sure server has cert and key unless using PSK or Anon */
|
/* make sure server has cert and key unless using PSK or Anon */
|
||||||
if (ssl->options.side == WOLFSSL_SERVER_END && !havePSK && !haveAnon)
|
if (ssl->options.side == WOLFSSL_SERVER_END && !havePSK
|
||||||
|
#ifdef HAVE_ANON
|
||||||
|
&& !haveAnon
|
||||||
|
#endif
|
||||||
|
)
|
||||||
if (!ssl->buffers.certificate.buffer || !ssl->buffers.key.buffer) {
|
if (!ssl->buffers.certificate.buffer || !ssl->buffers.key.buffer) {
|
||||||
WOLFSSL_MSG("Server missing certificate and/or private key");
|
WOLFSSL_MSG("Server missing certificate and/or private key");
|
||||||
return NO_PRIVATE_KEY;
|
return NO_PRIVATE_KEY;
|
||||||
|
Reference in New Issue
Block a user