]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
De-conditionalize Camellia code
authorGreg Hudson <ghudson@mit.edu>
Tue, 9 Oct 2012 18:27:04 +0000 (14:27 -0400)
committerGreg Hudson <ghudson@mit.edu>
Tue, 9 Oct 2012 18:27:04 +0000 (14:27 -0400)
The Camellia enctypes and cksumtypes have received IANA assignments.
Add #defines using those assignments to krb5.h, remove the CAMELLIA
conditional, and enable testing code as appropriate.

The Camellia draft has not received an RFC number yet, so there is no
Doxygen markup for the enctype and cksumtype #defines.  That can be
added once the RFC number is known.

30 files changed:
src/include/k5-int.h
src/include/krb5/krb5.hin
src/lib/crypto/builtin/camellia/Makefile.in
src/lib/crypto/builtin/camellia/camellia-gen.c
src/lib/crypto/builtin/camellia/camellia.c
src/lib/crypto/builtin/enc_provider/camellia.c
src/lib/crypto/crypto_tests/Makefile.in
src/lib/crypto/crypto_tests/camellia-test.c
src/lib/crypto/crypto_tests/t_cksums.c
src/lib/crypto/crypto_tests/t_cmac.c
src/lib/crypto/crypto_tests/t_decrypt.c
src/lib/crypto/crypto_tests/t_derive.c
src/lib/crypto/crypto_tests/t_encrypt.c
src/lib/crypto/crypto_tests/t_short.c
src/lib/crypto/crypto_tests/t_str2key.c
src/lib/crypto/krb/checksum_dk_cmac.c
src/lib/crypto/krb/cksumtypes.c
src/lib/crypto/krb/cmac.c
src/lib/crypto/krb/crypto_int.h
src/lib/crypto/krb/derive.c
src/lib/crypto/krb/enc_dk_cmac.c
src/lib/crypto/krb/etypes.c
src/lib/crypto/krb/prf_cmac.c
src/lib/crypto/krb/s2k_pbkdf2.c
src/lib/crypto/nss/enc_provider/camellia.c
src/lib/crypto/openssl/enc_provider/camellia.c
src/lib/krb5/krb/init_ctx.c
src/lib/krb5/krb/t_etypes.c
src/tests/dejagnu/config/default.exp
src/util/k5test.py

index 14123a64851d336395edbeb170733101804e87bb..b96d9675d8bcb1d7e496e4e558b5dc1185ff6d03 100644 (file)
@@ -2383,28 +2383,6 @@ krb5int_c_mandatory_cksumtype(krb5_context, krb5_enctype, krb5_cksumtype *);
 krb5_error_code
 krb5int_clean_hostname(krb5_context, const char *, char *, size_t);
 
