cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Attempting to fix Jose test when run with Java 8
Date Sun, 16 Nov 2014 21:19:29 GMT
Repository: cxf
Updated Branches:
  refs/heads/master a61e23530 -> b6d68bfed


Attempting to fix Jose test when run with Java 8


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

Branch: refs/heads/master
Commit: b6d68bfeda03798533b1ed381b280b2a3be956c3
Parents: a61e235
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Sun Nov 16 22:19:11 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Sun Nov 16 22:19:11 2014 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/rs/security/jose/jwa/Algorithm.java  | 2 ++
 .../cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java      | 3 +--
 2 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/b6d68bfe/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/Algorithm.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/Algorithm.java
b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/Algorithm.java
index d816d5a..c356bad 100644
--- a/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/Algorithm.java
+++ b/rt/rs/security/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/Algorithm.java
@@ -61,6 +61,8 @@ public enum Algorithm {
     A128GCM(JoseConstants.A128GCM_ALGO, "AES/GCM/NoPadding", 128),
     A192GCM(JoseConstants.A192GCM_ALGO, "AES/GCM/NoPadding", 192),
     A256GCM(JoseConstants.A256GCM_ALGO, "AES/GCM/NoPadding", 256),
+    //TODO: default to "AES/CBC/PKCS5Padding" if Cipher "AES/CBC/PKCS7Padding" 
+    // can not be initialized, apparently Java 8 has decided to settle on PKCS5Padding only

     A128CBC_HS256(JoseConstants.A128CBC_HS256_ALGO, "AES/CBC/PKCS7Padding", 128),
     A192CBC_HS384(JoseConstants.A192CBC_HS384_ALGO, "AES/CBC/PKCS7Padding", 192),
     A256CBC_HS512(JoseConstants.A256CBC_HS512_ALGO, "AES/CBC/PKCS7Padding", 256);

http://git-wip-us.apache.org/repos/asf/cxf/blob/b6d68bfe/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
b/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
index c88c5e4..41063f7 100644
--- a/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
+++ b/rt/rs/security/jose/src/test/java/org/apache/cxf/rs/security/jose/jwe/JweCompactReaderWriterTest.java
@@ -81,10 +81,9 @@ public class JweCompactReaderWriterTest extends Assert {
     @BeforeClass
     public static void registerBouncyCastleIfNeeded() throws Exception {
         try {
-            // Java 8 apparently has it
             Cipher.getInstance(Algorithm.AES_GCM_ALGO_JAVA);
+            Cipher.getInstance(Algorithm.AES_CBC_ALGO_JAVA);
         } catch (Throwable t) {
-            // Oracle Java 7
             Security.addProvider(new BouncyCastleProvider());    
         }
     }


Mime
View raw message