Commit cb6e0ed1 authored by Dr. Stephen Henson's avatar Dr. Stephen Henson
Browse files

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: default avatarRich Salz <rsalz@openssl.org>
(cherry picked from commit 9cca7be1)
parent e5d5019a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1146,7 +1146,7 @@ static int aes_ccm_ctrl(EVP_CIPHER_CTX *c, int type, int arg, void *ptr)
    case EVP_CTRL_CCM_SET_TAG:
        if ((arg & 1) || arg < 4 || arg > 16)
            return 0;
        if ((c->encrypt && ptr) || (!c->encrypt && !ptr))
        if (c->encrypt && ptr)
            return 0;
        if (ptr) {
            cctx->tag_set = 1;