aboutsummaryrefslogtreecommitdiffstats
path: root/src/tests/data
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-09-29 06:39:03 -0400
committerJack Lloyd <[email protected]>2018-09-29 20:59:34 -0400
commitbdc32a98b97c97145054edfa217569351ff41baa (patch)
tree464bde438661b6e10f0355286e1eb0c68ef68217 /src/tests/data
parentd213317da6065e3c1a149fac33fd16db500b60f6 (diff)
Refactor mode tests, and correct bugs found
Several problems in CBC found by adding tests - If you set a key, then set a nonce, then set a new key, you could encrypt without setting a new nonce. - It was possible to call CBC finish without setting a nonce, which would crash. - If you had an CBC decryption object, set a key, set a nonce, then reset message state, it should throw because no nonce is set. Instead it would carry on using an all-zero nonce. Disable CommonCrypto with PKCS7 padding as it seems to have some problem that I cannot figure out from the build logs. This work sponsored by Ribose Inc
Diffstat (limited to 'src/tests/data')
-rw-r--r--src/tests/data/modes/cbc.vec12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/tests/data/modes/cbc.vec b/src/tests/data/modes/cbc.vec
index 966d23108..05d30ab7e 100644
--- a/src/tests/data/modes/cbc.vec
+++ b/src/tests/data/modes/cbc.vec
@@ -1205,6 +1205,11 @@ Nonce = 000102030405060708090A0B0C0D0E0F
In = 6BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710
Out = 7649ABAC8119B246CEE98E9B12E9197D5086CB9B507219EE95DB113A917678B273BED6B8E3C1743B7116E69E222295163FF1CAA1681FAC09120ECA307586E1A7
+Key = 2B7E151628AED2A6ABF7158809CF4F3C
+Nonce = 00000000000000000000000000000000
+In = 6BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710
+Out = 3AD77BB40D7A3660A89ECAF32466EF97B148C17F309EE692287AE57CF12ADD49C93D11BFAF08C5DC4D90B37B4DEE002BA7356E1207BB406639E5E5CEB9A9ED93
+
[AES-192/CBC/NoPadding]
Key = 8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B
Nonce = 000102030405060708090A0B0C0D0E0F
@@ -1217,13 +1222,6 @@ Nonce = 000102030405060708090A0B0C0D0E0F
In = 6BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710
Out = F58C4C04D6E5F1BA779EABFB5F7BFBD69CFC4E967EDB808D679F777BC6702C7D39F23369A9D9BACFA530E26304231461B2EB05E2C39BE9FCDA6C19078C6A9D1B
-# test empty nonce, must be equivalent to zero
-[AES-128/CBC/NoPadding]
-Key = 2B7E151628AED2A6ABF7158809CF4F3C
-Nonce =
-In = 6BC1BEE22E409F96E93D7E117393172AAE2D8A571E03AC9C9EB76FAC45AF8E5130C81C46A35CE411E5FBC1191A0A52EFF69F2445DF4F9B17AD2B417BE66C3710
-Out = 3AD77BB40D7A3660A89ECAF32466EF97B148C17F309EE692287AE57CF12ADD49C93D11BFAF08C5DC4D90B37B4DEE002BA7356E1207BB406639E5E5CEB9A9ED93
-
# RFC 3962: Advanced Encryption Standard (AES) Encryption for Kerberos 5
[AES-128/CBC/CTS]
Key = 636869636b656e207465726979616b69