Skip to content

Commit be19d3c

Browse files
committed
NEWS: note OSSL_PARAM_BLD API as public.
Reviewed-by: Nicola Tuveri <[email protected]> (Merged from openssl#11390)
1 parent 110bff6 commit be19d3c

File tree

4 files changed

+40
-6
lines changed

4 files changed

+40
-6
lines changed

CHANGES.md

+8
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ OpenSSL 3.0
2424

2525
### Changes between 1.1.1 and 3.0 [xx XXX xxxx] ###
2626

27+
* Added OSSL_PARAM_BLD to the public interface. This allows OSSL_PARAM
28+
arrays to be more easily constructed via a series of utility functions.
29+
Create a parameter builder using OSSL_PARAM_BLD_new(), add parameters using
30+
the various push functions and finally convert to a passable OSSL_PARAM
31+
array using OSSL_PARAM_BLD_to_param().
32+
33+
* Paul Dale *
34+
2735
* EVP_PKEY_get0_RSA(), EVP_PKEY_get0_DSA(), EVP_PKEY_get0_DH(), and
2836
EVP_PKEY_get0_EC_KEY() can now handle EVP_PKEYs with provider side
2937
internal keys, if they correspond to one of those built in types.

NEWS.md

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ OpenSSL 3.0
3131
* enable-crypto-mdebug and enable-crypto-mdebug-backtrace were mostly
3232
disabled; the project uses address sanitize/leak-detect instead.
3333
* Added OSSL_SERIALIZER, a generic serializer API.
34+
* Added OSSL_PARAM_BLD, an easier to use API to OSSL_PARAM.
3435
* Added error raising macros, ERR_raise() and ERR_raise_data().
3536
* Deprecated ERR_put_error().
3637
* Added OSSL_PROVIDER_available(), to check provider availibility.

doc/man3/OSSL_PARAM_BLD_init.pod doc/man3/OSSL_PARAM_BLD_new.pod

+12-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
=head1 NAME
44

5-
OSSL_PARAM_BLD_init, OSSL_PARAM_BLD_to_param,
5+
OSSL_PARAM_BLD_new, OSSL_PARAM_BLD_to_param, OSSL_PARAM_BLD_free_params,
66
OSSL_PARAM_BLD_free, OSSL_PARAM_BLD_push_int, OSSL_PARAM_BLD_push_uint,
77
OSSL_PARAM_BLD_push_long, OSSL_PARAM_BLD_push_ulong,
88
OSSL_PARAM_BLD_push_int32, OSSL_PARAM_BLD_push_uint32,
@@ -24,7 +24,8 @@ OSSL_PARAM_BLD_push_octet_string, OSSL_PARAM_BLD_push_octet_ptr
2424

2525
void OSSL_PARAM_BLD_init(OSSL_PARAM_BLD *bld);
2626
OSSL_PARAM *OSSL_PARAM_BLD_to_param(OSSL_PARAM_BLD *bld);
27-
void OSSL_PARAM_BLD_free(OSSL_PARAM *params);
27+
void OSSL_PARAM_BLD_free_params(OSSL_PARAM *params);
28+
void OSSL_PARAM_BLD_free(OSSL_PARAM_BLD *bld);
2829

2930
int OSSL_PARAM_BLD_push_TYPE(OSSL_PARAM_BLD *bld, const char *key, TYPE val);
3031

@@ -52,12 +53,15 @@ OSSL_PARAM_BLD_init() initialises the OSSL_PARAM_BLD structure so that values
5253
can be added.
5354
Any existing values are cleared.
5455

56+
OSSL_PARAM_BLD_free() deallocates the memory allocates by OSSL_PARAM_BLD_new().
57+
5558
OSSL_PARAM_BLD_to_param() converts a built up OSSL_PARAM_BLD structure
5659
I<bld> into an allocated OSSL_PARAM array.
5760
The OSSL_PARAM array and all associated storage must be freed by calling
58-
OSSL_PARAM_BLD_free() with the functions return value.
61+
OSSL_PARAM_BLD_free_params() with the functions return value.
62+
OSSL_PARAM_BLD_free() can safely be called any time after this function is.
5963

60-
OSSL_PARAM_BLD_free() deallocates the memory allocated by
64+
OSSL_PARAM_BLD_free_params() deallocates the memory allocated by
6165
OSSL_PARAM_BLD_to_param().
6266

6367
=begin comment
@@ -156,9 +160,10 @@ private key.
156160
|| !OSSL_PARAM_BLD_push_BN(&bld, "d", d)
157161
|| (params = OSSL_PARAM_BLD_to_param(&bld)) == NULL)
158162
goto err;
163+
OSSL_PARAM_BLD_free(bld);
159164
/* Use params */
160165
...
161-
OSSL_PARAM_BLD_free(params);
166+
OSSL_PARAM_BLD_free_params(params);
162167