-#if 0
-/*
- * There are no IANA assignments for these enctypes or cksumtypes yet.  They
- * must be defined to local-use negative numbers at build time for Camellia
- * support to function at the moment.  If one is defined, they should all be
- * defined.  When IANA assignments exist, these definitions should move to the
- * appropriate places in krb5.hin and all CAMELLIA conditional code should be
- * made unconditional.
- *
- * The present code is experimental and may not be compatible with the
- * standardized version.
- */
-#define ENCTYPE_CAMELLIA128_CTS_CMAC -XXX /* Camellia CTS mode, 128-bit key */
-#define ENCTYPE_CAMELLIA256_CTS_CMAC -YYY /* Camellia CTS mode, 256-bit key */
-#define CKSUMTYPE_CMAC_CAMELLIA128 -XXX   /* CMAC, 128-bit Camellia key */
-#define CKSUMTYPE_CMAC_CAMELLIA256 -YYY   /* CMAC, 256-bit Camellia key */
-#endif
-
-#ifdef ENCTYPE_CAMELLIA128_CTS_CMAC
-#define CAMELLIA
-#endif
-
 struct _krb5_kt {       /* should move into k5-int.h */
     krb5_magic magic;
     const struct _krb5_kt_ops *ops;
index 8c623df947f63ba618b6cb4db40e158bea42ffa1..933d2b450a0f38a298fc3ca1e1926a771c34addf 100644 (file)
@@ -440,6 +440,8 @@ typedef struct _krb5_crypto_iov {
 #define ENCTYPE_AES256_CTS_HMAC_SHA1_96 0x0012 /**< RFC 3962 */
 #define ENCTYPE_ARCFOUR_HMAC            0x0017
 #define ENCTYPE_ARCFOUR_HMAC_EXP        0x0018
+#define ENCTYPE_CAMELLIA128_CTS_CMAC    0x0019
+#define ENCTYPE_CAMELLIA256_CTS_CMAC    0x001a
 #define ENCTYPE_UNKNOWN                 0x01ff
 
 #define CKSUMTYPE_CRC32         0x0001
@@ -456,6 +458,8 @@ typedef struct _krb5_crypto_iov {
                                                 ENCTYPE_AES128_CTS_HMAC_SHA1_96 */
 #define CKSUMTYPE_HMAC_SHA1_96_AES256 0x0010 /**< RFC 3962. Used with
                                                 ENCTYPE_AES256_CTS_HMAC_SHA1_96 */
+#define CKSUMTYPE_CMAC_CAMELLIA128 0x0011
+#define CKSUMTYPE_CMAC_CAMELLIA256 0x0012
 #define CKSUMTYPE_MD5_HMAC_ARCFOUR -137 /*Microsoft netlogon cksumtype*/
 #define CKSUMTYPE_HMAC_MD5_ARCFOUR -138 /*Microsoft md5 hmac cksumtype*/
 
index b11716ecc903712d8b576a8b94223e1f7fbcf0b3..e6c86bc131e232d1b0509956b2ddbd89a5b6ee23 100644 (file)
@@ -39,8 +39,7 @@ camellia-gen: camellia-gen.o $(GEN_OBJS)
 run-camellia-gen: camellia-gen
        ./camellia-gen > kresults.out
 
-# Enable when Camellia support becomes unconditional.
-#check:: run-camellia-gen
+check:: run-camellia-gen
 
 
 clean-unix:: clean-libobjs
index a9831671515850d5adf1f4c273d5c47de9bdeece..1446d779e654906d7e436e93e4763cb443b07aab 100644 (file)
@@ -8,8 +8,6 @@
 #include <unistd.h>
 #include "camellia.h"
 
-#ifdef CAMELLIA
-
 #define B 16U
 unsigned char key[16];
 unsigned char test_case_len[] = { B+1, 2*B-1, 2*B, 2*B+1, 3*B-1, 3*B, 4*B, };
@@ -316,18 +314,14 @@ static void cts_test ()
     printf ("\n");
 }
 
-#endif /* CAMELLIA */
-
 int main ()
 {
-#ifdef CAMELLIA
     init ();
     fips_test ();
 
     ecb_test();
     cbc_test();
     cts_test();
-#endif
 
     return 0;
 }
index 222b662156cd28edf0d06c336ceb29bf77144710..88dfe99ad9ad00def3cebaa1f3355c7f67563c91 100644 (file)
@@ -36,9 +36,6 @@
 
 #include "camellia.h"
 
-#include "k5-int.h" /* Only for CAMELLIA; remove later. */
-#ifdef CAMELLIA
-
 /* key constants */
 
 #define CAMELLIA_SIGMA1L (0xA09E667FL)
@@ -1540,5 +1537,3 @@ camellia_dec_blk(const unsigned char in_blk[],  unsigned char out_blk[],
     Camellia_DecryptBlock(cx->keybitlen, in_blk, cx->k_sch, out_blk);
     return camellia_good;
 }
-
-#endif /* CAMELLIA */
index ef51d4421180624bafa76814e53d864fd00b8240..2faf811bf3d30ebedc258d6c0a136639d73e383c 100644 (file)
@@ -27,8 +27,6 @@
 #include "crypto_int.h"
 #include "camellia.h"
 
-#ifdef CAMELLIA
-
 /*
  * Private per-key data to cache after first generation.  We don't want to mess
  * with the imported Cemallia implementation too much, so we'll just use two
@@ -339,25 +337,3 @@ const struct krb5_enc_provider krb5int_enc_camellia256 = {
     camellia_init_state,
     krb5int_default_free_state
 };
-
-#else /* CAMELLIA */
-
-/* These won't be used, but are still in the export table. */
-
-krb5_error_code
-krb5int_camellia_cbc_mac(krb5_key key, const krb5_crypto_iov *data,
-                         size_t num_data, const krb5_data *iv,
-                         krb5_data *output)
-{
-    return EINVAL;
-}
-
-const struct krb5_enc_provider krb5int_enc_camellia128 = {
-    0
-};
-
-const struct krb5_enc_provider krb5int_enc_camellia256 = {
-    0
-};
-
-#endif /* CAMELLIA */
index 5aeef54a6e872a42620485c56a763fab1860e44b..58e1c48109a543d13fbb6604ff25ddb7ea236068 100644 (file)
@@ -59,8 +59,7 @@ check-unix:: t_nfold t_encrypt t_decrypt t_prf t_prng t_cmac t_hmac \
        $(RUN_SETUP) $(VALGRIND) ./aes-test > vt.txt
        cmp vt.txt $(srcdir)/expect-vt.txt
        $(RUN_SETUP) $(VALGRIND) ./camellia-test > camellia-vt.txt
-# Enable this when Camellia becomes unconditional.
-#      cmp camellia-vt.txt $(srcdir)/camellia-expect-vt.txt
+       cmp camellia-vt.txt $(srcdir)/camellia-expect-vt.txt
        $(RUN_SETUP) $(VALGRIND) $(C)t_mddriver4 -x
        $(RUN_SETUP) $(VALGRIND) $(C)t_mddriver -x
        $(RUN_SETUP) $(VALGRIND) ./t_short
index 9975d4d2610b7ca2a22619292535ca281a388b95..73ef2caa438c82ec4502b373286b6474ef50b33f 100644 (file)
@@ -28,9 +28,7 @@
  */
 
 #include <stdio.h>
-#include "k5-int.h"
-
-#ifdef CAMELLIA
+#include "crypto_int.h"
 
 static char key[32];
 static char plain[16], cipher[16], zero[16];
@@ -124,11 +122,8 @@ static void vt_test()
     vt_test_1(32);
 }
 
-#endif /* CAMELLIA */
-
 int main (int argc, char *argv[])
 {
-#ifdef CAMELLIA
     if (argc > 2 || (argc == 2 && strcmp(argv[1], "-k"))) {
        fprintf(stderr,
                "usage:\t%s -k\tfor variable-key tests\n"
@@ -141,6 +136,5 @@ int main (int argc, char *argv[])
        vk_test();
     else
        vt_test();
-#endif /* CAMELLIA */
     return 0;
 }
index ee089eebda9a0df1947570795aed06d10797e3a2..c0694a1c0d7ceb240eea9b53128a76e5337b9dac 100644 (file)
@@ -108,7 +108,6 @@ struct test {
         { KV5M_DATA, 16,
           "\xEB\x38\xCC\x97\xE2\x23\x0F\x59\xDA\x41\x17\xDC\x58\x59\xD7\xEC" }
     },
-#ifdef CAMELLIA
     {
         "abcdefghijk",
         CKSUMTYPE_CMAC_CAMELLIA128, ENCTYPE_CAMELLIA128_CTS_CMAC, 7,
@@ -143,7 +142,6 @@ struct test {
         { KV5M_DATA, 16,
           "\x3F\xA0\xB4\x23\x55\xE5\x2B\x18\x91\x87\x29\x4A\xA2\x52\xAB\x64" }
     },
-#endif
 };
 
 static void
index 7a4b3aeee955aef49d95ab74e29bd3715ff467a3..7a95e437aac29fd4f64c8877dd3baf0a9b9f3acd 100644 (file)
@@ -40,8 +40,6 @@
 
 #include "crypto_int.h"
 
-#ifdef CAMELLIA
-
 /* All examples use the following Camellia-128 key. */
 static unsigned char keybytes[] = {
     0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6,
@@ -98,12 +96,9 @@ check_result(const char *name, const unsigned char *result,
     }
 }
 
-#endif /* CAMELLIA */
-
 int
 main(int argc, char **argv)
 {
-#ifdef CAMELLIA
     krb5_context context = NULL;
     krb5_keyblock keyblock;
     krb5_key key;
@@ -142,6 +137,5 @@ main(int argc, char **argv)
 
     printf("All CMAC tests passed.\n");
     krb5_k_free_key(context, key);
-#endif /* CAMELLIA */
     return 0;
 }
index 34486c8655c2cf2e010428ce212b5bb93e57df9b..9db60a1f2577a39c8c1b43fc2e4a71d2289fd885 100644 (file)
@@ -445,7 +445,6 @@ struct test {
           "\xB7\x34\xD4\xD4\x98\xB6\x71\x4F\x1C\x1D" }
     },
 
-#ifdef CAMELLIA
     {
         ENCTYPE_CAMELLIA128_CTS_CMAC,
         "", 0,
@@ -552,7 +551,6 @@ struct test {
           "\xF3\x4A\xD1\x25\x5A\x34\x49\x99\xAD\x37\x14\x68\x87\xA6\xC6\x84"
           "\x57\x31\xAC\x7F\x46\x37\x6A\x05\x04\xCD\x06\x57\x14\x74" }
     },
-#endif
 };
 
 static void
@@ -585,10 +583,8 @@ enctypes[] = {
     ENCTYPE_ARCFOUR_HMAC_EXP,
     ENCTYPE_AES128_CTS_HMAC_SHA1_96,
     ENCTYPE_AES256_CTS_HMAC_SHA1_96,
-#ifdef CAMELLIA
     ENCTYPE_CAMELLIA128_CTS_CMAC,
     ENCTYPE_CAMELLIA256_CTS_CMAC
-#endif
 };
 
 static char *plaintexts[] = {
index 5f4c04ae65c28d0f3fcbc0ad9821de0bdf41443a..0f34b00ed48455b32aba01303c5dd734d5714079 100644 (file)
@@ -137,7 +137,6 @@ struct test {
           "\xD7\xBB\xA9\x07\x76\xD8\x12\x6D\x91\xF3\x4F\x31\x01\xAE\xA8\xBA" }
     },
 
-#ifdef CAMELLIA
     /* Kc, Ke, Ki for a Camellia-128 key */
     {
         ENCTYPE_CAMELLIA128_CTS_CMAC,
@@ -201,7 +200,6 @@ struct test {
           "\xFA\x62\x4F\xA0\xE5\x23\x99\x3F\xA3\x88\xAE\xFD\xC6\x7E\x67\xEB"
           "\xCD\x8C\x08\xE8\xA0\x24\x6B\x1D\x73\xB0\xD1\xDD\x9F\xC5\x82\xB0" }
     },
-#endif
 };
 
 static void
