From 39cfd8e56671f2e51a21ce56c86a431497c7dfa3 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Wed, 22 Feb 2023 08:07:27 +1000 Subject: [PATCH] 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. --- src/ssl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index b2e12d98a..61c1a5e7d 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -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; }