163168
=head2 Example 2
164169

@@ -173,9 +178,10 @@ public key.
173178
|| !OSSL_PARAM_BLD_push_BN(&bld, "d", d)
174179
|| (params = OSSL_PARAM_BLD_to_param(&bld)) == NULL)
175180
goto err;
181+
OSSL_PARAM_BLD_free(bld);
176182
/* Use params */
177183
...
178-
OSSL_PARAM_BLD_free(params);
184+
OSSL_PARAM_BLD_free_params(params);
179185

180186
=head1 SEE ALSO
181187

util/libcrypto.num

+19
Original file line numberDiff line numberDiff line change
@@ -5000,6 +5000,25 @@ EVP_PKEY_CTX_set_rsa_keygen_primes ? 3_0_0 EXIST::FUNCTION:RSA
50005000
NCONF_new_with_libctx ? 3_0_0 EXIST::FUNCTION:
50015001
CONF_modules_load_file_with_libctx ? 3_0_0 EXIST::FUNCTION:
50025002
OPENSSL_CTX_load_config ? 3_0_0 EXIST::FUNCTION:
5003+
OSSL_PARAM_BLD_init ? 3_0_0 EXIST::FUNCTION:
5004+
OSSL_PARAM_BLD_to_param ? 3_0_0 EXIST::FUNCTION:
5005+
OSSL_PARAM_BLD_free ? 3_0_0 EXIST::FUNCTION:
5006+
OSSL_PARAM_BLD_push_int ? 3_0_0 EXIST::FUNCTION:
5007+
OSSL_PARAM_BLD_push_uint ? 3_0_0 EXIST::FUNCTION:
5008+
OSSL_PARAM_BLD_push_long ? 3_0_0 EXIST::FUNCTION:
5009+
OSSL_PARAM_BLD_push_ulong ? 3_0_0 EXIST::FUNCTION:
5010+
OSSL_PARAM_BLD_push_int32 ? 3_0_0 EXIST::FUNCTION:
5011+
OSSL_PARAM_BLD_push_uint32 ? 3_0_0 EXIST::FUNCTION:
5012+
OSSL_PARAM_BLD_push_int64 ? 3_0_0 EXIST::FUNCTION:
5013+
OSSL_PARAM_BLD_push_uint64 ? 3_0_0 EXIST::FUNCTION:
5014+
OSSL_PARAM_BLD_push_size_t ? 3_0_0 EXIST::FUNCTION:
5015+
OSSL_PARAM_BLD_push_double ? 3_0_0 EXIST::FUNCTION:
5016+
OSSL_PARAM_BLD_push_BN ? 3_0_0 EXIST::FUNCTION:
5017+
OSSL_PARAM_BLD_push_BN_pad ? 3_0_0 EXIST::FUNCTION:
5018+
OSSL_PARAM_BLD_push_utf8_string ? 3_0_0 EXIST::FUNCTION:
5019+
OSSL_PARAM_BLD_push_utf8_ptr ? 3_0_0 EXIST::FUNCTION:
5020+
OSSL_PARAM_BLD_push_octet_string ? 3_0_0 EXIST::FUNCTION:
5021+
OSSL_PARAM_BLD_push_octet_ptr ? 3_0_0 EXIST::FUNCTION:
50035022
EVP_PKEY_set_type_by_keymgmt ? 3_0_0 EXIST::FUNCTION:
50045023
OCSP_RESPID_set_by_key_ex ? 3_0_0 EXIST::FUNCTION:OCSP
50055024
OCSP_RESPID_match_ex ? 3_0_0 EXIST::FUNCTION:OCSP

0 commit comments

Comments
 (0)