summaryrefslogtreecommitdiffstats
path: root/providers/implementations/ciphers/ciphercommon_gcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'providers/implementations/ciphers/ciphercommon_gcm.c')
-rw-r--r--providers/implementations/ciphers/ciphercommon_gcm.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/providers/implementations/ciphers/ciphercommon_gcm.c b/providers/implementations/ciphers/ciphercommon_gcm.c
index 97a1af3191..c4301f6b82 100644
--- a/providers/implementations/ciphers/ciphercommon_gcm.c
+++ b/providers/implementations/ciphers/ciphercommon_gcm.c
@@ -26,13 +26,12 @@ static int gcm_cipher_internal(PROV_GCM_CTX *ctx, unsigned char *out,
size_t len);
void ossl_gcm_initctx(void *provctx, PROV_GCM_CTX *ctx, size_t keybits,
- const PROV_GCM_HW *hw, size_t ivlen_min)
+ const PROV_GCM_HW *hw)
{
ctx->pad = 1;
ctx->mode = EVP_CIPH_GCM_MODE;
ctx->taglen = UNINITIALISED_SIZET;
ctx->tls_aad_len = UNINITIALISED_SIZET;
- ctx->ivlen_min = ivlen_min;
ctx->ivlen = (EVP_GCM_TLS_FIXED_IV_LEN + EVP_GCM_TLS_EXPLICIT_IV_LEN);
ctx->keylen = keybits / 8;
ctx->hw = hw;
@@ -51,7 +50,7 @@ static int gcm_init(void *vctx, const unsigned char *key, size_t keylen,
ctx->enc = enc;
if (iv != NULL) {
- if (ivlen < ctx->ivlen_min || ivlen > sizeof(ctx->iv)) {
+ if (ivlen == 0 || ivlen > sizeof(ctx->iv)) {
ERR_raise(ERR_LIB_PROV, PROV_R_INVALID_IV_LENGTH);
return 0;
}