@@ -231,10 +229,8 @@ get_enc_provider(krb5_enctype enctype)
     case ENCTYPE_DES3_CBC_SHA1:           return &krb5int_enc_des3;
     case ENCTYPE_AES128_CTS_HMAC_SHA1_96: return &krb5int_enc_aes128;
     case ENCTYPE_AES256_CTS_HMAC_SHA1_96: return &krb5int_enc_aes256;
-#ifdef CAMELLIA
     case ENCTYPE_CAMELLIA128_CTS_CMAC:    return &krb5int_enc_camellia128;
     case ENCTYPE_CAMELLIA256_CTS_CMAC:    return &krb5int_enc_camellia256;
-#endif
     }
     abort();
 }
index 580120b8fb6f9869bd042d35c793beca921ea71a..1ac375e49771c6e1e697e6e9f686f816d4e0174a 100644 (file)
@@ -45,10 +45,8 @@ krb5_enctype interesting_enctypes[] = {
     ENCTYPE_ARCFOUR_HMAC_EXP,
     ENCTYPE_AES256_CTS_HMAC_SHA1_96,
     ENCTYPE_AES128_CTS_HMAC_SHA1_96,
-#ifdef CAMELLIA
     ENCTYPE_CAMELLIA128_CTS_CMAC,
     ENCTYPE_CAMELLIA256_CTS_CMAC,
-#endif
     0
 };
 
