diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-08-19 13:27:31 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-08-19 13:27:31 +1000 |
commit | 7fe32ef68855d727c55186bda99b3e2500afa2c2 (patch) | |
tree | 9b838b944a6878e5301a6134bbb411d217933fb2 /crypto | |
parent | c51a8af8cca755ceefba64b3cbd0bdb91c74d77c (diff) | |
download | openssl-7fe32ef68855d727c55186bda99b3e2500afa2c2.tar.gz |
Fix no-cms build errors.
Fixes #12640
The X942-KDF is now indepedent of the CMS code (since it no longer uses CMS_SharedInfo_encode).
Any code related to EVP_PKEY_DH_KDF_X9_42 needs to not be wrapped by !defined(OPENSSL_NO_CMS).
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/12642)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/dh/dh_kdf.c | 4 | ||||
-rw-r--r-- | crypto/dh/dh_pmeth.c | 6 |
2 files changed, 2 insertions, 8 deletions
diff --git a/crypto/dh/dh_kdf.c b/crypto/dh/dh_kdf.c index 0b1e5881c3..6f59d6ecc2 100644 --- a/crypto/dh/dh_kdf.c +++ b/crypto/dh/dh_kdf.c @@ -60,7 +60,7 @@ err: return ret; } -#if !defined(FIPS_MODULE) && !defined(OPENSSL_NO_CMS) +#if !defined(FIPS_MODULE) int DH_KDF_X9_42(unsigned char *out, size_t outlen, const unsigned char *Z, size_t Zlen, ASN1_OBJECT *key_oid, @@ -81,4 +81,4 @@ int DH_KDF_X9_42(unsigned char *out, size_t outlen, return dh_KDF_X9_42_asn1(out, outlen, Z, Zlen, key_alg, ukm, ukmlen, md, libctx, NULL); } -#endif /* !defined(FIPS_MODULE) && !defined(OPENSSL_NO_CMS) */ +#endif /* !defined(FIPS_MODULE) */ diff --git a/crypto/dh/dh_pmeth.c b/crypto/dh/dh_pmeth.c index 39b79ffb36..2c74b39db1 100644 --- a/crypto/dh/dh_pmeth.c +++ b/crypto/dh/dh_pmeth.c @@ -172,11 +172,7 @@ static int pkey_dh_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) case EVP_PKEY_CTRL_DH_KDF_TYPE: if (p1 == -2) return dctx->kdf_type; -#ifdef OPENSSL_NO_CMS - if (p1 != EVP_PKEY_DH_KDF_NONE) -#else if (p1 != EVP_PKEY_DH_KDF_NONE && p1 != EVP_PKEY_DH_KDF_X9_42) -#endif return -2; dctx->kdf_type = p1; return 1; @@ -445,7 +441,6 @@ static int pkey_dh_derive(EVP_PKEY_CTX *ctx, unsigned char *key, *keylen = ret; return 1; } -#ifndef OPENSSL_NO_CMS else if (dctx->kdf_type == EVP_PKEY_DH_KDF_X9_42) { unsigned char *Z = NULL; @@ -475,7 +470,6 @@ static int pkey_dh_derive(EVP_PKEY_CTX *ctx, unsigned char *key, OPENSSL_clear_free(Z, Zlen); return ret; } -#endif return 0; } |