diff options
author | Richard Levitte <levitte@openssl.org> | 2020-10-15 07:10:29 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-10-19 12:14:11 +0200 |
commit | 0ba71d6a63add7efb244965c0f18502bd786a0f7 (patch) | |
tree | 95c205161b20599ac718a87645b9003c1832d579 /include | |
parent | 6c8149df1fb6fce50a914a70040955d3512b0bd6 (diff) |
DH: make the private key length importable / exportable
The DH private key length, which is an optional parameter, wasn't
properly imported / exported between legacy and provider side
implementations.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13166)
Diffstat (limited to 'include')
-rw-r--r-- | include/crypto/dh.h | 5 | ||||
-rw-r--r-- | include/internal/param_build_set.h | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/include/crypto/dh.h b/include/crypto/dh.h index cd7e1e4a89..4dbd0c582c 100644 --- a/include/crypto/dh.h +++ b/include/crypto/dh.h @@ -8,6 +8,7 @@ */ #include <openssl/core.h> +#include <openssl/params.h> #include <openssl/dh.h> #include "internal/ffc.h" @@ -24,8 +25,10 @@ void dh_cache_named_group(DH *dh); FFC_PARAMS *dh_get0_params(DH *dh); int dh_get0_nid(const DH *dh); -int dh_ffc_params_fromdata(DH *dh, const OSSL_PARAM params[]); +int dh_params_fromdata(DH *dh, const OSSL_PARAM params[]); int dh_key_fromdata(DH *dh, const OSSL_PARAM params[]); +int dh_params_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM params[]); +int dh_key_todata(DH *dh, OSSL_PARAM_BLD *bld, OSSL_PARAM params[]); int dh_check_pub_key_partial(const DH *dh, const BIGNUM *pub_key, int *ret); int dh_check_priv_key(const DH *dh, const BIGNUM *priv_key, int *ret); diff --git a/include/internal/param_build_set.h b/include/internal/param_build_set.h index 36d3b914d9..d1f1863381 100644 --- a/include/internal/param_build_set.h +++ b/include/internal/param_build_set.h @@ -12,6 +12,8 @@ int ossl_param_build_set_int(OSSL_PARAM_BLD *bld, OSSL_PARAM *p, const char *key, int num); +int ossl_param_build_set_long(OSSL_PARAM_BLD *bld, OSSL_PARAM *p, + const char *key, long num); int ossl_param_build_set_utf8_string(OSSL_PARAM_BLD *bld, OSSL_PARAM *p, const char *key, const char *buf); int ossl_param_build_set_octet_string(OSSL_PARAM_BLD *bld, OSSL_PARAM *p, |