Merge pull request #2244 from dgarske/psk_pk

Fix for static RSA cipher suite with PK callback and no loaded private key
This commit is contained in:
toddouska
2019-05-23 11:43:20 -07:00
committed by GitHub

View File

@@ -17040,6 +17040,15 @@ int DecodePrivateKey(WOLFSSL *ssl, word16* length)
int keySz;
word32 idx;
#ifdef HAVE_PK_CALLBACKS
/* allow no private key if using PK callbacks and CB is set */
if (wolfSSL_CTX_IsPrivatePkSet(ssl->ctx)) {
*length = GetPrivateKeySigSize(ssl);
return 0;
}
else
#endif
/* make sure private key exists */
if (ssl->buffers.key == NULL || ssl->buffers.key->buffer == NULL) {
WOLFSSL_MSG("Private key missing!");