Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/openssl/openssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPauli <ppzgs1@gmail.com>2021-02-23 04:48:57 +0300
committerPauli <ppzgs1@gmail.com>2021-02-26 11:08:41 +0300
commit292b4184d6fda8e0c5c62c22170e8ad464a1a3a7 (patch)
tree0f9c2284d5731e590ffc984ba741fc004ac9bc6f /crypto/evp/evp_enc.c
parent644c5dd366913d9297db8e0693a754e2d45c9089 (diff)
evp: upport modified gettable/settable ctx calls for ciphers
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14240)
Diffstat (limited to 'crypto/evp/evp_enc.c')
-rw-r--r--crypto/evp/evp_enc.c40
1 files changed, 34 insertions, 6 deletions
diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c
index ebb876a8dc..851c6d5d9a 100644
--- a/crypto/evp/evp_enc.c
+++ b/crypto/evp/evp_enc.c
@@ -1220,17 +1220,45 @@ const OSSL_PARAM *EVP_CIPHER_gettable_params(const EVP_CIPHER *cipher)
const OSSL_PARAM *EVP_CIPHER_settable_ctx_params(const EVP_CIPHER *cipher)
{
- if (cipher != NULL && cipher->settable_ctx_params != NULL)
- return cipher->settable_ctx_params(
- ossl_provider_ctx(EVP_CIPHER_provider(cipher)));
+ void *alg;
+
+ if (cipher != NULL && cipher->settable_ctx_params != NULL) {
+ alg = ossl_provider_ctx(EVP_CIPHER_provider(cipher));
+ return cipher->settable_ctx_params(NULL, alg);
+ }
return NULL;
}
const OSSL_PARAM *EVP_CIPHER_gettable_ctx_params(const EVP_CIPHER *cipher)
{
- if (cipher != NULL && cipher->gettable_ctx_params != NULL)
- return cipher->gettable_ctx_params(
- ossl_provider_ctx(EVP_CIPHER_provider(cipher)));
+ void *alg;
+
+ if (cipher != NULL && cipher->gettable_ctx_params != NULL) {
+ alg = ossl_provider_ctx(EVP_CIPHER_provider(cipher));
+ return cipher->gettable_ctx_params(NULL, alg);
+ }
+ return NULL;
+}
+
+const OSSL_PARAM *EVP_CIPHER_CTX_settable_params(EVP_CIPHER_CTX *cctx)
+{
+ void *alg;
+
+ if (cctx != NULL && cctx->cipher->settable_ctx_params != NULL) {
+ alg = ossl_provider_ctx(EVP_CIPHER_provider(cctx->cipher));
+ return cctx->cipher->settable_ctx_params(cctx->provctx, alg);
+ }
+ return NULL;
+}
+
+const OSSL_PARAM *EVP_CIPHER_CTX_gettable_params(EVP_CIPHER_CTX *cctx)
+{
+ void *alg;
+
+ if (cctx != NULL && cctx->cipher->gettable_ctx_params != NULL) {
+ alg = ossl_provider_ctx(EVP_CIPHER_provider(cctx->cipher));
+ return cctx->cipher->gettable_ctx_params(cctx->provctx, alg);
+ }
return NULL;
}