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)
diff --git a/crypto/param_build_set.c b/crypto/param_build_set.c index b74b0d5..1ea8097 100644 --- a/crypto/param_build_set.c +++ b/crypto/param_build_set.c
@@ -30,6 +30,17 @@ 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) {