summaryrefslogtreecommitdiffstats
path: root/crypto/dh
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-11-16 12:42:18 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-12-02 12:15:05 +1000
commit89cccbea51fa52a1e4784a9ece35d96e4dcbfd30 (patch)
tree89cb59183ed18f1e5dd5cb86fed810b04cce466e /crypto/dh
parent8018352457cf9c98ce59f1e591fcd69f2153b649 (diff)
Add EVP_KDF-X942 to the fips module
The X942 KDF had been modified so that it supports all optional fields - not just the fields used by CMS. As there are 2 types of KDF for X942 - this has been made a bit clearer by adding an X942KDF-ASN1 alias. X942KDF-CONCAT has also been added as an alias of X963KDF. This work was instigated as a result of the ACVP tests optionally being able to use keybits for the supp_pubinfo field. Setting the parameter OSSL_KDF_PARAM_X942_USE_KEYBITS to 0 allows this to be disabled. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/13418)
Diffstat (limited to 'crypto/dh')
-rw-r--r--crypto/dh/dh_ctrl.c4
-rw-r--r--crypto/dh/dh_kdf.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/crypto/dh/dh_ctrl.c b/crypto/dh/dh_ctrl.c
index 2aa69fd154..291b0ad419 100644
--- a/crypto/dh/dh_ctrl.c
+++ b/crypto/dh/dh_ctrl.c
@@ -237,7 +237,7 @@ int EVP_PKEY_CTX_set_dh_kdf_type(EVP_PKEY_CTX *ctx, int kdf)
kdf_type = "";
break;
case EVP_PKEY_DH_KDF_X9_42:
- kdf_type = OSSL_KDF_NAME_X942KDF;
+ kdf_type = OSSL_KDF_NAME_X942KDF_ASN1;
break;
default:
return -2;
@@ -289,7 +289,7 @@ int EVP_PKEY_CTX_get_dh_kdf_type(EVP_PKEY_CTX *ctx)
if (kdf_type[0] == '\0')
return EVP_PKEY_DH_KDF_NONE;
- else if (strcmp(kdf_type, OSSL_KDF_NAME_X942KDF) == 0)
+ else if (strcmp(kdf_type, OSSL_KDF_NAME_X942KDF_ASN1) == 0)
return EVP_PKEY_DH_KDF_X9_42;
return -1;
diff --git a/crypto/dh/dh_kdf.c b/crypto/dh/dh_kdf.c
index 9737d4d712..ea2cd6386c 100644
--- a/crypto/dh/dh_kdf.c
+++ b/crypto/dh/dh_kdf.c
@@ -37,7 +37,7 @@ int dh_KDF_X9_42_asn1(unsigned char *out, size_t outlen,
OSSL_PARAM params[5], *p = params;
const char *mdname = EVP_MD_name(md);
- kdf = EVP_KDF_fetch(libctx, OSSL_KDF_NAME_X942KDF, propq);
+ kdf = EVP_KDF_fetch(libctx, OSSL_KDF_NAME_X942KDF_ASN1, propq);
kctx = EVP_KDF_CTX_new(kdf);
if (kctx == NULL)
goto err;