index 295206651a5e756bea91750fd2a86df8ba84bf7e..6ee7b1987abe507fe6c9929d9c9721c10f88d559 100644 (file)
@@ -42,10 +42,8 @@ krb5_enctype interesting_enctypes[] = {
     ENCTYPE_ARCFOUR_HMAC_EXP,
     ENCTYPE_AES256_CTS_HMAC_SHA1_96,
     ENCTYPE_AES128_CTS_HMAC_SHA1_96,
-#ifdef CAMELLIA
     ENCTYPE_CAMELLIA128_CTS_CMAC,
     ENCTYPE_CAMELLIA256_CTS_CMAC,
-#endif
     0
 };
 
index fe58bd11c3970d22c3b0ce1c944f1aca7076e528..e9b29ba67f6312249693d72d62c286c83dcc340b 100644 (file)
@@ -410,7 +410,6 @@ struct test {
           "\x57\x18\x48\xB7\x84\xA3\xD6\xBD\xC3\x46\x58\x9A\x3E\x39\x3F\x9E" }
     },
 
-#ifdef CAMELLIA
     /* The same inputs applied to Camellia enctypes. */
     {
         ENCTYPE_CAMELLIA128_CTS_CMAC,
@@ -531,7 +530,6 @@ struct test {
           "\x16\x3B\x76\x8C\x6D\xB1\x48\xB4\xEE\xC7\x16\x3D\xF5\xAE\xD7\x0E"
           "\x20\x6B\x68\xCE\xC0\x78\xBC\x06\x9E\xD6\x8A\x7E\xD3\x6B\x1E\xCC" }
     }
