diff options
author | Daiki Ueno <dueno@redhat.com> | 2021-01-24 17:45:57 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2021-01-26 15:57:24 +0100 |
commit | 1395a84e48e1369939ff47ca54163a210a0de4e8 (patch) | |
tree | 1057360f0561f2093d95a8115d36a88b855ae387 | |
parent | DOC: Fix a few minor issues in OSSL_ENCODER / OSSL_DECODER docs (diff) | |
download | openssl-1395a84e48e1369939ff47ca54163a210a0de4e8.tar.xz openssl-1395a84e48e1369939ff47ca54163a210a0de4e8.zip |
params: OSSL_PARAM_utf8_ptr: don't automatically reference `address`
Since the pointer can be later be modified, the caller should have the
responsibility to supply the address of that.
Signed-off-by: Daiki Ueno <dueno@redhat.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13951)
-rw-r--r-- | doc/man3/OSSL_PARAM_int.pod | 4 | ||||
-rw-r--r-- | include/openssl/params.h | 4 | ||||
-rw-r--r-- | providers/fips/fipsprov.c | 14 |
3 files changed, 11 insertions, 11 deletions
diff --git a/doc/man3/OSSL_PARAM_int.pod b/doc/man3/OSSL_PARAM_int.pod index ebb5e8ecb8..2bc2cc0dfc 100644 --- a/doc/man3/OSSL_PARAM_int.pod +++ b/doc/man3/OSSL_PARAM_int.pod @@ -337,7 +337,7 @@ This example is for setting parameters on some object: size_t foo_l = strlen(foo) + 1; const char bar[] = "some other string"; const OSSL_PARAM set[] = { - OSSL_PARAM_utf8_ptr("foo", foo, foo_l), + OSSL_PARAM_utf8_ptr("foo", &foo, foo_l), OSSL_PARAM_utf8_string("bar", bar, sizeof(bar)), OSSL_PARAM_END }; @@ -351,7 +351,7 @@ available parameters: const char *foo = NULL; char bar[1024]; OSSL_PARAM request[] = { - OSSL_PARAM_utf8_ptr("foo", foo, 0), + OSSL_PARAM_utf8_ptr("foo", &foo, 0), OSSL_PARAM_utf8_string("bar", bar, sizeof(bar)), OSSL_PARAM_END }; diff --git a/include/openssl/params.h b/include/openssl/params.h index 6ed7ecbb24..644d6253e8 100644 --- a/include/openssl/params.h +++ b/include/openssl/params.h @@ -62,9 +62,9 @@ extern "C" { OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_STRING, (addr), sz) # define OSSL_PARAM_utf8_ptr(key, addr, sz) \ - OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_PTR, &(addr), sz) + OSSL_PARAM_DEFN((key), OSSL_PARAM_UTF8_PTR, (addr), sz) # define OSSL_PARAM_octet_ptr(key, addr, sz) \ - OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_PTR, &(addr), sz) + OSSL_PARAM_DEFN((key), OSSL_PARAM_OCTET_PTR, (addr), sz) /* Search an OSSL_PARAM array for a matching name */ OSSL_PARAM *OSSL_PARAM_locate(OSSL_PARAM *p, const char *key); diff --git a/providers/fips/fipsprov.c b/providers/fips/fipsprov.c index f59c2c1c91..990b69ef34 100644 --- a/providers/fips/fipsprov.c +++ b/providers/fips/fipsprov.c @@ -117,25 +117,25 @@ static const OSSL_PARAM fips_param_types[] = { static OSSL_PARAM core_params[] = { OSSL_PARAM_utf8_ptr(OSSL_PROV_PARAM_CORE_MODULE_FILENAME, - selftest_params.module_filename, + &selftest_params.module_filename, sizeof(selftest_params.module_filename)), OSSL_PARAM_utf8_ptr(OSSL_PROV_FIPS_PARAM_MODULE_MAC, - selftest_params.module_checksum_data, + &selftest_params.module_checksum_data, sizeof(selftest_params.module_checksum_data)), OSSL_PARAM_utf8_ptr(OSSL_PROV_FIPS_PARAM_INSTALL_MAC, - selftest_params.indicator_checksum_data, + &selftest_params.indicator_checksum_data, sizeof(selftest_params.indicator_checksum_data)), OSSL_PARAM_utf8_ptr(OSSL_PROV_FIPS_PARAM_INSTALL_STATUS, - selftest_params.indicator_data, + &selftest_params.indicator_data, sizeof(selftest_params.indicator_data)), OSSL_PARAM_utf8_ptr(OSSL_PROV_FIPS_PARAM_INSTALL_VERSION, - selftest_params.indicator_version, + &selftest_params.indicator_version, sizeof(selftest_params.indicator_version)), OSSL_PARAM_utf8_ptr(OSSL_PROV_FIPS_PARAM_CONDITIONAL_ERRORS, - selftest_params.conditional_error_check, + &selftest_params.conditional_error_check, sizeof(selftest_params.conditional_error_check)), OSSL_PARAM_utf8_ptr(OSSL_PROV_FIPS_PARAM_SECURITY_CHECKS, - fips_security_check_option, + &fips_security_check_option, sizeof(fips_security_check_option)), OSSL_PARAM_END }; |