Fix no-cmac and no-camellia
authorMatt Caswell <matt@openssl.org>
Tue, 12 Nov 2019 15:51:00 +0000 (15:51 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 14 Nov 2019 09:44:18 +0000 (09:44 +0000)
Guard two tests that depend on CMAC and Camellia so that we don't fail
if those algorithms are not available.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/10424)

test/evp_kdf_test.c

index ddf935b8186aec851ba1d084e760bf0ad12e6746..5d807cd5331d270ff5ef16a1c28a9264120c29aa 100644 (file)
@@ -297,6 +297,7 @@ static int test_kdf_x963(void)
     return ret;
 }
 
     return ret;
 }
 
+#if !defined(OPENSSL_NO_CMAC) && !defined(OPENSSL_NO_CAMELLIA)
 /*
  * KBKDF test vectors from RFC 6803 (Camellia Encryption for Kerberos 5)
  * section 10.
 /*
  * KBKDF test vectors from RFC 6803 (Camellia Encryption for Kerberos 5)
  * section 10.
@@ -421,6 +422,7 @@ static int test_kdf_kbkdf_6803_256(void)
 
     return ret;
 }
 
     return ret;
 }
+#endif
 
 /* Two test vectors from RFC 8009 (AES Encryption with HMAC-SHA2 for Kerberos
  * 5) appendix A. */
 
 /* Two test vectors from RFC 8009 (AES Encryption with HMAC-SHA2 for Kerberos
  * 5) appendix A. */
@@ -771,8 +773,10 @@ static int test_kdf_krb5kdf(void)
 
 int setup_tests(void)
 {
 
 int setup_tests(void)
 {
+#if !defined(OPENSSL_NO_CMAC) && !defined(OPENSSL_NO_CAMELLIA)
     ADD_TEST(test_kdf_kbkdf_6803_128);
     ADD_TEST(test_kdf_kbkdf_6803_256);
     ADD_TEST(test_kdf_kbkdf_6803_128);
     ADD_TEST(test_kdf_kbkdf_6803_256);
+#endif
     ADD_TEST(test_kdf_kbkdf_8009_prf1);
     ADD_TEST(test_kdf_kbkdf_8009_prf2);
     ADD_TEST(test_kdf_get_kdf);
     ADD_TEST(test_kdf_kbkdf_8009_prf1);
     ADD_TEST(test_kdf_kbkdf_8009_prf2);
     ADD_TEST(test_kdf_get_kdf);