cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject [1/2] git commit: Defaulting to A256GSM JWT name if Java AES name is provided
Date Thu, 05 Jun 2014 14:12:10 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 68c318678 -> 63e9732af


Defaulting to A256GSM JWT name if Java AES name is provided


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

Branch: refs/heads/master
Commit: 95a6d1c0d97ac5aafb5c7f819d9cb120ea04a9e5
Parents: e44fba7
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Thu Jun 5 15:11:33 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Thu Jun 5 15:11:33 2014 +0100

----------------------------------------------------------------------
 .../org/apache/cxf/rs/security/oauth2/jwe/RSAJweEncryptor.java     | 2 +-
 .../main/java/org/apache/cxf/rs/security/oauth2/jwt/Algorithm.java | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/95a6d1c0/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwe/RSAJweEncryptor.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwe/RSAJweEncryptor.java
b/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwe/RSAJweEncryptor.java
index 9be12a1..22c2f7e 100644
--- a/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwe/RSAJweEncryptor.java
+++ b/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwe/RSAJweEncryptor.java
@@ -40,7 +40,7 @@ public class RSAJweEncryptor extends JweEncryptor {
              secretKey.getEncoded(), iv, DEFAULT_AUTH_TAG_LENGTH, true);
     }
     public RSAJweEncryptor(RSAPublicKey publicKey, SecretKey secretKey, byte[] iv) {
-        this(publicKey, secretKey, Algorithm.stripAlgoProperties(secretKey.getAlgorithm()),
iv);
+        this(publicKey, secretKey, Algorithm.toJwtName(secretKey.getAlgorithm()), iv);
     }
     
     public RSAJweEncryptor(RSAPublicKey publicKey, JweHeaders headers, byte[] cek, byte[]
iv, 

http://git-wip-us.apache.org/repos/asf/cxf/blob/95a6d1c0/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwt/Algorithm.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwt/Algorithm.java
b/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwt/Algorithm.java
index c675016..8e30195 100644
--- a/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwt/Algorithm.java
+++ b/rt/rs/security/oauth-parent/oauth2-jwt/src/main/java/org/apache/cxf/rs/security/oauth2/jwt/Algorithm.java
@@ -49,6 +49,7 @@ public enum Algorithm {
     public static final String RSA_OAEP_ALGO_JAVA = "RSA/ECB/OAEPWithSHA-1AndMGF1Padding";
     public static final String RSA_OAEP_256_ALGO_JAVA = "RSA/ECB/OAEPWithSHA-256AndMGF1Padding";
     public static final String RSA_1_5_ALGO_JAVA = "RSA/ECB/PKCS1Padding";
+    public static final String AES_ALGO_JAVA = "AES";
     public static final String A256GCM_ALGO_JAVA = "AES/GCM/NoPadding";
     
     private static final Map<String, String> JAVA_TO_JWT_NAMES;
@@ -65,6 +66,7 @@ public enum Algorithm {
         JAVA_TO_JWT_NAMES.put(RSA_OAEP_256_ALGO_JAVA, JwtConstants.RSA_OAEP_256_ALGO);
         JAVA_TO_JWT_NAMES.put(RSA_1_5_ALGO_JAVA, JwtConstants.RSA_1_5_ALGO);
         JAVA_TO_JWT_NAMES.put(A256GCM_ALGO_JAVA, JwtConstants.A256GCM_ALGO);
+        JAVA_TO_JWT_NAMES.put(AES_ALGO_JAVA, JwtConstants.A256GCM_ALGO);
         JWT_TO_JAVA_NAMES = new HashMap<String, String>();
         JWT_TO_JAVA_NAMES.put(JwtConstants.HMAC_SHA_256_ALGO, HMAC_SHA_256_JAVA);
         JWT_TO_JAVA_NAMES.put(JwtConstants.HMAC_SHA_384_ALGO, HMAC_SHA_384_JAVA);


Mime
View raw message