projects
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f23e4a1
)
kdf_exch.c (kdf_derive): Proper handling of NULL secret
author
Tomas Mraz
<tmraz@fedoraproject.org>
Thu, 14 Jan 2021 14:53:08 +0000
(15:53 +0100)
committer
Tomas Mraz
<tomas@openssl.org>
Thu, 21 Jan 2021 17:08:02 +0000
(18:08 +0100)
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13869)
providers/implementations/exchange/kdf_exch.c
patch
|
blob
|
history
diff --git
a/providers/implementations/exchange/kdf_exch.c
b/providers/implementations/exchange/kdf_exch.c
index c022a351072281e6ae3968ccdef42d66523cefd7..43652faf50482f9bec4297711cc8578411d29242 100644
(file)
--- 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)