Repository: cxf
Updated Branches:
  refs/heads/2.6.x-fixes 295ed4bdf -> bb57761cc


More work on CXF-5572

Conflicts:
        
rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java

Conflicts:
        
rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java


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

Branch: refs/heads/2.6.x-fixes
Commit: bb57761cc744f69624fd5bd34a5656bceea298d3
Parents: 295ed4b
Author: Colm O hEigeartaigh <[email protected]>
Authored: Thu Feb 20 17:01:52 2014 +0000
Committer: Colm O hEigeartaigh <[email protected]>
Committed: Thu Feb 20 17:44:12 2014 +0000

----------------------------------------------------------------------
 .../org/apache/cxf/ws/security/cache/EHCacheManagerHolder.java | 2 +-
 .../cxf/ws/security/policy/interceptors/NegotiationUtils.java  | 6 +++++-
 .../main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java | 6 +++++-
 3 files changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/bb57761c/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/EHCacheManagerHolder.java
----------------------------------------------------------------------
diff --git 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/EHCacheManagerHolder.java
 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/EHCacheManagerHolder.java
index 7902692..2bd8410 100644
--- 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/EHCacheManagerHolder.java
+++ 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/cache/EHCacheManagerHolder.java
@@ -75,7 +75,7 @@ public final class EHCacheManagerHolder {
         CacheConfiguration cc = 
cacheManager.getConfiguration().getCacheConfigurations().get(key);
         if (cc == null && key.contains("-")) {
             cc = cacheManager.getConfiguration().getCacheConfigurations().get(
-                    key.substring(0, key.lastIndexOf('-') - 1));
+                    key.substring(0, key.lastIndexOf('-')));
         }
         if (cc == null) {
             cc = 
cacheManager.getConfiguration().getDefaultCacheConfiguration();

http://git-wip-us.apache.org/repos/asf/cxf/blob/bb57761c/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
----------------------------------------------------------------------
diff --git 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
index a096b73..5b21159 100644
--- 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
+++ 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/NegotiationUtils.java
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.ws.security.policy.interceptors;
 
+import java.math.BigInteger;
 import java.util.Collection;
 import java.util.List;
 
@@ -65,6 +66,7 @@ import 
org.apache.ws.security.conversation.ConversationException;
 import org.apache.ws.security.handler.WSHandlerConstants;
 import org.apache.ws.security.handler.WSHandlerResult;
 import org.apache.ws.security.message.token.SecurityContextToken;
+import org.apache.xml.security.utils.Base64;
 
 /**
  * This is a collection of utility methods for use in negotiation exchanges 
such as WS-SecureConversation 
@@ -111,7 +113,9 @@ public final class NegotiationUtils {
                 TokenStoreFactory tokenStoreFactory = 
TokenStoreFactory.newInstance();
                 String cacheKey = SecurityConstants.TOKEN_STORE_CACHE_INSTANCE;
                 if (info.getName() != null) {
-                    cacheKey += "-" + info.getName().toString().hashCode();
+                    int hashCode = info.getName().toString().hashCode();
+                    cacheKey +=
+                        "-" + 
Base64.encode(BigInteger.valueOf((long)hashCode));
                 }
                 tokenStore = tokenStoreFactory.newTokenStore(cacheKey, 
message);
                 info.setProperty(SecurityConstants.TOKEN_STORE_CACHE_INSTANCE, 
tokenStore);

http://git-wip-us.apache.org/repos/asf/cxf/blob/bb57761c/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java
----------------------------------------------------------------------
diff --git 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java
index daa3d8a..a0df930 100644
--- 
a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java
+++ 
b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JUtils.java
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.ws.security.wss4j;
 
+import java.math.BigInteger;
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.binding.soap.SoapMessage;
@@ -28,6 +29,7 @@ import org.apache.cxf.ws.security.cache.ReplayCacheFactory;
 import org.apache.ws.security.WSConstants;
 import org.apache.ws.security.WSSecurityException;
 import org.apache.ws.security.cache.ReplayCache;
+import org.apache.xml.security.utils.Base64;
 
 /**
  * Some common functionality that can be shared between the WSS4JInInterceptor 
and the
@@ -94,7 +96,9 @@ public final class WSS4JUtils {
                     ReplayCacheFactory replayCacheFactory = 
ReplayCacheFactory.newInstance();
                     String cacheKey = instanceKey;
                     if (info.getName() != null) {
-                        cacheKey += "-" + info.getName().toString().hashCode();
+                        int hashCode = info.getName().toString().hashCode();
+                        cacheKey +=
+                            "-" + 
Base64.encode(BigInteger.valueOf((long)hashCode));
                     }
                     replayCache = replayCacheFactory.newReplayCache(cacheKey, 
message);
                     info.setProperty(instanceKey, replayCache);

Reply via email to