cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1444874 - /cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
Date Mon, 11 Feb 2013 17:10:35 GMT
Author: coheigea
Date: Mon Feb 11 17:10:34 2013
New Revision: 1444874

URL: http://svn.apache.org/r1444874
Log:
Merged revisions 1444865 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes

........
  r1444865 | coheigea | 2013-02-11 17:01:42 +0000 (Mon, 11 Feb 2013) | 10 lines

  Merged revisions 1444862 via  git cherry-pick from
  https://svn.apache.org/repos/asf/cxf/trunk

  ........
    r1444862 | coheigea | 2013-02-11 16:58:05 +0000 (Mon, 11 Feb 2013) | 2 lines

    Simplifying Crypto configuration

  ........

........

Modified:
    cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java

Modified: cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java?rev=1444874&r1=1444873&r2=1444874&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
Mon Feb 11 17:10:34 2013
@@ -118,7 +118,7 @@ public class PolicyBasedWSS4JInIntercept
         super(true);
     }
     
-    private static Properties getProps(Object o, String propsKey, URL propsURL, SoapMessage
message) {
+    private static Properties getProps(Object o, URL propsURL, SoapMessage message) {
         Properties properties = null;
         if (o instanceof Properties) {
             properties = (Properties)o;
@@ -370,16 +370,14 @@ public class PolicyBasedWSS4JInIntercept
             encrCrypto = (Crypto)e;
         } else if (e != null) {
             URL propsURL = getPropertiesFileURL(e, message);
-            String propsKey = e.toString();
-            if (propsURL != null) {
-                propsKey = propsURL.getPath();
-            }
-            Properties props = getProps(e, propsKey, propsURL, message);
-            encrCrypto = CryptoFactory.getInstance(props);
-            
-            EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
-            synchronized (info) {
-                info.setProperty(SecurityConstants.ENCRYPT_CRYPTO, encrCrypto);
+            Properties props = getProps(e, propsURL, message);
+            if (props != null) {
+                encrCrypto = CryptoFactory.getInstance(props);
+                
+                EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
+                synchronized (info) {
+                    info.setProperty(SecurityConstants.ENCRYPT_CRYPTO, encrCrypto);
+                }
             }
         }
         return encrCrypto;
@@ -391,16 +389,14 @@ public class PolicyBasedWSS4JInIntercept
             signCrypto = (Crypto)s;
         } else if (s != null) {
             URL propsURL = getPropertiesFileURL(s, message);
-            String propsKey = s.toString();
-            if (propsURL != null) {
-                propsKey = propsURL.getPath();
-            }
-            Properties props = getProps(s, propsKey, propsURL, message);
-            signCrypto = CryptoFactory.getInstance(props);
-            
-            EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
-            synchronized (info) {
-                info.setProperty(SecurityConstants.SIGNATURE_CRYPTO, signCrypto);
+            Properties props = getProps(s, propsURL, message);
+            if (props != null) {
+                signCrypto = CryptoFactory.getInstance(props);
+                
+                EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
+                synchronized (info) {
+                    info.setProperty(SecurityConstants.SIGNATURE_CRYPTO, signCrypto);
+                }
             }
         }
         return signCrypto;



Mime
View raw message