forked from wolfSSL/wolfssl
Fix for static RSA cipher suite (AES128-GCM-SHA256) with PK callbacks and no private key set. ZD 5092
This commit is contained in:
@ -17030,6 +17030,15 @@ int DecodePrivateKey(WOLFSSL *ssl, word16* length)
|
|||||||
int keySz;
|
int keySz;
|
||||||
word32 idx;
|
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 */
|
/* make sure private key exists */
|
||||||
if (ssl->buffers.key == NULL || ssl->buffers.key->buffer == NULL) {
|
if (ssl->buffers.key == NULL || ssl->buffers.key->buffer == NULL) {
|
||||||
WOLFSSL_MSG("Private key missing!");
|
WOLFSSL_MSG("Private key missing!");
|
||||||
|
Reference in New Issue
Block a user