cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [2/2] cxf git commit: [CXF-6085] Prototyping JwsJsonConsumer
Date Tue, 17 Feb 2015 17:48:52 GMT
[CXF-6085] Prototyping JwsJsonConsumer


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

Branch: refs/heads/3.0.x-fixes
Commit: d2aaa37496ce74e1bbd3aa10a46ee3ea4df761be
Parents: c775be7
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Tue Feb 17 17:48:23 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Tue Feb 17 17:48:23 2015 +0000

----------------------------------------------------------------------
 .../rs/security/jose/jwe/JweJsonConsumerTest.java  | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/d2aaa374/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumerTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumerTest.java
b/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumerTest.java
index 0fcdece..4f6cc3f 100644
--- a/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumerTest.java
+++ b/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweJsonConsumerTest.java
@@ -53,6 +53,14 @@ public class JweJsonConsumerTest extends Assert {
         + "\"tag\":\"oVUQGS9608D-INq61-vOaA\""
         + "}";
     
+    private static final Boolean SKIP_AES_GCM_TESTS = isJava6();
+    
+    private static boolean isJava6() {
+        String version = System.getProperty("java.version");
+        return 1.6D == Double.parseDouble(version.substring(0, 3));    
+    }
+
+
     @BeforeClass
     public static void registerBouncyCastleIfNeeded() throws Exception {
         try {
@@ -114,6 +122,9 @@ public class JweJsonConsumerTest extends Assert {
     }
     @Test
     public void testSingleRecipientAllTypeOfHeadersAndAad() {
+        if (SKIP_AES_GCM_TESTS) {
+            return;
+        }
         final String text = "The true sign of intelligence is not knowledge but imagination.";
         
         SecretKey wrapperKey = CryptoUtils.createSecretKeySpec(JweJsonProducerTest.WRAPPER_BYTES1,

@@ -127,6 +138,9 @@ public class JweJsonConsumerTest extends Assert {
     }
     @Test
     public void testSingleRecipientAllTypeOfHeadersAndAadModified() {
+        if (SKIP_AES_GCM_TESTS) {
+            return;
+        }
         SecretKey wrapperKey = CryptoUtils.createSecretKeySpec(JweJsonProducerTest.WRAPPER_BYTES1,

                                                                "AES");
         JweDecryptionProvider jwe = JweUtils.createJweDecryptionProvider(wrapperKey, JoseConstants.A128KW_ALGO,

@@ -145,6 +159,9 @@ public class JweJsonConsumerTest extends Assert {
                                        String contentEncryptionAlgo,
                                        final byte[] wrapperKeyBytes,
                                        final byte[] cek) throws Exception {
+        if (contentEncryptionAlgo.equals(JoseConstants.A128GCM_ALGO) && SKIP_AES_GCM_TESTS)
{
+            return;
+        }
         JweDecryptionProvider jwe = null;
         if (wrapperKeyBytes != null) {
             SecretKey wrapperKey = CryptoUtils.createSecretKeySpec(wrapperKeyBytes, "AES");


Mime
View raw message