summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2022-10-12 11:30:56 +0200
committerTomas Mraz <tomas@openssl.org>2022-11-11 16:56:37 +0100
commitd90a4c7d5a18300153340a6d54e7aba03eebe268 (patch)
treefbb3ac2b281f33b122a9c086f157718c9cb713ea /test
parent66c4f141369f29b61159a9f77e33e15b9d1c6638 (diff)
cmac_set_ctx_params(): Fail if cipher mode is not CBC
Also add negative test cases for CMAC and GMAC using a cipher with wrong mode. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19401) (cherry picked from commit 94976a1e8d9b127999df14c2e0c38e918c2badda)
Diffstat (limited to 'test')
-rw-r--r--test/recipes/30-test_evp_data/evpmac_common.txt13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/recipes/30-test_evp_data/evpmac_common.txt b/test/recipes/30-test_evp_data/evpmac_common.txt
index 9a0f9cc29c..54b91d247a 100644
--- a/test/recipes/30-test_evp_data/evpmac_common.txt
+++ b/test/recipes/30-test_evp_data/evpmac_common.txt
@@ -259,6 +259,13 @@ Key = 0B122AC8F34ED1FE082A3625D157561454167AC145A10BBF77C6A70596D574F1
Input = 498B53FDEC87EDCBF07097DCCDE93A084BAD7501A224E388DF349CE18959FE8485F8AD1537F0D896EA73BEDC7214713F
Output = F62C46329B41085625669BAF51DEA66A
+FIPSversion = >3.0.99
+MAC = CMAC
+Algorithm = AES-256-ECB
+Key = 0B122AC8F34ED1FE082A3625D157561454167AC145A10BBF77C6A70596D574F1
+Input = 498B53FDEC87EDCBF07097DCCDE93A084BAD7501A224E388DF349CE18959FE8485F8AD1537F0D896EA73BEDC7214713F
+Result = MAC_INIT_ERROR
+
Title = GMAC Tests (from NIST)
MAC = GMAC
@@ -326,6 +333,12 @@ IV = 7AE8E2CA4EC500012E58495C
Input = 68F2E77696CE7AE8E2CA4EC588E541002E58495C08000F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D0007
Output = 00BDA1B7E87608BCBF470F12157F4C07
+MAC = GMAC
+Algorithm = AES-256-CBC
+Key = 4C973DBC7364621674F8B5B89E5C15511FCED9216490FB1C1A2CAA0FFE0407E5
+IV = 7AE8E2CA4EC500012E58495C
+Input = 68F2E77696CE7AE8E2CA4EC588E541002E58495C08000F101112131415161718191A1B1C1D1E1F202122232425262728292A2B2C2D2E2F303132333435363738393A3B3C3D3E3F404142434445464748494A4B4C4D0007
+Result = MAC_INIT_ERROR
Title = KMAC Tests (From NIST)
MAC = KMAC128