Private Key ID: change to always set priv key type and size

When a certificate is loaded then the private key type and size is set
based on the public key.
Always set, even if previously set.
Use case is setting an RSA certificate against ctx and then setting EC
certificate against ssl.
This commit is contained in:
Sean Parkinson
2023-02-22 08:07:27 +10:00
parent da04e0fb4c
commit 39cfd8e566

View File

@ -7671,11 +7671,11 @@ int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff,
}
#ifdef WOLF_PRIVATE_KEY_ID
if (ssl != NULL && ssl->buffers.keyType == 0) {
if (ssl != NULL) {
ssl->buffers.keyType = keyType;
ssl->buffers.keySz = keySz;
}
else if (ctx != NULL && ctx->privateKeyType == 0) {
else if (ctx != NULL) {
ctx->privateKeyType = keyType;
ctx->privateKeySz = keySz;
}