summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/crypto/dh/dh_pmeth.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2017-11-02 18:30:41 +0000
committerRenato Botelho <renato@netgate.com>2017-11-13 15:16:56 -0200
commit3c265be35a8193948998f35886be227dff6eab48 (patch)
tree736b8c2419a99e19b4e8237112412c9e4a1cba66 /crypto/openssl/crypto/dh/dh_pmeth.c
parent70ee3cb33663d3f5f9666994a129f8053d8ef7b5 (diff)
downloadFreeBSD-src-3c265be35a8193948998f35886be227dff6eab48.zip
FreeBSD-src-3c265be35a8193948998f35886be227dff6eab48.tar.gz
MFC: r325328
Merge OpenSSL 1.0.2m. (cherry picked from commit a88f0513c4cf81f98bab740e4f112f1a6d7f4d42)
Diffstat (limited to 'crypto/openssl/crypto/dh/dh_pmeth.c')
-rw-r--r--crypto/openssl/crypto/dh/dh_pmeth.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/crypto/openssl/crypto/dh/dh_pmeth.c b/crypto/openssl/crypto/dh/dh_pmeth.c
index b58e3fa..6452482 100644
--- a/crypto/openssl/crypto/dh/dh_pmeth.c
+++ b/crypto/openssl/crypto/dh/dh_pmeth.c
@@ -207,7 +207,11 @@ 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;
@@ -448,7 +452,9 @@ static int pkey_dh_derive(EVP_PKEY_CTX *ctx, unsigned char *key,
return ret;
*keylen = ret;
return 1;
- } else if (dctx->kdf_type == EVP_PKEY_DH_KDF_X9_42) {
+ }
+#ifndef OPENSSL_NO_CMS
+ else if (dctx->kdf_type == EVP_PKEY_DH_KDF_X9_42) {
unsigned char *Z = NULL;
size_t Zlen = 0;
if (!dctx->kdf_outlen || !dctx->kdf_oid)
@@ -479,6 +485,7 @@ static int pkey_dh_derive(EVP_PKEY_CTX *ctx, unsigned char *key,
}
return ret;
}
+#endif
return 1;
}
OpenPOWER on IntegriCloud