directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject directory-kerberos git commit: DIRKRB-165 Bypass AES256 test cases on platform doesn't have AES256 enabled. Contributed by Liqi
Date Tue, 10 Mar 2015 05:11:58 GMT
Repository: directory-kerberos
Updated Branches:
  refs/heads/master 5cb070aca -> 9ada0a937


DIRKRB-165 Bypass AES256 test cases on platform doesn't have AES256 enabled. Contributed by
Liqi


Project: http://git-wip-us.apache.org/repos/asf/directory-kerberos/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerberos/commit/9ada0a93
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerberos/tree/9ada0a93
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerberos/diff/9ada0a93

Branch: refs/heads/master
Commit: 9ada0a937db3fe3052917d25f7d8c89f663a8524
Parents: 5cb070a
Author: hazel <linchen7@foxmail.com>
Authored: Tue Mar 10 13:11:43 2015 +0800
Committer: hazel <linchen7@foxmail.com>
Committed: Tue Mar 10 13:11:43 2015 +0800

----------------------------------------------------------------------
 .../kerberos/kerb/codec/test/TestKerberos.java  |  5 ++
 .../kerberos/kerb/crypto/EncryptionHandler.java | 17 ++++
 .../kerberos/kerb/crypto/CheckSumsTest.java     |  4 +
 .../kerberos/kerb/crypto/DecryptionTest.java    | 19 +++++
 .../kerberos/kerb/crypto/KeyDeriveTest.java     | 84 +++++++++++---------
 .../kerberos/kerb/crypto/String2keyTest.java    | 32 ++++++++
 .../kerberos/kerb/util/EncryptionTest.java      |  4 +
 .../kerby/kerberos/kerb/util/KeysTest.java      |  3 +
 8 files changed, 132 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/9ada0a93/kerby-kerb/kerb-core-test/src/test/java/org/apache/kerby/kerberos/kerb/codec/test/TestKerberos.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core-test/src/test/java/org/apache/kerby/kerberos/kerb/codec/test/TestKerberos.java
b/kerby-kerb/kerb-core-test/src/test/java/org/apache/kerby/kerberos/kerb/codec/test/TestKerberos.java
index 42e5feb..c8c7f0f 100644
--- a/kerby-kerb/kerb-core-test/src/test/java/org/apache/kerby/kerberos/kerb/codec/test/TestKerberos.java
+++ b/kerby-kerb/kerb-core-test/src/test/java/org/apache/kerby/kerberos/kerb/codec/test/TestKerberos.java
@@ -21,6 +21,7 @@ package org.apache.kerby.kerberos.kerb.codec.test;
 
 import org.apache.kerby.kerberos.kerb.codec.kerberos.KerberosTicket;
 import org.apache.kerby.kerberos.kerb.codec.kerberos.KerberosToken;
+import org.apache.kerby.kerberos.kerb.crypto.EncryptionHandler;
 import org.apache.kerby.kerberos.kerb.spec.common.EncryptionKey;
 import org.junit.Before;
 import org.junit.Test;
