Call EVP_CipherFinal in CCM mode for tests.
authorDr. Stephen Henson <steve@openssl.org>
Fri, 3 Feb 2017 02:49:26 +0000 (02:49 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 8 Feb 2017 02:16:27 +0000 (02:16 +0000)
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2550)

test/evp_test.c

index 2f651b6dce570c28e1563e4816faeae4376dcbf6..494a46b3183d475eb914d4e3db6b82fcfe284d3e 100644 (file)
@@ -1040,13 +1040,9 @@ static int cipher_test_enc(struct evp_test *t, int enc,
             tmplen += chunklen;
         }
     }
-    if (cdat->aead == EVP_CIPH_CCM_MODE)
-        tmpflen = 0;
-    else {
-        err = "CIPHERFINAL_ERROR";
-        if (!EVP_CipherFinal_ex(ctx, tmp + out_misalign + tmplen, &tmpflen))
-            goto err;
-    }
+    err = "CIPHERFINAL_ERROR";
+    if (!EVP_CipherFinal_ex(ctx, tmp + out_misalign + tmplen, &tmpflen))
+        goto err;
     err = "LENGTH_MISMATCH";
     if (out_len != (size_t)(tmplen + tmpflen))
         goto err;