summaryrefslogtreecommitdiffstats
path: root/crypto/param_build_set.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-10-15 07:10:29 +0200
committerRichard Levitte <levitte@openssl.org>2020-10-19 12:14:11 +0200
commit0ba71d6a63add7efb244965c0f18502bd786a0f7 (patch)
tree95c205161b20599ac718a87645b9003c1832d579 /crypto/param_build_set.c
parent6c8149df1fb6fce50a914a70040955d3512b0bd6 (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 'crypto/param_build_set.c')
-rw-r--r--crypto/param_build_set.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/crypto/param_build_set.c b/crypto/param_build_set.c
index b74b0d59ee..1ea8097e88 100644
--- a/crypto/param_build_set.c
+++ b/crypto/param_build_set.c
@@ -30,6 +30,17 @@ int ossl_param_build_set_int(OSSL_PARAM_BLD *bld, OSSL_PARAM *p,
return 1;
}
+int ossl_param_build_set_long(OSSL_PARAM_BLD *bld, OSSL_PARAM *p,
+ const char *key, long num)
+{
+ if (bld != NULL)
+ return OSSL_PARAM_BLD_push_long(bld, key, num);
+ p = OSSL_PARAM_locate(p, key);
+ if (p != NULL)
+ return OSSL_PARAM_set_long(p, num);
+ return 1;
+}
+
int ossl_param_build_set_utf8_string(OSSL_PARAM_BLD *bld, OSSL_PARAM *p,
const char *key, const char *buf)
{