directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject directory-kerby git commit: Replace checks for AES256 available by JUnit's Assume, also add missing assumtions to other AES256 tests.
Date Wed, 01 Jul 2015 18:19:35 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master 59b004264 -> efc2eed5b


Replace checks for AES256 available by JUnit's Assume, also add missing assumtions to other
AES256 tests.


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

Branch: refs/heads/master
Commit: efc2eed5b0ddb889e39049bc64628772034f91a3
Parents: 59b0042
Author: Stefan Seelmann <mail@stefan-seelmann.de>
Authored: Wed Jul 1 20:17:56 2015 +0200
Committer: Stefan Seelmann <mail@stefan-seelmann.de>
Committed: Wed Jul 1 20:17:56 2015 +0200

----------------------------------------------------------------------
 .../kerberos/kerb/crypto/DecryptionTest.java    | 22 +++++--------
 .../kerberos/kerb/crypto/FastUtilTest.java      |  3 ++
 .../kerby/kerberos/kerb/crypto/PrfTest.java     |  7 ++---
 .../kerberos/kerb/crypto/String2keyTest.java    | 33 ++++++--------------
 .../kerberos/kerb/util/EncryptionTest.java      |  5 ++-
 .../kerberos/kerb/util/NewEncryptionTest.java   |  3 ++
 6 files changed, 27 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/efc2eed5/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 3f99a31..d21e1bc 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
