Skip to content

Commit 9cca7be

Browse files
committed
Relax CCM tag check.
In CCM mode don't require a tag before initialising decrypt: this allows the tag length to be set without requiring the tag. Reviewed-by: Rich Salz <[email protected]>
1 parent 36f038f commit 9cca7be

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crypto/evp/e_aes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1866,7 +1866,7 @@ static int aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
18661866
case EVP_CTRL_AEAD_SET_TAG:
18671867
if ((arg & 1) || arg < 4 || arg > 16)
18681868
return 0;
1869-
if ((c->encrypt && ptr) || (!c->encrypt && !ptr))
1869+
if (c->encrypt && ptr)
18701870
return 0;
18711871
if (ptr) {
18721872
cctx->tag_set = 1;

0 commit comments

Comments
 (0)