Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2045CC6BE for ; Thu, 5 Jun 2014 14:12:11 +0000 (UTC) Received: (qmail 37147 invoked by uid 500); 5 Jun 2014 14:12:11 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 36962 invoked by uid 500); 5 Jun 2014 14:12:11 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 36947 invoked by uid 99); 5 Jun 2014 14:12:11 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Jun 2014 14:12:11 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 9F04B94AE46; Thu, 5 Jun 2014 14:12:10 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sergeyb@apache.org To: commits@cxf.apache.org Date: Thu, 05 Jun 2014 14:12:10 -0000 Message-Id: <984805558dae45b1a641503726b177f2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/2] git commit: Defaulting to A256GSM JWT name if Java AES name is provided 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 Authored: Thu Jun 5 15:11:33 2014 +0100 Committer: Sergey Beryozkin 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 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(); 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);