-#endif /* CAMELLIA */
 };
 
 static void
index bb48c577cc2730381160fe88317587e82e92d00e..59d5c5a523224aadf15bd6ed3c9a480cd4fa0244 100644 (file)
@@ -28,8 +28,6 @@
 
 #define K5CLENGTH 5 /* 32 bit net byte order integer + one byte seed */
 
-#ifdef CAMELLIA
-
 krb5_error_code
 krb5int_dk_cmac_checksum(const struct krb5_cksumtypes *ctp,
                          krb5_key key, krb5_keyusage usage,
@@ -58,5 +56,3 @@ krb5int_dk_cmac_checksum(const struct krb5_cksumtypes *ctp,
     krb5_k_free_key(NULL, kc);
     return ret;
 }
-
-#endif /* CAMELLIA */
index fd95057c45e19abb68b6d70ac1b6557cdb9c4ff6..a1ced981fb19c15a2e52f3c16676843991a71cd2 100644 (file)
@@ -101,7 +101,6 @@ const struct krb5_cksumtypes krb5int_cksumtypes_list[] = {
       krb5int_hmacmd5_checksum, NULL,
       16, 16, 0 },
 
-#ifdef CAMELLIA
     { CKSUMTYPE_CMAC_CAMELLIA128,
       "cmac-camellia128", { 0 }, "CMAC Camellia128 key",
       &krb5int_enc_camellia128, NULL,
@@ -113,7 +112,6 @@ const struct krb5_cksumtypes krb5int_cksumtypes_list[] = {
       &krb5int_enc_camellia256, NULL,
       krb5int_dk_cmac_checksum, NULL,
       16, 16, 0 },
-#endif /* CAMELLIA */
 };
 
 const size_t krb5int_cksumtypes_length =
index 19af2201eea56481b3d4eef3562f72fa5d3e773b..2e220c5d56486c7b4c31a0843aad6f2a4d9c6764 100644 (file)
@@ -41,8 +41,6 @@
 
 #include "crypto_int.h"
 
-#ifdef CAMELLIA
-
 #define BLOCK_SIZE 16
 
 static unsigned char const_Rb[BLOCK_SIZE] = {
@@ -221,17 +219,3 @@ krb5int_cmac_checksum(const struct krb5_enc_provider *enc, krb5_key key,
 
     return 0;
 }
-
-#else /* CAMELLIA */
-
-/* This won't be used, but is still in the export table. */
-
-krb5_error_code
-krb5int_cmac_checksum(const struct krb5_enc_provider *enc, krb5_key key,
-                      const krb5_crypto_iov *data, size_t num_data,
-                      krb5_data *output)
-{
-    return EINVAL;
-}
-
-#endif /* CAMELLIA */
index cb9aef34624437e14b17fd7b0b6a513504701b02..01090d006810c36a03998b6f1d94c654ad86cdd3 100644 (file)
@@ -321,11 +321,8 @@ krb5_error_code krb5int_confounder_verify(const struct krb5_cksumtypes *ctp,
 /*** Key derivation functions ***/
 
 enum deriv_alg {
-    DERIVE_RFC3961              /* RFC 3961 section 5.1 */
-#ifdef CAMELLIA
-    ,                           /* C90 doesn't let enum list end w/comma */
+    DERIVE_RFC3961,             /* RFC 3961 section 5.1 */
     DERIVE_SP800_108_CMAC       /* NIST SP 800-108 with CMAC as PRF */
-#endif
 };
 
 krb5_error_code krb5int_derive_keyblock(const struct krb5_enc_provider *enc,
@@ -421,10 +418,8 @@ extern const struct krb5_enc_provider krb5int_enc_aes128;
 extern const struct krb5_enc_provider krb5int_enc_aes256;
 extern const struct krb5_enc_provider krb5int_enc_aes128_ctr;
 extern const struct krb5_enc_provider krb5int_enc_aes256_ctr;
-#ifdef CAMELLIA
 extern const struct krb5_enc_provider krb5int_enc_camellia128;
 extern const struct krb5_enc_provider krb5int_enc_camellia256;
-#endif
 
 extern const struct krb5_hash_provider krb5int_hash_crc32;
 extern const struct krb5_hash_provider krb5int_hash_md4;
@@ -462,8 +457,7 @@ krb5_error_code krb5int_pbkdf2_hmac_sha1(const krb5_data *out,
                                          const krb5_data *salt);
 
 /* The following are used by test programs and are just handler functions from
- * the AES and Camellia enc providers.  Define a stub krb5int_camellia_cbc_mac
- * even if CAMELLIA isn't defined, since it's in the export list. */
+ * the AES and Camellia enc providers. */
 krb5_error_code krb5int_aes_encrypt(krb5_key key, const krb5_data *ivec,
                                     krb5_crypto_iov *data, size_t num_data);
 krb5_error_code krb5int_aes_decrypt(krb5_key key, const krb5_data *ivec,
index 1cb47af4baa2570768dd9b65dcb328ae3b2ba9f5..1509f422503769f77f9ff053121cdb3ea593e3ad 100644 (file)
@@ -130,8 +130,6 @@ cleanup:
     return ret;
 }
 
-#ifdef CAMELLIA
-
 /*
  * NIST SP800-108 KDF in feedback mode (section 5.2).
  * Parameters:
@@ -207,8 +205,6 @@ cleanup:
     return ret;
 }
 
-#endif /* CAMELLIA */
-
 krb5_error_code
 krb5int_derive_random(const struct krb5_enc_provider *enc,
                       krb5_key inkey, krb5_data *outrnd,
@@ -217,10 +213,8 @@ krb5int_derive_random(const struct krb5_enc_provider *enc,
     switch (alg) {
     case DERIVE_RFC3961:
         return derive_random_rfc3961(enc, inkey, outrnd, in_constant);
-#ifdef CAMELLIA
     case DERIVE_SP800_108_CMAC:
         return derive_random_sp800_108_cmac(enc, inkey, outrnd, in_constant);
-#endif
     default:
         return EINVAL;
     }
index 6593d172e38827bba2a292f7e11d80fe7e26d64c..508f9f8234edd906e1a50e978ca3b915956aeb37 100644 (file)
@@ -27,8 +27,6 @@
 
 #include "crypto_int.h"
 
-#ifdef CAMELLIA
-
 #define K5CLENGTH 5 /* 32 bit net byte order integer + one byte seed */
 
 /* AEAD */
@@ -182,5 +180,3 @@ cleanup:
     zapfree(cksum.data, cksum.length);
     return ret;
 }
-
-#endif /* CAMELLIA */
index a9b176dbd8d8fceccc2e6cff6ab0a7bf5aa7b5c3..53be1d54df5196eccf39c74346bf53d6e6398c1f 100644 (file)
@@ -144,7 +144,7 @@ const struct krb5_keytypes krb5int_enctypes_list[] = {
       krb5int_dk_prf,
       CKSUMTYPE_HMAC_SHA1_96_AES256,
       0 /*flags*/ },
-#ifdef CAMELLIA
+
     { ENCTYPE_CAMELLIA128_CTS_CMAC,
       "camellia128-cts-cmac", { "camellia128-cts" },
       "Camellia-128 CTS mode with CMAC",
@@ -167,7 +167,6 @@ const struct krb5_keytypes krb5int_enctypes_list[] = {
       krb5int_dk_cmac_prf,
       CKSUMTYPE_CMAC_CAMELLIA256,
       0 /*flags */ },
-#endif /* CAMELLIA */
 };
 
 const int krb5int_enctypes_length =
index d3e71617dcc72603252799201e7966305be680eb..131c36d123f96a8f0bbe57ca3a9fe482e341a6bb 100644 (file)
@@ -26,8 +26,6 @@
 
 #include "crypto_int.h"
 
-#ifdef CAMELLIA
-
 krb5_error_code
 krb5int_dk_cmac_prf(const struct krb5_keytypes *ktp, krb5_key key,
                     const krb5_data *in, krb5_data *out)
@@ -58,5 +56,3 @@ cleanup:
     krb5_k_free_key(NULL, kp);
     return ret;
 }
-
-#endif /* CAMELLIA */
index 90fe3c694ef336b3dd6285cb67e135d39aa631a9..2476865f3599f5da37be3279bedd19fed28dc6b0 100644 (file)
@@ -183,7 +183,6 @@ krb5int_aes_string_to_key(const struct krb5_keytypes *ktp,
                                 DERIVE_RFC3961, 4096);
 }
 
-#ifdef CAMELLIA
 krb5_error_code
 krb5int_camellia_string_to_key(const struct krb5_keytypes *ktp,
                                const krb5_data *string,
@@ -196,4 +195,3 @@ krb5int_camellia_string_to_key(const struct krb5_keytypes *ktp,
     return pbkdf2_string_to_key(ktp, string, salt, &pepper, params, key,
                                 DERIVE_SP800_108_CMAC, 32768);
 }
-#endif
index f4eb0deb7b38c721dc61a5c48303a00d68c92dbc..9859efa1dad4215a752e1a974134d3017f354b97 100644 (file)
@@ -36,8 +36,6 @@
 #include "crypto_int.h"
 #include "nss_gen.h"
 
-#ifdef CAMELLIA
-
 static krb5_error_code
 krb5int_camellia_encrypt(krb5_key key, const krb5_data *ivec,
                          krb5_crypto_iov *data, size_t num_data)
@@ -113,23 +111,3 @@ const struct krb5_enc_provider krb5int_enc_camellia256 = {
     krb5int_default_free_state,
     k5_nss_gen_cleanup
 };
-
-#else /* CAMELLIA_CCM */
-
-/* These won't be used, but are still in the export table. */
-
-krb5_error_code
-krb5int_camellia_cbc_mac(krb5_key key, const krb5_crypto_iov *data,
-                         size_t num_data, const krb5_data *iv,
-                         krb5_data *output)
-{
-    return EINVAL;
-}
-
-const struct krb5_enc_provider krb5int_enc_camellia128 = {
-};
-
-const struct krb5_enc_provider krb5int_enc_camellia256 = {
-};
-
-#endif
index f22826bbd4ed9ad8529cfca434b6c9068de1857a..2173db6a86c3acd2ff64b488271fa91b34c871aa 100644 (file)
@@ -29,8 +29,6 @@
 #include <openssl/camellia.h>
 #include <openssl/modes.h>
 
-#ifdef CAMELLIA
-
 static krb5_error_code
 cbc_enc(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,
         size_t num_data);
@@ -384,23 +382,3 @@ const struct krb5_enc_provider krb5int_enc_camellia256 = {
     krb5int_camellia_init_state,
     krb5int_default_free_state
 };
-
-#else /* CAMELLIA */
-
-/* These won't be used, but are still in the export table. */
-
-krb5_error_code
-krb5int_camellia_cbc_mac(krb5_key key, const krb5_crypto_iov *data,
-                         size_t num_data, const krb5_data *iv,
-                         krb5_data *output)
-{
-    return EINVAL;
-}
-
-const struct krb5_enc_provider krb5int_enc_camellia128 = {
-};
-
-const struct krb5_enc_provider krb5int_enc_camellia256 = {
-};
-
-#endif /* CAMELLIA */
index 6e098f8baa036882b412e368af7b45a683e51cec..aa793fc8f30ac92102ecc3f4cb70f2fbcee1813f 100644 (file)
@@ -468,11 +468,9 @@ krb5int_parse_enctype_list(krb5_context context, const char *profkey,
             mod_list(ENCTYPE_AES128_CTS_HMAC_SHA1_96, sel, weak, &list);
         } else if (strcasecmp(token, "rc4") == 0) {
             mod_list(ENCTYPE_ARCFOUR_HMAC, sel, weak, &list);
-#ifdef CAMELLIA
         } else if (strcasecmp(token, "camellia") == 0) {
             mod_list(ENCTYPE_CAMELLIA256_CTS_CMAC, sel, weak, &list);
             mod_list(ENCTYPE_CAMELLIA128_CTS_CMAC, sel, weak, &list);
-#endif
         } else if (krb5_string_to_enctype(token, &etype) == 0) {
             /* Set a specific enctype. */
             mod_list(etype, sel, weak, &list);
index 72dbb20aa15e13e2d27c9e8aa78544358c5ccb3d..0a8a19984a7151633d48646f6c15e30ff654dccc 100644 (file)
@@ -97,14 +97,12 @@ static struct {
         ENCTYPE_DES3_CBC_SHA1, 0 },
       0, 0
     },
-#ifdef CAMELLIA
     /* Family with enctype removed */
     { "camellia -camellia256-cts-cmac",
       { 0 },
       { ENCTYPE_CAMELLIA128_CTS_CMAC, 0 },
       { ENCTYPE_CAMELLIA128_CTS_CMAC, 0 }
     },
-#endif
     /* Enctype followed by two families */
     { "+rc4-hmAC des3 +des",
       { 0 },
index 2804b5c7f9f4e0600ac5d228033139f136d1b1a6..67963c579a03bcc9683a76008f6c68f63775ba18 100644 (file)
@@ -188,6 +188,30 @@ set passes {
        {master_key_type=aes256-cts-hmac-sha1-96}
        {dummy=[verbose -log "AES enctypes"]}
     }
+    {
+       camellia-only
+       mode=udp
+       des3_krbtgt=0
+       {supported_enctypes=camellia256-cts:normal}
+       {permitted_enctypes(kdc)=camellia256-cts}
+       {permitted_enctypes(slave)=camellia256-cts}
+       {permitted_enctypes(client)=camellia256-cts}
+       {permitted_enctypes(server)=camellia256-cts}
+       {default_tgs_enctypes(kdc)=camellia256-cts}
+       {default_tgs_enctypes(slave)=camellia256-cts}
+       {default_tgs_enctypes(client)=camellia256-cts}
+       {default_tgs_enctypes(server)=camellia256-cts}
+       {default_tkt_enctypes(kdc)=camellia256-cts}
+       {default_tkt_enctypes(slave)=camellia256-cts}
+       {default_tkt_enctypes(client)=camellia256-cts}
+       {default_tkt_enctypes(server)=camellia256-cts}
+       {allow_weak_crypto(kdc)=false}
+       {allow_weak_crypto(slave)=false}
+       {allow_weak_crypto(client)=false}
+       {allow_weak_crypto(server)=false}
+       {master_key_type=camellia256-cts}
+       {dummy=[verbose -log "Camellia-256 enctype"]}
+    }
     {
        aes-des3
        mode=udp
@@ -263,32 +287,6 @@ set passes {
     }
 }
 
-# Add to above when Camellia support becomes unconditional.
-#    {
-#      camellia-only
-#      mode=udp
-#      des3_krbtgt=0
-#      {supported_enctypes=camellia256-cts:normal}
-#      {permitted_enctypes(kdc)=camellia256-cts}
-#      {permitted_enctypes(slave)=camellia256-cts}
-#      {permitted_enctypes(client)=camellia256-cts}
-#      {permitted_enctypes(server)=camellia256-cts}
-#      {default_tgs_enctypes(kdc)=camellia256-cts}
-#      {default_tgs_enctypes(slave)=camellia256-cts}
-#      {default_tgs_enctypes(client)=camellia256-cts}
-#      {default_tgs_enctypes(server)=camellia256-cts}
-#      {default_tkt_enctypes(kdc)=camellia256-cts}
-#      {default_tkt_enctypes(slave)=camellia256-cts}
-#      {default_tkt_enctypes(client)=camellia256-cts}
-#      {default_tkt_enctypes(server)=camellia256-cts}
-#      {allow_weak_crypto(kdc)=false}
-#      {allow_weak_crypto(slave)=false}
-#      {allow_weak_crypto(client)=false}
-#      {allow_weak_crypto(server)=false}
-#      {master_key_type=camellia256-cts}
-#      {dummy=[verbose -log "Camellia-256 enctype"]}
-#    }
-
 # des.md5-tgt is set as unused, since it won't trigger the error case
 # if SUPPORT_DESMD5 isn't honored.
 
index 6af782c729fd738b1460a89b0453ac216c5cc716..4fd8cf752694913a0007f8e0b29367a19a86a0df 100644 (file)
@@ -1185,15 +1185,14 @@ _passes = [
                         'master_key_type' : 'aes128-cts'}}}}),
 
     # Exercise the camellia256-cts enctype.
-# Enable when Camellia support becomes unconditional.
-#    ('camellia256', None,
-#      {'all' : {'libdefaults' : {
-#                    'default_tgs_enctypes' : 'camellia256-cts',
-#                    'default_tkt_enctypes' : 'camellia256-cts',
-#                    'permitted_enctypes' : 'camellia256-cts'}}},
-#      {'master' : {'realms' : {'$realm' : {
-#                        'supported_enctypes' : 'camellia256-cts:normal',
-#                        'master_key_type' : 'camellia256-cts'}}}}),
+    ('camellia256', None,
+      {'all' : {'libdefaults' : {
+                    'default_tgs_enctypes' : 'camellia256-cts',
+                    'default_tkt_enctypes' : 'camellia256-cts',
+                    'permitted_enctypes' : 'camellia256-cts'}}},
+      {'master' : {'realms' : {'$realm' : {
+                        'supported_enctypes' : 'camellia256-cts:normal',
+                        'master_key_type' : 'camellia256-cts'}}}}),
 
     # Test a setup with modern principal keys but an old TGT key.
     ('aes256.destgt', 'des-cbc-crc:normal',