summaryrefslogtreecommitdiffstats
path: root/crypto/evp/evp_enc.c
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2019-10-14 20:59:31 +1000
committerShane Lontis <shane.lontis@oracle.com>2020-01-10 11:58:27 +1000
commit11b44359862632e283feabf15dab85bb550ebace (patch)
tree23572f4121313e7bd83308405e0a4472baa9461d /crypto/evp/evp_enc.c
parent1e8879691ff86bda75b6e2e66c0f528684df5d47 (diff)
Add GCM support for EVP_CTRL_GCM_IV_GEN and EVP_CTRL_GCM_SET_IV_INV to providers
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10173)
Diffstat (limited to 'crypto/evp/evp_enc.c')
-rw-r--r--crypto/evp/evp_enc.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c
index c650addbd1..35feec17f6 100644
--- a/crypto/evp/evp_enc.c
+++ b/crypto/evp/evp_enc.c
@@ -1135,10 +1135,22 @@ int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr)
return 0;
params[0] = OSSL_PARAM_construct_size_t(OSSL_CIPHER_PARAM_IVLEN, &sz);
break;
- case EVP_CTRL_GCM_SET_IV_FIXED:
- params[0] =
- OSSL_PARAM_construct_octet_string(OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED,
- ptr, sz);
+ case EVP_CTRL_AEAD_SET_IV_FIXED:
+ params[0] = OSSL_PARAM_construct_octet_string(
+ OSSL_CIPHER_PARAM_AEAD_TLS1_IV_FIXED, ptr, sz);
+ break;
+ case EVP_CTRL_GCM_IV_GEN:
+ set_params = 0;
+ if (arg < 0)
+ sz = 0; /* special case that uses the iv length */
+ params[0] = OSSL_PARAM_construct_octet_string(
+ OSSL_CIPHER_PARAM_AEAD_TLS1_GET_IV_GEN, ptr, sz);
+ break;
+ case EVP_CTRL_GCM_SET_IV_INV:
+ if (arg < 0)
+ return 0;
+ params[0] = OSSL_PARAM_construct_octet_string(
+ OSSL_CIPHER_PARAM_AEAD_TLS1_SET_IV_INV, ptr, sz);
break;
case EVP_CTRL_GET_RC5_ROUNDS:
set_params = 0; /* Fall thru */