summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2020-05-11 01:37:45 +0200
committerPauli <paul.dale@oracle.com>2020-06-24 12:05:41 +0200
commit5fdaa38febb7463dbd44f849b2930edcbd5f6bae (patch)
tree3763d73fb1ec5ae8d08de03e9107973e94ff8b5a /include
parenttest: add a test RNG. (diff)
downloadopenssl-5fdaa38febb7463dbd44f849b2930edcbd5f6bae.tar.xz
openssl-5fdaa38febb7463dbd44f849b2930edcbd5f6bae.zip
params: add OSSL_PARAM helpers for time_t.
POSIX mandates that time_t is a signed integer but it doesn't specify the lenght. Having wrappers lets uses ignore this. Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> (Merged from https://github.com/openssl/openssl/pull/11682)
Diffstat (limited to 'include')
-rw-r--r--include/openssl/param_build.h2
-rw-r--r--include/openssl/params.h5
2 files changed, 7 insertions, 0 deletions
diff --git a/include/openssl/param_build.h b/include/openssl/param_build.h
index 45ed1bf13f..58ad9be732 100644
--- a/include/openssl/param_build.h
+++ b/include/openssl/param_build.h
@@ -33,6 +33,8 @@ int OSSL_PARAM_BLD_push_uint64(OSSL_PARAM_BLD *bld, const char *key,
uint64_t val);
int OSSL_PARAM_BLD_push_size_t(OSSL_PARAM_BLD *bld, const char *key,
size_t val);
+int OSSL_PARAM_BLD_push_time_t(OSSL_PARAM_BLD *bld, const char *key,
+ time_t val);
int OSSL_PARAM_BLD_push_double(OSSL_PARAM_BLD *bld, const char *key,
double val);
int OSSL_PARAM_BLD_push_BN(OSSL_PARAM_BLD *bld, const char *key,
diff --git a/include/openssl/params.h b/include/openssl/params.h
index 993ee8188e..44fc1a6a38 100644
--- a/include/openssl/params.h
+++ b/include/openssl/params.h
@@ -49,6 +49,8 @@ extern "C" {
sizeof(uint64_t))
# define OSSL_PARAM_size_t(key, addr) \
OSSL_PARAM_DEFN((key), OSSL_PARAM_UNSIGNED_INTEGER, (addr), sizeof(size_t))
+# define OSSL_PARAM_time_t(key, addr) \
+ OSSL_PARAM_DEFN((key), OSSL_PARAM_INTEGER, (addr), sizeof(time_t))
# define OSSL_PARAM_double(key, addr) \
OSSL_PARAM_DEFN((key), OSSL_PARAM_REAL, (addr), sizeof(double))
@@ -78,6 +80,7 @@ OSSL_PARAM OSSL_PARAM_construct_uint32(const char *key, uint32_t *buf);
OSSL_PARAM OSSL_PARAM_construct_int64(const char *key, int64_t *buf);
OSSL_PARAM OSSL_PARAM_construct_uint64(const char *key, uint64_t *buf);
OSSL_PARAM OSSL_PARAM_construct_size_t(const char *key, size_t *buf);
+OSSL_PARAM OSSL_PARAM_construct_time_t(const char *key, time_t *buf);
OSSL_PARAM OSSL_PARAM_construct_BN(const char *key, unsigned char *buf,
size_t bsize);
OSSL_PARAM OSSL_PARAM_construct_double(const char *key, double *buf);
@@ -105,6 +108,7 @@ int OSSL_PARAM_get_uint32(const OSSL_PARAM *p, uint32_t *val);
int OSSL_PARAM_get_int64(const OSSL_PARAM *p, int64_t *val);
int OSSL_PARAM_get_uint64(const OSSL_PARAM *p, uint64_t *val);
int OSSL_PARAM_get_size_t(const OSSL_PARAM *p, size_t *val);
+int OSSL_PARAM_get_time_t(const OSSL_PARAM *p, time_t *val);
int OSSL_PARAM_set_int(OSSL_PARAM *p, int val);
int OSSL_PARAM_set_uint(OSSL_PARAM *p, unsigned int val);
@@ -115,6 +119,7 @@ int OSSL_PARAM_set_uint32(OSSL_PARAM *p, uint32_t val);
int OSSL_PARAM_set_int64(OSSL_PARAM *p, int64_t val);
int OSSL_PARAM_set_uint64(OSSL_PARAM *p, uint64_t val);
int OSSL_PARAM_set_size_t(OSSL_PARAM *p, size_t val);
+int OSSL_PARAM_set_time_t(OSSL_PARAM *p, time_t val);
int OSSL_PARAM_get_double(const OSSL_PARAM *p, double *val);
int OSSL_PARAM_set_double(OSSL_PARAM *p, double val);