summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2020-04-21 10:49:19 +1000
committerPauli <paul.dale@oracle.com>2020-04-22 13:56:44 +1000
commit8d5fb6485282c79bfe9f1ebab14eab515910e370 (patch)
tree7fe3b356021db7eba7529a9569d2c61348324e99 /doc
parent07caec83b81859ea9aa2d5075a394aa48c4e5fae (diff)
params: add functionality to test if an OSSL_PARAM has been set.
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11588)
Diffstat (limited to 'doc')
-rw-r--r--doc/man3/OSSL_PARAM_int.pod19
1 files changed, 18 insertions, 1 deletions
diff --git a/doc/man3/OSSL_PARAM_int.pod b/doc/man3/OSSL_PARAM_int.pod
index 99e4fcf088..c7dbcbcd10 100644
--- a/doc/man3/OSSL_PARAM_int.pod
+++ b/doc/man3/OSSL_PARAM_int.pod
@@ -27,7 +27,7 @@ OSSL_PARAM_set_int64, OSSL_PARAM_set_long, OSSL_PARAM_set_size_t,
OSSL_PARAM_set_uint, OSSL_PARAM_set_uint32, OSSL_PARAM_set_uint64,
OSSL_PARAM_set_ulong, OSSL_PARAM_set_BN, OSSL_PARAM_set_utf8_string,
OSSL_PARAM_set_octet_string, OSSL_PARAM_set_utf8_ptr,
-OSSL_PARAM_set_octet_ptr
+OSSL_PARAM_set_octet_ptr, OSSL_PARAM_UNMODIFIED
- OSSL_PARAM helpers
=head1 SYNOPSIS
@@ -52,6 +52,8 @@ OSSL_PARAM_set_octet_ptr
#define OSSL_PARAM_octet_ptr(key, address, size)
#define OSSL_PARAM_END
+ #define OSSL_PARAM_UNMODIFIED
+
OSSL_PARAM OSSL_PARAM_construct_TYPE(const char *key, TYPE *buf);
OSSL_PARAM OSSL_PARAM_construct_BN(const char *key, unsigned char *buf,
size_t bsize);
@@ -91,6 +93,9 @@ OSSL_PARAM_set_octet_ptr
int OSSL_PARAM_set_octet_ptr(OSSL_PARAM *p, const void *val,
size_t used_len);
+ int OSSL_PARAM_modified(const OSSL_PARAM *p);
+ void OSSL_PARAM_set_unmodified(OSSL_PARAM *p);
+
=head1 DESCRIPTION
A collection of utility functions that simplify and add type safety to the
@@ -250,6 +255,16 @@ OSSL_PARAM_set_octet_ptr() sets the OCTET string pointer in the parameter
referenced by B<p> to the values B<val>.
The length of the OCTET string is provided by B<used_len>.
+The OSSL_PARAM_UNMODIFIED macro is used to detect if a parameter was set. On
+creation, via either the macros or construct calls, the I<return_size> field
+is set to this. If the parameter is set using the calls defined herein, the
+I<return_size> field is changed.
+
+OSSL_PARAM_modified() queries if the parameter has been set or not using the
+calls defined herein.
+
+OSSL_PARAM_set_unmodified() is used to reset unused indicator.
+
=head1 RETURN VALUES
OSSL_PARAM_construct_TYPE(), OSSL_PARAM_construct_BN(),
@@ -261,6 +276,8 @@ OSSL_PARAM_locate() and OSSL_PARAM_locate_const() return a pointer to
the matching OSSL_PARAM object. They return B<NULL> on error or when
no object matching B<key> exists in the B<array>.
+OSSL_PARAM_modified() returns B<1> if the parameter was set and B<0> otherwise.
+
All other functions return B<1> on success and B<0> on failure.
=head1 NOTES