From 29dcc0b93c8365cdf53b2940c46cdef1c5140228 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 10 Mar 2014 11:32:07 +0100 Subject: [PATCH] Fix depend issues in test suites for cipher modes --- ChangeLog | 1 + library/des.c | 12 +++++++----- tests/suites/test_suite_blowfish.function | 6 +++--- tests/suites/test_suite_camellia.function | 4 ++-- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index f1312803a..6995003f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,7 @@ Bugfix * Fixed testing with out-of-source builds using cmake * Fixed version-major intolerance in server * Fixed CMake symlinking on out-of-source builds + * Fixed dependency issues in test suite = PolarSSL 1.3.4 released on 2014-01-27 Features diff --git a/library/des.c b/library/des.c index 6e1523408..7da3269d2 100644 --- a/library/des.c +++ b/library/des.c @@ -781,11 +781,6 @@ static const unsigned char des3_test_keys[24] = 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF, 0x01, 0x23 }; -static const unsigned char des3_test_iv[8] = -{ - 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, -}; - static const unsigned char des3_test_buf[8] = { 0x4E, 0x6F, 0x77, 0x20, 0x69, 0x73, 0x20, 0x74 @@ -805,6 +800,12 @@ static const unsigned char des3_test_ecb_enc[3][8] = { 0xDD, 0x17, 0xE8, 0xB8, 0xB4, 0x37, 0xD2, 0x32 } }; +#if defined(POLARSSL_CIPHER_MODE_CBC) +static const unsigned char des3_test_iv[8] = +{ + 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, +}; + static const unsigned char des3_test_cbc_dec[3][8] = { { 0x12, 0x9F, 0x40, 0xB9, 0xD2, 0x00, 0x56, 0xB3 }, @@ -818,6 +819,7 @@ static const unsigned char des3_test_cbc_enc[3][8] = { 0x35, 0x76, 0x11, 0x56, 0x5F, 0xA1, 0x8E, 0x4D }, { 0xCB, 0x19, 0x1F, 0x85, 0xD1, 0xED, 0x84, 0x39 } }; +#endif /* POLARSSL_CIPHER_MODE_CBC */ /* * Checkup routine diff --git a/tests/suites/test_suite_blowfish.function b/tests/suites/test_suite_blowfish.function index edfd3060b..673b88c18 100644 --- a/tests/suites/test_suite_blowfish.function +++ b/tests/suites/test_suite_blowfish.function @@ -136,7 +136,7 @@ void blowfish_decrypt_cbc( char *hex_key_string, char *hex_iv_string, } /* END_CASE */ -/* BEGIN_CASE */ +/* BEGIN_CASE depends_on:POLARSSL_CIPHER_MODE_CFB */ void blowfish_encrypt_cfb64( char *hex_key_string, char *hex_iv_string, char *hex_src_string, char *hex_dst_string ) { @@ -167,7 +167,7 @@ void blowfish_encrypt_cfb64( char *hex_key_string, char *hex_iv_string, } /* END_CASE */ -/* BEGIN_CASE */ +/* BEGIN_CASE depends_on:POLARSSL_CIPHER_MODE_CFB */ void blowfish_decrypt_cfb64( char *hex_key_string, char *hex_iv_string, char *hex_src_string, char *hex_dst_string ) { @@ -198,7 +198,7 @@ void blowfish_decrypt_cfb64( char *hex_key_string, char *hex_iv_string, } /* END_CASE */ -/* BEGIN_CASE */ +/* BEGIN_CASE depends_on:POLARSSL_CIPHER_MODE_CTR */ void blowfish_encrypt_ctr( char *hex_key_string, char *hex_iv_string, char *hex_src_string, char *hex_dst_string ) { diff --git a/tests/suites/test_suite_camellia.function b/tests/suites/test_suite_camellia.function index 59785d2b6..8f9e97870 100644 --- a/tests/suites/test_suite_camellia.function +++ b/tests/suites/test_suite_camellia.function @@ -135,7 +135,7 @@ void camellia_decrypt_cbc( char *hex_key_string, char *hex_iv_string, } /* END_CASE */ -/* BEGIN_CASE */ +/* BEGIN_CASE depends_on:POLARSSL_CIPHER_MODE_CFB */ void camellia_encrypt_cfb128( char *hex_key_string, char *hex_iv_string, char *hex_src_string, char *hex_dst_string ) { @@ -166,7 +166,7 @@ void camellia_encrypt_cfb128( char *hex_key_string, char *hex_iv_string, } /* END_CASE */ -/* BEGIN_CASE */ +/* BEGIN_CASE depends_on:POLARSSL_CIPHER_MODE_CFB */ void camellia_decrypt_cfb128( char *hex_key_string, char *hex_iv_string, char *hex_src_string, char *hex_dst_string ) {