diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-02-16 13:03:46 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-02-16 13:03:46 +1000 |
commit | 8083fd3a183d4c881d6b15727cbc6cb7faeb3280 (patch) | |
tree | 82e998aa30cc9dc610b4f262df1f7ef73b23edad /providers/implementations | |
parent | 98ad3fe82bd3e7e7f929dd1fa4ef3915426002c0 (diff) |
Add FFC param/key validation
Embed libctx in dsa and dh objects and cleanup internal methods to not pass libctx (This makes it consistent with the rsa changes)
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10910)
Diffstat (limited to 'providers/implementations')
-rw-r--r-- | providers/implementations/exchange/dh_exch.c | 4 | ||||
-rw-r--r-- | providers/implementations/keymgmt/dh_kmgmt.c | 5 | ||||
-rw-r--r-- | providers/implementations/keymgmt/dsa_kmgmt.c | 2 | ||||
-rw-r--r-- | providers/implementations/signature/dsa.c | 3 |
4 files changed, 7 insertions, 7 deletions
diff --git a/providers/implementations/exchange/dh_exch.c b/providers/implementations/exchange/dh_exch.c index 94c232965f..418896e46d 100644 --- a/providers/implementations/exchange/dh_exch.c +++ b/providers/implementations/exchange/dh_exch.c @@ -92,9 +92,9 @@ static int dh_derive(void *vpdhctx, unsigned char *secret, size_t *secretlen, DH_get0_key(pdhctx->dhpeer, &pub_key, NULL); if (pdhctx->pad) - ret = dh_compute_key_padded(pdhctx->libctx, secret, pub_key, pdhctx->dh); + ret = DH_compute_key_padded(secret, pub_key, pdhctx->dh); else - ret = dh_compute_key(pdhctx->libctx, secret, pub_key, pdhctx->dh); + ret = DH_compute_key(secret, pub_key, pdhctx->dh); if (ret <= 0) return 0; diff --git a/providers/implementations/keymgmt/dh_kmgmt.c b/providers/implementations/keymgmt/dh_kmgmt.c index 9a1734bd57..1694421c3c 100644 --- a/providers/implementations/keymgmt/dh_kmgmt.c +++ b/providers/implementations/keymgmt/dh_kmgmt.c @@ -10,12 +10,13 @@ #include <openssl/core_numbers.h> #include <openssl/core_names.h> #include <openssl/bn.h> -#include <openssl/dh.h> #include <openssl/params.h> #include "internal/param_build.h" #include "crypto/dh.h" #include "prov/implementations.h" #include "prov/providercommon.h" +#include "prov/provider_ctx.h" +#include "crypto/dh.h" static OSSL_OP_keymgmt_new_fn dh_newdata; static OSSL_OP_keymgmt_free_fn dh_freedata; @@ -137,7 +138,7 @@ static int key_to_params(DH *dh, OSSL_PARAM_BLD *tmpl) static void *dh_newdata(void *provctx) { - return DH_new(); + return dh_new_with_ctx(PROV_LIBRARY_CONTEXT_OF(provctx)); } static void dh_freedata(void *keydata) diff --git a/providers/implementations/keymgmt/dsa_kmgmt.c b/providers/implementations/keymgmt/dsa_kmgmt.c index 78c479e671..1855474c85 100644 --- a/providers/implementations/keymgmt/dsa_kmgmt.c +++ b/providers/implementations/keymgmt/dsa_kmgmt.c @@ -150,7 +150,7 @@ static int key_to_params(DSA *dsa, OSSL_PARAM_BLD *tmpl) static void *dsa_newdata(void *provctx) { - return DSA_new(); + return dsa_new_with_ctx(PROV_LIBRARY_CONTEXT_OF(provctx)); } static void dsa_freedata(void *keydata) diff --git a/providers/implementations/signature/dsa.c b/providers/implementations/signature/dsa.c index 6c5550bf42..99183e8f86 100644 --- a/providers/implementations/signature/dsa.c +++ b/providers/implementations/signature/dsa.c @@ -200,8 +200,7 @@ static int dsa_sign(void *vpdsactx, unsigned char *sig, size_t *siglen, if (mdsize != 0 && tbslen != mdsize) return 0; - ret = dsa_sign_int(pdsactx->libctx, 0, tbs, tbslen, sig, &sltmp, - pdsactx->dsa); + ret = dsa_sign_int(0, tbs, tbslen, sig, &sltmp, pdsactx->dsa); if (ret <= 0) return 0; |