]> git.ipfire.org Git - thirdparty/openssl.git/commit - crypto/params.c
OSSL_PARAM: Add string pointer getters
authorRichard Levitte <levitte@openssl.org>
Tue, 28 Jul 2020 20:00:09 +0000 (22:00 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 24 Aug 2020 08:02:26 +0000 (10:02 +0200)
commitab00ddb55907317d6cece552d12ddf3263c01043
tree8190173cf3aa3f5a5789dbc3993a2d580e69402e
parentc4fc564d48456be622509886d3ea5618fce2a02e
OSSL_PARAM: Add string pointer getters

When some function receives an OSSL_PARAM array to pilfer for data,
and there is a string of some sort, and all the code needs is to get
the pointer to the data, rather than a copy, there is currently no
other way than to use |param->data| directly.  This is of course a
valid method, but lacks any safety check (is |param->data_type|
correct, for example?).

OSSL_PARAM_get_utf8_string_ptr() and OSSL_PARAM_get_octet_string_ptr()
helps the programmer with such things, by setting the argument pointer
to |param->data|.
Additionally, the handle the data types OSSL_PARAM_UTF8_PTR and
OSSL_PARAM_OCTET_PTR as well.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12512)
crypto/params.c
doc/man3/OSSL_PARAM_int.pod
include/openssl/params.h
util/libcrypto.num