@@ -27,6 +27,7 @@ import org.junit.Test;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.fail;
+import static org.junit.Assume.assumeTrue;
 
 /**
  * Decryption test with known ciphertexts.
@@ -712,9 +713,7 @@ public class DecryptionTest {
      */
     @Test
     public void testDecryptAES256_CTS_HMAC_SHA1_96_0() {
-        if(!EncryptionHandler.isAES256Enabled()) {
-            return;
-        }
+        assumeTrue(EncryptionHandler.isAES256Enabled());
 
         TestCase testCase = new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
@@ -734,9 +733,7 @@ public class DecryptionTest {
      */
     @Test
     public void testDecryptAES256_CTS_HMAC_SHA1_96_1() {
-        if(!EncryptionHandler.isAES256Enabled()) {
-            return;
-        }
+        assumeTrue(EncryptionHandler.isAES256Enabled());
 
         TestCase testCase = new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
@@ -756,9 +753,7 @@ public class DecryptionTest {
      */
     @Test
     public void testDecryptAES256_CTS_HMAC_SHA1_96_9() {
-        if(!EncryptionHandler.isAES256Enabled()) {
-            return;
-        }
+        assumeTrue(EncryptionHandler.isAES256Enabled());
 
         TestCase testCase = new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
@@ -779,9 +774,8 @@ public class DecryptionTest {
      */
     @Test
     public void testDecryptAES256_CTS_HMAC_SHA1_96_13() {
-        if(!EncryptionHandler.isAES256Enabled()) {
-            return;
-        }
+        assumeTrue(EncryptionHandler.isAES256Enabled());
+
         TestCase testCase = new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 "13 bytes byte", 3,
@@ -801,9 +795,7 @@ public class DecryptionTest {
      */
     @Test
     public void testDecryptAES256_CTS_HMAC_SHA1_96_30() {
-        if(!EncryptionHandler.isAES256Enabled()) {
-            return;
-        }
+        assumeTrue(EncryptionHandler.isAES256Enabled());
 
         TestCase testCase = new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/efc2eed5/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/FastUtilTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/FastUtilTest.java
b/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/FastUtilTest.java
index f97596a..30b0d66 100644
--- a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/FastUtilTest.java
+++ b/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/FastUtilTest.java
@@ -28,6 +28,7 @@ import org.junit.Test;
 import java.util.Arrays;
 
 import static org.assertj.core.api.Assertions.fail;
+import static org.junit.Assume.assumeTrue;
 
 public class FastUtilTest {
     static class TestCase {
@@ -124,6 +125,8 @@ public class FastUtilTest {
 
     @Test
     public void testFastUtil_AES256_CTS_HMAC_SHA1() throws Exception {
+        assumeTrue(EncryptionHandler.isAES256Enabled());
+
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 "key1",

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/efc2eed5/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/PrfTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/PrfTest.java
b/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/PrfTest.java
index 1b26e37..d9e78f1 100644
--- a/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/PrfTest.java
+++ b/kerby-kerb/kerb-crypto/src/test/java/org/apache/kerby/kerberos/kerb/crypto/PrfTest.java
@@ -26,6 +26,7 @@ import org.junit.Test;
 import java.util.Arrays;
 
 import static org.assertj.core.api.Assertions.fail;
+import static org.junit.Assume.assumeTrue;
 
 public class PrfTest {
     private static void performTest(TestCase testCase) throws Exception {
@@ -84,10 +85,8 @@ public class PrfTest {
 
     @Test
     public void testPrf_AES256_CTS_HMAC_SHA1() throws Exception {
-        if(!EncryptionHandler.isAES256Enabled()) {
-            System.out.println("AES256 is not supported in your jdk, pls update local_policy.jar,US_export_policy.jar
from http://docs.oracle.com/javase/");
-            return;
-        }
+        assumeTrue(EncryptionHandler.isAES256Enabled());
+
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
                 "key1",

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/efc2eed5/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 5e76e5e..5d0ea06 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
@@ -29,6 +29,7 @@ import java.util.Arrays;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.fail;
+import static org.junit.Assume.assumeTrue;
 
 /**
  * By ref. MIT krb5 t_str2key.c and RFC3961 test vectors
@@ -269,9 +270,7 @@ public class String2keyTest {
 
     @Test
     public void test_AES256_CTS_HMAC_SHA1_96_0() {
-        if(!EncryptionHandler.isAES256Enabled()) {
-            return;
-        }
+        assumeTrue(EncryptionHandler.isAES256Enabled());
 
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
@@ -285,9 +284,7 @@ public class String2keyTest {
 
     @Test
     public void test_AES256_CTS_HMAC_SHA1_96_1() {
-        if(!EncryptionHandler.isAES256Enabled()) {
-            return;
-        }
+        assumeTrue(EncryptionHandler.isAES256Enabled());
 
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
@@ -301,9 +298,7 @@ public class String2keyTest {
 
     @Test
     public void test_AES256_CTS_HMAC_SHA1_96_2() {
-        if(!EncryptionHandler.isAES256Enabled()) {
-            return;
-        }
+        assumeTrue(EncryptionHandler.isAES256Enabled());
 
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
@@ -317,9 +312,7 @@ public class String2keyTest {
 
     @Test
     public void test_AES256_CTS_HMAC_SHA1_96_3() {
-        if(!EncryptionHandler.isAES256Enabled()) {
-            return;
-        }
+        assumeTrue(EncryptionHandler.isAES256Enabled());
 
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
@@ -333,9 +326,7 @@ public class String2keyTest {
 
     @Test
     public void test_AES256_CTS_HMAC_SHA1_96_4() {
-        if(!EncryptionHandler.isAES256Enabled()) {
-            return;
-        }
+        assumeTrue(EncryptionHandler.isAES256Enabled());
 
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
@@ -351,9 +342,7 @@ public class String2keyTest {
 
     @Test
     public void test_AES256_CTS_HMAC_SHA1_96_5() {
-        if(!EncryptionHandler.isAES256Enabled()) {
-            return;
-        }
+        assumeTrue(EncryptionHandler.isAES256Enabled());
 
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
@@ -367,9 +356,7 @@ public class String2keyTest {
 
     @Test
     public void test_AES256_CTS_HMAC_SHA1_96_6() {
-        if(!EncryptionHandler.isAES256Enabled()) {
-            return;
-        }
+        assumeTrue(EncryptionHandler.isAES256Enabled());
 
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,
@@ -384,9 +371,7 @@ 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;
-        }
+        assumeTrue(EncryptionHandler.isAES256Enabled());
 
         performTest(new TestCase(
                 EncryptionType.AES256_CTS_HMAC_SHA1_96,

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/efc2eed5/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 21d9fc7..37222bc 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
@@ -36,6 +36,7 @@ import java.util.Arrays;
 import java.util.List;
 
 import static org.assertj.core.api.Assertions.assertThat;
+import static org.junit.Assume.assumeTrue;
 
 /*
 The principal keys for krbtgt/SH.INTEL.COM@SH.INTEL.COM
@@ -69,9 +70,7 @@ public class EncryptionTest {
 
     @Test
     public void testAes256() throws IOException, KrbException {
-        if(!EncryptionHandler.isAES256Enabled()) {
-            return;
-        }
+        assumeTrue(EncryptionHandler.isAES256Enabled());
 
         testEncWith("aes256-cts-hmac-sha1-96.cc");
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/efc2eed5/kerby-kerb/kerb-util/src/test/java/org/apache/kerby/kerberos/kerb/util/NewEncryptionTest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-util/src/test/java/org/apache/kerby/kerberos/kerb/util/NewEncryptionTest.java
b/kerby-kerb/kerb-util/src/test/java/org/apache/kerby/kerberos/kerb/util/NewEncryptionTest.java
index c585943..2545c1c 100644
--- a/kerby-kerb/kerb-util/src/test/java/org/apache/kerby/kerberos/kerb/util/NewEncryptionTest.java
+++ b/kerby-kerb/kerb-util/src/test/java/org/apache/kerby/kerberos/kerb/util/NewEncryptionTest.java
@@ -31,6 +31,7 @@ import java.io.IOException;
 import java.util.Arrays;
 
 import static org.assertj.core.api.Assertions.fail;
+import static org.junit.Assume.assumeTrue;
 
 public class NewEncryptionTest {
 
@@ -66,6 +67,8 @@ public class NewEncryptionTest {
 
     @Test
     public void testAes256CtsHmacSha1() throws IOException, KrbException {
+        assumeTrue(EncryptionHandler.isAES256Enabled());
+
         testEncWith(EncryptionType.AES256_CTS_HMAC_SHA1_96);
     }
 


Mime
View raw message