Fix for static RSA cipher suite (AES128-GCM-SHA256) with PK callbacks and no private key set. ZD 5092

This commit is contained in:
David Garske 2019-05-15 19:35:30 -07:00
parent 651087ab5a
commit fd50248139

View File

@ -17030,6 +17030,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!");