mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
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:
@@ -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!");
|
||||
|
Reference in New Issue
Block a user