summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-08-12 14:56:18 +0200
committerRichard Levitte <levitte@openssl.org>2019-08-15 10:49:56 +0200
commitae3ff60e7bea6fb7510b5c0c2b9599d8430cf001 (patch)
treea6cef6a574ebeac091b9bdb57ba6aff5c257becf /include
parentaee6e29f0e88df18ebc21dbcf9d4d5794d7511e0 (diff)
Add missing EVP param utility functions
These functions were missing for a completes API: EVP_MD_get_params(), EVP_CIPHER_get_params(), EVP_CIPHER_CTX_set_params(), and EVP_CIPHER_CTX_get_params Additionally, we also add all the corresponding parameter descriptor returning functions, along the correspoding provider dispatches: EVP_MD_gettable_params(), EVP_MD_CTX_settable_params(), EVP_MD_CTX_gettable_params(), EVP_CIPHER_gettable_params(), EVP_CIPHER_CTX_settable_params(), and EVP_CIPHER_CTX_gettable_params() Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9576)
Diffstat (limited to 'include')
-rw-r--r--include/openssl/core_numbers.h15
-rw-r--r--include/openssl/evp.h10
2 files changed, 25 insertions, 0 deletions
diff --git a/include/openssl/core_numbers.h b/include/openssl/core_numbers.h
index e4d3f5d60f..7a5a1cdf8e 100644
--- a/include/openssl/core_numbers.h
+++ b/include/openssl/core_numbers.h
@@ -148,6 +148,9 @@ OSSL_CORE_MAKE_FUNC(const OSSL_ITEM *,provider_get_reason_strings,
# define OSSL_FUNC_DIGEST_GET_PARAMS 8
# define OSSL_FUNC_DIGEST_CTX_SET_PARAMS 9
# define OSSL_FUNC_DIGEST_CTX_GET_PARAMS 10
+# define OSSL_FUNC_DIGEST_GETTABLE_PARAMS 11
+# define OSSL_FUNC_DIGEST_SETTABLE_CTX_PARAMS 12
+# define OSSL_FUNC_DIGEST_GETTABLE_CTX_PARAMS 13
OSSL_CORE_MAKE_FUNC(void *, OP_digest_newctx, (void *provctx))
OSSL_CORE_MAKE_FUNC(int, OP_digest_init, (void *dctx))
@@ -168,6 +171,9 @@ OSSL_CORE_MAKE_FUNC(int, OP_digest_ctx_set_params,
(void *vctx, const OSSL_PARAM params[]))
OSSL_CORE_MAKE_FUNC(int, OP_digest_ctx_get_params,
(void *vctx, OSSL_PARAM params[]))
+OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_digest_gettable_params, (void))
+OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_digest_settable_ctx_params, (void))
+OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_digest_gettable_ctx_params, (void))
/* Symmetric Ciphers */
@@ -184,6 +190,9 @@ OSSL_CORE_MAKE_FUNC(int, OP_digest_ctx_get_params,
# define OSSL_FUNC_CIPHER_GET_PARAMS 9
# define OSSL_FUNC_CIPHER_CTX_GET_PARAMS 10
# define OSSL_FUNC_CIPHER_CTX_SET_PARAMS 11
+# define OSSL_FUNC_CIPHER_GETTABLE_PARAMS 12
+# define OSSL_FUNC_CIPHER_GETTABLE_CTX_PARAMS 13
+# define OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS 14
OSSL_CORE_MAKE_FUNC(void *, OP_cipher_newctx, (void *provctx))
OSSL_CORE_MAKE_FUNC(int, OP_cipher_encrypt_init, (void *cctx,
@@ -214,6 +223,12 @@ OSSL_CORE_MAKE_FUNC(int, OP_cipher_ctx_get_params, (void *cctx,
OSSL_PARAM params[]))
OSSL_CORE_MAKE_FUNC(int, OP_cipher_ctx_set_params, (void *cctx,
const OSSL_PARAM params[]))
+OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_cipher_gettable_params,
+ (void))
+OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_cipher_settable_ctx_params,
+ (void))
+OSSL_CORE_MAKE_FUNC(const OSSL_PARAM *, OP_cipher_gettable_ctx_params,
+ (void))
/*-
* Key management
diff --git a/include/openssl/evp.h b/include/openssl/evp.h
index eab5a53d8a..7fcc4505f5 100644
--- a/include/openssl/evp.h
+++ b/include/openssl/evp.h
@@ -548,8 +548,12 @@ void BIO_set_md(BIO *, const EVP_MD *md);
# define EVP_delete_digest_alias(alias) \
OBJ_NAME_remove(alias,OBJ_NAME_TYPE_MD_METH|OBJ_NAME_ALIAS);
+int EVP_MD_get_params(const EVP_MD *digest, OSSL_PARAM params[]);
int EVP_MD_CTX_set_params(EVP_MD_CTX *ctx, const OSSL_PARAM params[]);
int EVP_MD_CTX_get_params(EVP_MD_CTX *ctx, OSSL_PARAM params[]);
+const OSSL_PARAM *EVP_MD_gettable_params(const EVP_MD *digest);
+const OSSL_PARAM *EVP_MD_CTX_settable_params(const EVP_MD *digest);
+const OSSL_PARAM *EVP_MD_CTX_gettable_params(const EVP_MD *digest);
int EVP_MD_CTX_ctrl(EVP_MD_CTX *ctx, int cmd, int p1, void *p2);
EVP_MD_CTX *EVP_MD_CTX_new(void);
int EVP_MD_CTX_reset(EVP_MD_CTX *ctx);
@@ -702,6 +706,12 @@ int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen);
int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad);
int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr);
int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key);
+int EVP_CIPHER_get_params(EVP_CIPHER *cipher, OSSL_PARAM params[]);
+int EVP_CIPHER_CTX_set_params(EVP_CIPHER_CTX *ctx, const OSSL_PARAM params[]);
+int EVP_CIPHER_CTX_get_params(EVP_CIPHER_CTX *ctx, OSSL_PARAM params[]);
+const OSSL_PARAM *EVP_CIPHER_gettable_params(const EVP_CIPHER *cipher);
+const OSSL_PARAM *EVP_CIPHER_CTX_settable_params(const EVP_CIPHER *cipher);
+const OSSL_PARAM *EVP_CIPHER_CTX_gettable_params(const EVP_CIPHER *cipher);
const BIO_METHOD *BIO_f_md(void);
const BIO_METHOD *BIO_f_base64(void);