aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/kdf
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/kdf')
-rw-r--r--crypto/kdf/hkdf.c4
-rw-r--r--crypto/kdf/kdf_err.c1
2 files changed, 4 insertions, 1 deletions
diff --git a/crypto/kdf/hkdf.c b/crypto/kdf/hkdf.c
index 8b6eeb3bde..d83283fa14 100644
--- a/crypto/kdf/hkdf.c
+++ b/crypto/kdf/hkdf.c
@@ -177,8 +177,10 @@ static int pkey_hkdf_derive(EVP_PKEY_CTX *ctx, unsigned char *key,
{
HKDF_PKEY_CTX *kctx = ctx->data;
- if (kctx->md == NULL || kctx->key == NULL)
+ if (kctx->md == NULL || kctx->key == NULL) {
+ KDFerr(KDF_F_PKEY_HKDF_DERIVE, KDF_R_MISSING_PARAMETER);
return 0;
+ }
switch (kctx->mode) {
case EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND:
diff --git a/crypto/kdf/kdf_err.c b/crypto/kdf/kdf_err.c
index 5706d2d90b..f6193b2458 100644
--- a/crypto/kdf/kdf_err.c
+++ b/crypto/kdf/kdf_err.c
@@ -14,6 +14,7 @@
#ifndef OPENSSL_NO_ERR
static const ERR_STRING_DATA KDF_str_functs[] = {
+ {ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_HKDF_DERIVE, 0), "pkey_hkdf_derive"},
{ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_TLS1_PRF_CTRL_STR, 0),
"pkey_tls1_prf_ctrl_str"},
{ERR_PACK(ERR_LIB_KDF, KDF_F_PKEY_TLS1_PRF_DERIVE, 0),