summaryrefslogtreecommitdiffstats
path: root/crypto/ec
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-08-07 06:29:00 +0200
committerShane Lontis <shane.lontis@oracle.com>2020-08-07 06:29:00 +0200
commit5ccada09aae0cf846d3381a161d3eb20d4d9abfd (patch)
tree39fc4e655a53c146bc6a8fcde3f0746c56a97a1c /crypto/ec
parentdrbgtest: avoid a memory leak (diff)
downloadopenssl-5ccada09aae0cf846d3381a161d3eb20d4d9abfd.tar.xz
openssl-5ccada09aae0cf846d3381a161d3eb20d4d9abfd.zip
Add evp_test fixes.
Changed many tests so they also test fips (and removed 'availablein = default' from some tests). Seperated the monolithic evppkey.txt file into smaller maintainable groups. Changed the availablein option so it must be first - this then skips the entire test before any fetching happens. Changed the code so that all the OPENSSL_NO_XXXX tests are done in code via methods such as is_cipher_disabled(alg), before the fetch happens. Added missing libctx's found by adding a libctx to test_evp. Broke up large data files for cipher, kdf's and mac's into smaller pieces so they no longer need 'AvailableIn = default' Added missing algorithm aliases for cipher/digests to the providers. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12236)
Diffstat (limited to 'crypto/ec')
-rw-r--r--crypto/ec/ec_pmeth.c3
-rw-r--r--crypto/ec/ecdh_kdf.c7
2 files changed, 6 insertions, 4 deletions
diff --git a/crypto/ec/ec_pmeth.c b/crypto/ec/ec_pmeth.c
index 7eeeedc0e9..0758d9be4a 100644
--- a/crypto/ec/ec_pmeth.c
+++ b/crypto/ec/ec_pmeth.c
@@ -216,7 +216,8 @@ static int pkey_ec_kdf_derive(EVP_PKEY_CTX *ctx,
goto err;
/* Do KDF stuff */
if (!ecdh_KDF_X9_63(key, *keylen, ktmp, ktmplen,
- dctx->kdf_ukm, dctx->kdf_ukmlen, dctx->kdf_md))
+ dctx->kdf_ukm, dctx->kdf_ukmlen, dctx->kdf_md,
+ ctx->libctx, ctx->propquery))
goto err;
rv = 1;
diff --git a/crypto/ec/ecdh_kdf.c b/crypto/ec/ecdh_kdf.c
index fb501c6ada..7695e0be18 100644
--- a/crypto/ec/ecdh_kdf.c
+++ b/crypto/ec/ecdh_kdf.c
@@ -24,13 +24,14 @@
int ecdh_KDF_X9_63(unsigned char *out, size_t outlen,
const unsigned char *Z, size_t Zlen,
const unsigned char *sinfo, size_t sinfolen,
- const EVP_MD *md)
+ const EVP_MD *md,
+ OPENSSL_CTX *libctx, const char *propq)
{
int ret = 0;
EVP_KDF_CTX *kctx = NULL;
OSSL_PARAM params[4], *p = params;
const char *mdname = EVP_MD_name(md);
- EVP_KDF *kdf = EVP_KDF_fetch(NULL, OSSL_KDF_NAME_X963KDF, NULL);
+ EVP_KDF *kdf = EVP_KDF_fetch(libctx, OSSL_KDF_NAME_X963KDF, propq);
if ((kctx = EVP_KDF_CTX_new(kdf)) != NULL) {
*p++ = OSSL_PARAM_construct_utf8_string(OSSL_KDF_PARAM_DIGEST,
@@ -59,6 +60,6 @@ int ECDH_KDF_X9_62(unsigned char *out, size_t outlen,
const unsigned char *sinfo, size_t sinfolen,
const EVP_MD *md)
{
- return ecdh_KDF_X9_63(out, outlen, Z, Zlen, sinfo, sinfolen, md);
+ return ecdh_KDF_X9_63(out, outlen, Z, Zlen, sinfo, sinfolen, md, NULL, NULL);
}
#endif