Use an IV size of zero for DES in ECB mode
authorMartin Willi <martin@revosec.ch>
Fri, 8 Apr 2011 12:55:46 +0000 (14:55 +0200)
committerMartin Willi <martin@revosec.ch>
Fri, 8 Apr 2011 12:55:46 +0000 (14:55 +0200)
src/libstrongswan/plugins/af_alg/af_alg_crypter.c
src/libstrongswan/plugins/test_vectors/test_vectors/des.c

index 217d7db..441b354 100644 (file)
@@ -63,7 +63,7 @@ static struct {
        size_t iv_size;
 } algs[] = {
        {ENCR_DES,                      "cbc(des)",                                      8,      8,      8,      8,     },
-       {ENCR_DES_ECB,          "ecb(des)",                                      8,      8,      8,      8,     },
+       {ENCR_DES_ECB,          "ecb(des)",                                      8,      8,      8,      0,     },
        {ENCR_3DES,                     "cbc(des3_ede)",                         8,     24,     24,      8,     },
        {ENCR_AES_CBC,          "cbc(aes)",                                     16,     16,     16,     16,     },
        {ENCR_AES_CBC,          "cbc(aes)",                                     16,     24,     24,     16,     },
index 80b5f10..b4bf1fe 100644 (file)
@@ -25,7 +25,6 @@
 crypter_test_vector_t des_ecb1 = {
        .alg = ENCR_DES_ECB, .key_size = 8, .len = 8,
        .key    = "\x00\x01\x02\x03\x04\x05\x06\x07",
-       .iv             = "\x00\x00\x00\x00\x00\x00\x00\x00",
        .plain  = "\x41\xAD\x06\x85\x48\x80\x9D\x02",
        .cipher = "\x00\x11\x22\x33\x44\x55\x66\x77"
 };
@@ -36,7 +35,6 @@ crypter_test_vector_t des_ecb1 = {
 crypter_test_vector_t des_ecb2 = {
        .alg = ENCR_DES_ECB, .key_size = 8, .len = 8,
        .key    = "\x2B\xD6\x45\x9F\x82\xC5\xB3\x00",
-       .iv             = "\x00\x00\x00\x00\x00\x00\x00\x00",
        .plain  = "\xB1\x0F\x84\x30\x97\xA0\xF9\x32",
        .cipher = "\xEA\x02\x47\x14\xAD\x5C\x4D\x84"
 };