s390x assembly pack: allow specifying the tag after aad in aes-ccm
forgot about s390x
@@ -2264,9 +2264,6 @@ static int s390x_aes_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
if (!cctx->aes.ccm.iv_set)
return -1;
- if (!enc && !cctx->aes.ccm.tag_set)
- return -1;
-
if (out == NULL) {
/* Update(): Pass message length. */
if (in == NULL) {
@@ -2285,6 +2282,10 @@ static int s390x_aes_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
return len;
}
+ /* The tag must be set before actually decrypting data */
+ if (!enc && !cctx->aes.ccm.tag_set)
+ return -1;
+
/* Update(): Process message. */
if (!cctx->aes.ccm.len_set) {
