cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [1/3] cxf git commit: [CXF-6883] - Crypto caching issues in the WS-Security code
Date Tue, 26 Apr 2016 14:46:57 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 614e2f027 -> 82591273f


[CXF-6883] - Crypto caching issues in the WS-Security code

# Conflicts:
#	rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java


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

Branch: refs/heads/3.0.x-fixes
Commit: 4045d4f213caf550fa65b1896068c1bb948e1d77
Parents: 614e2f0
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Apr 26 14:20:31 2016 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Apr 26 15:03:05 2016 +0100

----------------------------------------------------------------------
 .../wss4j/policyhandlers/AbstractBindingBuilder.java    | 12 +++++++++++-
 .../wss4j/policyhandlers/SymmetricBindingHandler.java   |  1 -
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/4045d4f2/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
index 4d33fc7..9fd781f 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
@@ -298,7 +298,14 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
             Map<Object, Crypto> o = 
                 CastUtils.cast((Map<?, ?>)message.getContextualProperty(CRYPTO_CACHE));
             if (o == null) {
+<<<<<<< HEAD
                 o = new ConcurrentHashMap<Object, Crypto>();
+=======
+                o = CastUtils.cast((Map<?, ?>)info.getProperty(CRYPTO_CACHE));
+            }
+            if (o == null) {
+                o = new ConcurrentHashMap<>();
+>>>>>>> ea1b593... [CXF-6883] - Crypto caching issues in the WS-Security
code
                 info.setProperty(CRYPTO_CACHE, o);
             }
             return o;
@@ -1489,6 +1496,9 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
                 crypto.verifyTrust(certs, enableRevocation, null);
             }
         }
+        if (crypto != null) {
+            this.message.getExchange().put(SecurityConstants.ENCRYPT_CRYPTO, crypto);
+        }
         return crypto;
 
     }
@@ -1739,7 +1749,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
             crypto = getEncryptionCrypto();
         }
         
-        if (!endorse) {
+        if (!encryptCrypto) {
             message.getExchange().put(SecurityConstants.SIGNATURE_CRYPTO, crypto);
         }
         String user = (String)message.getContextualProperty(userNameKey);

http://git-wip-us.apache.org/repos/asf/cxf/blob/4045d4f2/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
----------------------------------------------------------------------
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
index e520d2a..69ac52f 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
@@ -537,7 +537,6 @@ public class SymmetricBindingHandler extends AbstractBindingBuilder {
                     encr.setEphemeralKey(encrTok.getSecret());
                     Crypto crypto = getEncryptionCrypto();
                     if (crypto != null) {
-                        this.message.getExchange().put(SecurityConstants.ENCRYPT_CRYPTO,
crypto);
                         setEncryptionUser(encr, encrToken, false, crypto);
                     }
                     


Mime
View raw message