From 8d5fb6485282c79bfe9f1ebab14eab515910e370 Mon Sep 17 00:00:00 2001 From: Pauli Date: Tue, 21 Apr 2020 10:49:19 +1000 Subject: params: add functionality to test if an OSSL_PARAM has been set. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/11588) --- include/openssl/params.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/openssl/params.h b/include/openssl/params.h index cd0f7846d7..441dfbbe0e 100644 --- a/include/openssl/params.h +++ b/include/openssl/params.h @@ -18,11 +18,13 @@ extern "C" { # endif +# define OSSL_PARAM_UNMODIFIED ((size_t)-1) + # define OSSL_PARAM_END \ { NULL, 0, NULL, 0, 0 } # define OSSL_PARAM_DEFN(key, type, addr, sz) \ - { (key), (type), (addr), (sz), 0 } + { (key), (type), (addr), (sz), OSSL_PARAM_UNMODIFIED } /* Basic parameter types without return sizes */ # define OSSL_PARAM_int(key, addr) \ @@ -135,6 +137,9 @@ int OSSL_PARAM_get_octet_ptr(const OSSL_PARAM *p, const void **val, 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); + # ifdef __cplusplus } # endif -- cgit v1.2.3