diff options
-rw-r--r-- | providers/implementations/exchange/kdf_exch.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/providers/implementations/exchange/kdf_exch.c b/providers/implementations/exchange/kdf_exch.c index c022a35107..43652faf50 100644 --- a/providers/implementations/exchange/kdf_exch.c +++ b/providers/implementations/exchange/kdf_exch.c @@ -95,7 +95,13 @@ static int kdf_derive(void *vpkdfctx, unsigned char *secret, size_t *secretlen, if (!ossl_prov_is_running()) return 0; - return EVP_KDF_derive(pkdfctx->kdfctx, secret, *secretlen); + + if (secret == NULL) { + *secretlen = EVP_KDF_CTX_get_kdf_size(pkdfctx->kdfctx); + return 1; + } + + return EVP_KDF_derive(pkdfctx->kdfctx, secret, outlen); } static void kdf_freectx(void *vpkdfctx) |