cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: Setting JOSE direct algo property to 'dir' as per the spec
Date Wed, 20 Jan 2016 12:05:25 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes c560e2814 -> 409ac7e5a


Setting JOSE direct algo property to 'dir' as per the spec


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

Branch: refs/heads/3.0.x-fixes
Commit: 409ac7e5a35d4947c746be03d102a176c5024360
Parents: c560e28
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Wed Jan 20 11:50:21 2016 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Wed Jan 20 12:05:03 2016 +0000

----------------------------------------------------------------------
 .../java/org/apache/cxf/rs/security/jose/jwa/KeyAlgorithm.java  | 5 +++--
 .../main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/409ac7e5/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/KeyAlgorithm.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/KeyAlgorithm.java
b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/KeyAlgorithm.java
index 446f039..2fd0092 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/KeyAlgorithm.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwa/KeyAlgorithm.java
@@ -38,7 +38,8 @@ public enum KeyAlgorithm {
     ECDH_ES_A128KW(AlgorithmUtils.ECDH_ES_A128KW_ALGO, "AESWrap", 128),
     ECDH_ES_A192KW(AlgorithmUtils.ECDH_ES_A192KW_ALGO, "AESWrap", 192),
     ECDH_ES_A256KW(AlgorithmUtils.ECDH_ES_A256KW_ALGO, "AESWrap", 256),
-    ECDH_ES_DIRECT(AlgorithmUtils.ECDH_ES_DIRECT_ALGO, null, -1);
+    ECDH_ES_DIRECT(AlgorithmUtils.ECDH_ES_DIRECT_ALGO, null, -1),
+    DIRECT("dir", null, -1);
         
     private final String jwaName;
     private final String javaName;
@@ -75,4 +76,4 @@ public enum KeyAlgorithm {
     }
     
     
-}
\ No newline at end of file
+}

http://git-wip-us.apache.org/repos/asf/cxf/blob/409ac7e5/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
index 1da11fc..365c312 100644
--- a/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
+++ b/rt/rs/security/jose-parent/jose/src/main/java/org/apache/cxf/rs/security/jose/jwe/JweUtils.java
@@ -318,7 +318,7 @@ public final class JweUtils {
         ContentEncryptionProvider ctEncryptionProvider = null;
         if (JoseConstants.HEADER_JSON_WEB_KEY.equals(props.get(JoseConstants.RSSEC_KEY_STORE_TYPE)))
{
             JsonWebKey jwk = JwkUtils.loadJsonWebKey(m, props, KeyOperation.ENCRYPT);
-            if ("direct".equals(keyEncryptionAlgo)) {
+            if (KeyAlgorithm.DIRECT == keyAlgo) {
                 contentEncryptionAlgo = getContentEncryptionAlgo(m, props, jwk.getAlgorithm());
                 ctEncryptionProvider = getContentEncryptionAlgorithm(jwk, contentEncryptionAlgo);
             } else {
@@ -418,7 +418,7 @@ public final class JweUtils {
                     throw new JweException(JweException.Error.KEY_DECRYPTION_FAILURE);
                 }
                 
-                if ("direct".equals(keyEncryptionAlgo)) {
+                if (KeyAlgorithm.DIRECT.getJwaName().equals(keyEncryptionAlgo)) {
                     contentEncryptionAlgo = getContentEncryptionAlgo(m, props, jwk.getAlgorithm());
                     ctDecryptionKey = getContentDecryptionSecretKey(jwk, contentEncryptionAlgo);
                 } else {


Mime
View raw message