summaryrefslogtreecommitdiff
path: root/Cryptlib/OpenSSL/crypto/dh/dh_pmeth.c
diff options
context:
space:
mode:
Diffstat (limited to 'Cryptlib/OpenSSL/crypto/dh/dh_pmeth.c')
-rw-r--r--Cryptlib/OpenSSL/crypto/dh/dh_pmeth.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/Cryptlib/OpenSSL/crypto/dh/dh_pmeth.c b/Cryptlib/OpenSSL/crypto/dh/dh_pmeth.c
index e5f345aa..926be98e 100644
--- a/Cryptlib/OpenSSL/crypto/dh/dh_pmeth.c
+++ b/Cryptlib/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,10 +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) {
-#ifdef OPENSSL_NO_CMS
- return 0;
-#else
+ }
+#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)
@@ -481,9 +484,9 @@ static int pkey_dh_derive(EVP_PKEY_CTX *ctx, unsigned char *key,
OPENSSL_free(Z);
}
return ret;
-#endif
}
- return 1;
+#endif
+ return 0;
}
const EVP_PKEY_METHOD dh_pkey_meth = {