@@ -138,6 +139,10 @@ public class TestKerberos {
 
     @Test
     public void testAes256Ticket() throws Exception {
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
         KerberosToken token = null;
         token = new KerberosToken(aes256Token, aes256Key);
 

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/9ada0a93/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/EncryptionHandler.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/EncryptionHandler.java
b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/EncryptionHandler.java
index e645a32..aece35b 100644
--- a/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/EncryptionHandler.java
+++ b/kerby-kerb/kerb-crypto/src/main/java/org/apache/kerby/kerberos/kerb/crypto/EncryptionHandler.java
@@ -19,6 +19,8 @@
  */
 package org.apache.kerby.kerberos.kerb.crypto;
 
+import javax.crypto.Cipher;
+
 import org.apache.kerby.kerberos.kerb.KrbErrorCode;
 import org.apache.kerby.kerberos.kerb.crypto.enc.*;
 import org.apache.kerby.kerberos.kerb.KrbException;
@@ -32,6 +34,21 @@ import org.apache.kerby.kerberos.kerb.spec.common.*;
  */
 public class EncryptionHandler {
 
+    private static boolean isAES256Enabled = false;
+
+    static {
+        try {
+            isAES256Enabled = Cipher.getMaxAllowedKeyLength("AES") >= 256;
+        } catch (Exception e) {
+            // should not happen
+        }
+
+    }
+
+    public static boolean isAES256Enabled() {
+        return isAES256Enabled;
+    }
+
     public static EncryptionType getEncryptionType(String eType) throws KrbException {
         EncryptionType result = EncryptionType.fromName(eType);
         return result;

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/9ada0a93/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/CheckSumsTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/CheckSumsTest.java
b/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/CheckSumsTest.java
index 796cc11..4739cfd 100644
--- a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/CheckSumsTest.java
+++ b/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/CheckSumsTest.java
@@ -111,6 +111,10 @@ public class CheckSumsTest {
 
     @Test
     public void testCheckSums_HMAC_SHA1_96_AES256() throws Exception {
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
         performTest(new CksumTest(
             "fourteen",
             CheckSumType.HMAC_SHA1_96_AES256, EncryptionType.AES256_CTS_HMAC_SHA1_96, 4,

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/9ada0a93/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/DecryptionTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/DecryptionTest.java
b/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/DecryptionTest.java
index 6f766ec..e688803 100644
--- a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/DecryptionTest.java
+++ b/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/DecryptionTest.java
@@ -712,6 +712,10 @@ public class DecryptionTest {
      */
     @Test
     public void testDecryptAES256_CTS_HMAC_SHA1_96_0() {
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
         TestCase testCase = new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 "", 0,
@@ -730,6 +734,10 @@ public class DecryptionTest {
      */
     @Test
     public void testDecryptAES256_CTS_HMAC_SHA1_96_1() {
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
         TestCase testCase = new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 "1", 1,
@@ -748,6 +756,10 @@ public class DecryptionTest {
      */
     @Test
     public void testDecryptAES256_CTS_HMAC_SHA1_96_9() {
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
         TestCase testCase = new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 "9 bytesss", 2,
@@ -767,6 +779,9 @@ public class DecryptionTest {
      */
     @Test
     public void testDecryptAES256_CTS_HMAC_SHA1_96_13() {
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
         TestCase testCase = new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 "13 bytes byte", 3,
@@ -786,6 +801,10 @@ public class DecryptionTest {
      */
     @Test
     public void testDecryptAES256_CTS_HMAC_SHA1_96_30() {
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
         TestCase testCase = new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 "30 bytes bytes bytes bytes byt", 4,

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/9ada0a93/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/KeyDeriveTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/KeyDeriveTest.java
b/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/KeyDeriveTest.java
index 4fe85c0..cf36588 100644
--- a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/KeyDeriveTest.java
+++ b/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/KeyDeriveTest.java
@@ -54,171 +54,183 @@ public class KeyDeriveTest {
 
     @Test
     public void testKeyDerive_DES3_CBC_SHA1_299() throws Exception {
-    	performTest(new TestCase(
-    			EncryptionType.DES3_CBC_SHA1,
+        performTest(new TestCase(
+                EncryptionType.DES3_CBC_SHA1,
                 "850BB51358548CD05E86768C313E3BFE" +
                         "F7511937DCF72C3E",
                 "0000000299",
                 "F78C496D16E6C2DAE0E0B6C24057A84C" +
                         "0426AEEF26FD6DCE"
-    			));
+                ));
     }
     
     @Test
     public void testKeyDerive_DES3_CBC_SHA1_2AA() throws Exception {
-    	performTest(new TestCase(
+        performTest(new TestCase(
                 EncryptionType.DES3_CBC_SHA1,
                 "850BB51358548CD05E86768C313E3BFE" +
                         "F7511937DCF72C3E",
                 "00000002AA",
                 "5B5723D0B634CB684C3EBA5264E9A70D" +
                         "52E683231AD3C4CE"
-    			));
-    	
+                ));
+
     }
     
     @Test
     public void testKeyDerive_DES3_CBC_SHA1_255() throws Exception {
-    	performTest(new TestCase(
+        performTest(new TestCase(
                 EncryptionType.DES3_CBC_SHA1,
                 "850BB51358548CD05E86768C313E3BFE" +
                         "F7511937DCF72C3E",
                 "0000000255",
                 "A77C94980E9B7345A81525C423A737CE" +
                         "67F4CD91B6B3DA45"
-    			));
+                ));
     }
     
     @Test
     public void testKeyDerive_AES128_CTS_HMAC_SHA1_96_299() throws Exception {
-    	performTest(new TestCase(
+        performTest(new TestCase(
                 EncryptionType.AES128_CTS_HMAC_SHA1_96,
                 "42263C6E89F4FC28B8DF68EE09799F15",
                 "0000000299",
                 "34280A382BC92769B2DA2F9EF066854B"
-    			));
+                ));
     }
     
     @Test
     public void testKeyDerive_AES128_CTS_HMAC_SHA1_96_2AA() throws Exception {
-    	performTest(new TestCase(
+        performTest(new TestCase(
                 EncryptionType.AES128_CTS_HMAC_SHA1_96,
                 "42263C6E89F4FC28B8DF68EE09799F15",
                 "00000002AA",
                 "5B14FC4E250E14DDF9DCCF1AF6674F53"
-    			));
+                ));
     }
     
     @Test
     public void testKeyDerive_AES128_CTS_HMAC_SHA1_96_255() throws Exception {
-    	performTest(new TestCase(
-    			EncryptionType.AES128_CTS_HMAC_SHA1_96,
+        performTest(new TestCase(
+                EncryptionType.AES128_CTS_HMAC_SHA1_96,
                 "42263C6E89F4FC28B8DF68EE09799F15",
                 "0000000255",
                 "4ED31063621684F09AE8D89991AF3E8F"
-    			));
+                ));
     }
     
     @Test
     public void testKeyDerive_AES256_CTS_HMAC_SHA1_96_299() throws Exception {
-    	performTest(new TestCase(
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
+        performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 "FE697B52BC0D3CE14432BA036A92E65B" +
                         "BB52280990A2FA27883998D72AF30161",
                 "0000000299",
                 "BFAB388BDCB238E9F9C98D6A878304F0" +
                         "4D30C82556375AC507A7A852790F4674"
-    			));
+                ));
     }
     
     @Test
     public void testKeyDerive_AES256_CTS_HMAC_SHA1_96_2AA() throws Exception {
-    	performTest(new TestCase(
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
+        performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 "FE697B52BC0D3CE14432BA036A92E65B" +
                         "BB52280990A2FA27883998D72AF30161",
                 "00000002AA",
                 "C7CFD9CD75FE793A586A542D87E0D139" +
                         "6F1134A104BB1A9190B8C90ADA3DDF37"
-    			));
+        ));
     }
     
     @Test
     public void testKeyDerive_AES256_CTS_HMAC_SHA1_96_255() throws Exception {
-    	performTest(new TestCase(
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
+        performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 "FE697B52BC0D3CE14432BA036A92E65B" +
                         "BB52280990A2FA27883998D72AF30161",
                 "0000000255",
                 "97151B4C76945063E2EB0529DC067D97" +
                         "D7BBA90776D8126D91F34F3101AEA8BA"
-    			));
+                ));
     }
     
     @Test
     public void testKeyDerive_CAMELLIA128_CTS_CMAC_299() throws Exception {
-    	performTest(new TestCase(
+        performTest(new TestCase(
                 EncryptionType.CAMELLIA128_CTS_CMAC,
                 "57D0297298FFD9D35DE5A47FB4BDE24B",
                 "0000000299",
                 "D155775A209D05F02B38D42A389E5A56"
-    			));
+                ));
     }
     
     @Test
     public void testKeyDerive_CAMELLIA128_CTS_CMAC_2AA() throws Exception {
-    	performTest(new TestCase(
+        performTest(new TestCase(
                 EncryptionType.CAMELLIA128_CTS_CMAC,
                 "57D0297298FFD9D35DE5A47FB4BDE24B",
                 "00000002AA",
                 "64DF83F85A532F17577D8C37035796AB"
-    			));
+                ));
     }
     
     @Test
     public void testKeyDerive_CAMELLIA128_CTS_CMAC_255() throws Exception {
-    	performTest(new TestCase(
+        performTest(new TestCase(
                 EncryptionType.CAMELLIA128_CTS_CMAC,
                 "57D0297298FFD9D35DE5A47FB4BDE24B",
                 "0000000255",
                 "3E4FBDF30FB8259C425CB6C96F1F4635"
-    			));
+                ));
     }
     
     @Test
     public void testKeyDerive_CAMELLIA256_CTS_CMAC_299() throws Exception {
-    	performTest(new TestCase(
+        performTest(new TestCase(
                 EncryptionType.CAMELLIA256_CTS_CMAC,
                 "B9D6828B2056B7BE656D88A123B1FAC6" +
                         "8214AC2B727ECF5F69AFE0C4DF2A6D2C",
                 "0000000299",
                 "E467F9A9552BC7D3155A6220AF9C1922" +
                         "0EEED4FF78B0D1E6A1544991461A9E50"
-    			));
+                ));
     }
     
     @Test
     public void testKeyDerive_CAMELLIA256_CTS_CMAC_2AA() throws Exception {
-    	performTest(new TestCase(
+        performTest(new TestCase(
                 EncryptionType.CAMELLIA256_CTS_CMAC,
                 "B9D6828B2056B7BE656D88A123B1FAC6" +
                         "8214AC2B727ECF5F69AFE0C4DF2A6D2C",
                 "00000002AA",
                 "412AEFC362A7285FC3966C6A5181E760" +
                         "5AE675235B6D549FBFC9AB6630A4C604"
-    			));
+                ));
     }
     
     @Test
     public void testKeyDerive_CAMELLIA256_CTS_CMAC_255() throws Exception {
-    	performTest(new TestCase(
-    			EncryptionType.CAMELLIA256_CTS_CMAC,
+        performTest(new TestCase(
+                EncryptionType.CAMELLIA256_CTS_CMAC,
                 "B9D6828B2056B7BE656D88A123B1FAC6" +
                         "8214AC2B727ECF5F69AFE0C4DF2A6D2C",
                 "0000000255",
                 "FA624FA0E523993FA388AEFDC67E67EB" +
                         "CD8C08E8A0246B1D73B0D1DD9FC582B0"
-    			));
+                ));
     }
 
     static DkKeyMaker getKeyMaker(EncryptionType encType) {
@@ -244,7 +256,7 @@ public class KeyDeriveTest {
      * @throws Exception
      */
     private static void performTest(TestCase testCase) throws Exception {
-    	byte[] answer = HexUtil.hex2bytes(testCase.answer);
+        byte[] answer = HexUtil.hex2bytes(testCase.answer);
         byte[] inkey = HexUtil.hex2bytes(testCase.inkey);
         byte[] constant = HexUtil.hex2bytes(testCase.constant);
         byte[] outkey;
@@ -257,7 +269,7 @@ public class KeyDeriveTest {
             System.err.println("answer:" + testCase.answer);
             fail("KeyDerive test failed for " + testCase.encType.getName());
         } else {
-        	System.out.println("KeyDerive test OK for " + testCase.encType.getName());
+            System.out.println("KeyDerive test OK for " + testCase.encType.getName());
         }    	
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/9ada0a93/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/String2keyTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/String2keyTest.java
b/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/String2keyTest.java
index 3fbe38f..ae0c9b5 100644
--- a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/String2keyTest.java
+++ b/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/String2keyTest.java
@@ -269,6 +269,10 @@ public class String2keyTest {
 
     @Test
     public void test_AES256_CTS_HMAC_SHA1_96_0() {
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 "password",
@@ -281,6 +285,10 @@ public class String2keyTest {
 
     @Test
     public void test_AES256_CTS_HMAC_SHA1_96_1() {
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 "password",
@@ -293,6 +301,10 @@ public class String2keyTest {
 
     @Test
     public void test_AES256_CTS_HMAC_SHA1_96_2() {
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 "password",
@@ -305,6 +317,10 @@ public class String2keyTest {
 
     @Test
     public void test_AES256_CTS_HMAC_SHA1_96_3() {
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 "password",
@@ -317,6 +333,10 @@ public class String2keyTest {
 
     @Test
     public void test_AES256_CTS_HMAC_SHA1_96_4() {
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
@@ -331,6 +351,10 @@ public class String2keyTest {
 
     @Test
     public void test_AES256_CTS_HMAC_SHA1_96_5() {
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
@@ -343,6 +367,10 @@ public class String2keyTest {
 
     @Test
     public void test_AES256_CTS_HMAC_SHA1_96_6() {
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 toUtf8("F09D849E"),
@@ -356,6 +384,10 @@ public class String2keyTest {
     // Check for KRB5_ERR_BAD_S2K_PARAMS return when weak iteration counts are forbidden
     @Test
     public void test_AES256_CTS_HMAC_SHA1_96_7() {
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 toUtf8("F09D849E"),

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/9ada0a93/kerby-kerb/kerb-util/src/test/java/org/apache/kerby/kerberos/kerb/util/EncryptionTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-util/src/test/java/org/apache/kerby/kerberos/kerb/util/EncryptionTest.java
b/kerby-kerb/kerb-util/src/test/java/org/apache/kerby/kerberos/kerb/util/EncryptionTest.java
index 9fb6f9e..1ca2ee7 100644
--- a/kerby-kerb/kerb-util/src/test/java/org/apache/kerby/kerberos/kerb/util/EncryptionTest.java
+++ b/kerby-kerb/kerb-util/src/test/java/org/apache/kerby/kerberos/kerb/util/EncryptionTest.java
@@ -69,6 +69,10 @@ public class EncryptionTest {
 
     @Test
     public void testAes256() throws IOException, KrbException {
+        if(!EncryptionHandler.isAES256Enabled()) {
+            return;
+        }
+
         testEncWith("aes256-cts-hmac-sha1-96.cc");
     }
 

http://git-wip-us.apache.org/repos/asf/directory-kerberos/blob/9ada0a93/kerby-kerb/kerb-util/src/test/java/org/apache/kerby/kerberos/kerb/util/KeysTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-util/src/test/java/org/apache/kerby/kerberos/kerb/util/KeysTest.java
b/kerby-kerb/kerb-util/src/test/java/org/apache/kerby/kerberos/kerb/util/KeysTest.java
index 6cc98b1..cfb3894 100644
--- a/kerby-kerb/kerb-util/src/test/java/org/apache/kerby/kerberos/kerb/util/KeysTest.java
+++ b/kerby-kerb/kerb-util/src/test/java/org/apache/kerby/kerberos/kerb/util/KeysTest.java
@@ -67,6 +67,9 @@ public class KeysTest {
 
         for (KeytabEntry ke : entries) {
             EncryptionType keyType = ke.getKey().getKeyType();
+            if (keyType.usesAES256()) {
+                continue;
+            }
             if (EncryptionHandler.isImplemented(keyType)) {
                 EncryptionKey genKey = EncryptionHandler.string2Key(principal.getName(),
                         TEST_PASSWORD, keyType);


Mime
View raw message