diff options
author | Jack Lloyd <[email protected]> | 2018-09-22 00:29:20 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-09-22 10:59:12 -0400 |
commit | 5d5ca7b276e687d9e3480e70d4718c99ce34cc23 (patch) | |
tree | eeb6317457806d3dcbe13eb73b6a9c4608fb9816 /src/tests/data/pad.vec | |
parent | c85d1d2ac1640dcaa7cfd9f4bf3ecc30e4b4a137 (diff) |
Add fuzzer for mode unpadding, and fix bugs found thereby
Both PKCS7 and X9.23 padding modes did not examine the first byte
of the purported padding if the padding took an entire block. So
for example for a 64-bit cipher, PKCS7 would accept XX08080808080808
as a valid padding for any byte value.
Diffstat (limited to 'src/tests/data/pad.vec')
-rw-r--r-- | src/tests/data/pad.vec | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/src/tests/data/pad.vec b/src/tests/data/pad.vec index ee24d3497..54efa4f1d 100644 --- a/src/tests/data/pad.vec +++ b/src/tests/data/pad.vec @@ -40,6 +40,10 @@ In = FFFFFFFFFFFFFFFFFF Out = FFFFFFFFFFFFFFFFFF07070707070707 Blocksize = 8 +In = 82 +Out = 8207070707070707 +Blocksize = 8 + [PKCS7_Invalid] In = FFFFFFFFFFFFFFFFFF07070706070707 Blocksize = 8 @@ -47,6 +51,18 @@ Blocksize = 8 In = FFFFFFFFFFFFFFFFFFFF070707070707 Blocksize = 8 +In = 82040404 +Blocksize = 4 + +In = 82050505 +Blocksize = 4 + +In = 820606060606 +Blocksize = 6 + +In = 8208080808080808 +Blocksize = 8 + [OneAndZeros] In = FFFFFF Out = FFFFFF80000000000000000000000000 @@ -68,6 +84,14 @@ In = FFFFFFFFFFFFFFFFFF Out = FFFFFFFFFFFFFFFFFF80000000000000 Blocksize = 8 +In = FF +Out = FF800000 +Blocksize = 4 + +In = +Out = 80000000 +Blocksize = 4 + [OneAndZeros_Invalid] In = FF80000000000008 Blocksize = 8 @@ -99,6 +123,18 @@ In = FFFFFFFFFFFFFFFFFF Out = FFFFFFFFFFFFFFFFFF00000000000007 Blocksize = 8 +In = 7e00 +Out = 7e000002 +Blocksize = 4 + +In = 7e +Out = 7e000003 +Blocksize = 4 + +In = 7e +Out = 7e00000000000007 +Blocksize = 8 + [X9.23_Invalid] In = FFFFFFFFFFFFFFFFFF000000FFFFF00007 Blocksize = 8 @@ -109,6 +145,21 @@ Blocksize = 8 In = FFFFFF8000000000000000000000000D Blocksize = 16 +In = FF000004 +Blocksize = 4 + +In = FF000005 +Blocksize = 4 + +In = FF000006 +Blocksize = 4 + +In = FF00000000000008 +Blocksize = 8 + +In = 8020000000000008 +Blocksize = 8 + [ESP] In = FFFFFF Out = FFFFFF0102030405060708090A0B0C0D @@ -130,6 +181,34 @@ In = FFFFFFFFFFFFFFFFFF Out = FFFFFFFFFFFFFFFFFF01020304050607 Blocksize = 8 +In = FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF +Out = FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF01 +Blocksize = 8 + +In = FFFFFFFFFFFFFFFFFFFFFFFFFFFF +Out = FFFFFFFFFFFFFFFFFFFFFFFFFFFF0102 +Blocksize = 8 + +In = FFFFFFFFFFFFFFFFFFFFFFFFFF +Out = FFFFFFFFFFFFFFFFFFFFFFFFFF010203 +Blocksize = 8 + +In = FFFFFFFFFFFFFFFFFFFFFFFF +Out = FFFFFFFFFFFFFFFFFFFFFFFF01020304 +Blocksize = 8 + +In = FFFFFFFFFFFFFFFFFFFFFF +Out = FFFFFFFFFFFFFFFFFFFFFF0102030405 +Blocksize = 8 + +In = FFFFFFFFFFFFFFFFFFFF +Out = FFFFFFFFFFFFFFFFFFFF010203040506 +Blocksize = 8 + +In = FFFFFFFFFFFFFFFFFF +Out = FFFFFFFFFFFFFFFFFF01020304050607 +Blocksize = 8 + [ESP_Invalid] In = FF010202 Blocksize = 4 @@ -137,6 +216,15 @@ Blocksize = 4 In = FF010204 Blocksize = 4 +In = FF000000 +Blocksize = 4 + +In = 00000000 +Blocksize = 4 + +In = 500ac5c5c5c5c5c5 +Blocksize = 8 + In = FFFFFF0102030405060708090A0B0C0F Blocksize = 16 @@ -145,3 +233,4 @@ Blocksize = 16 In = FFFFFFFF0002030405060708090A0B0C Blocksize = 16 + |