Author: coheigea
Date: Fri Feb 17 17:29:40 2012
New Revision: 1245675
URL: http://svn.apache.org/viewvc?rev=1245675&view=rev
Log:
[CXF-4034][CXF-3809] - Upgrade to WSS4J 1.6.5-SNAPSHOT
- Allow SecurityConstants.SIGNATURE_CRYPTO and ENCRYPT_CRYPTO to be used on
processing side
- Tests with OpenJDK now working due to Santuario 1.5 upgrade
Modified:
cxf/branches/2.4.x-fixes/parent/pom.xml
cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
Modified: cxf/branches/2.4.x-fixes/parent/pom.xml
URL:
http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/parent/pom.xml?rev=1245675&r1=1245674&r2=1245675&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/parent/pom.xml (original)
+++ cxf/branches/2.4.x-fixes/parent/pom.xml Fri Feb 17 17:29:40 2012
@@ -98,7 +98,7 @@
<cxf.jibx.version>1.2.3</cxf.jibx.version>
<cxf.axiom.version>1.2.10</cxf.axiom.version>
<cxf.jettison.version>1.3.1</cxf.jettison.version>
- <cxf.wss4j.version>1.6.4</cxf.wss4j.version>
+ <cxf.wss4j.version>1.6.5-SNAPSHOT</cxf.wss4j.version>
<cxf.joda.time.version>1.6.2</cxf.joda.time.version>
<cxf.opensaml.version>2.5.1</cxf.opensaml.version>
<cxf.opensamlws.version>1.4.2-1</cxf.opensamlws.version>
Modified:
cxf/branches/2.4.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.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java?rev=1245675&r1=1245674&r2=1245675&view=diff
==============================================================================
---
cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
(original)
+++
cxf/branches/2.4.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
Fri Feb 17 17:29:40 2012
@@ -89,6 +89,7 @@ import org.apache.ws.security.WSConstant
import org.apache.ws.security.WSDataRef;
import org.apache.ws.security.WSSecurityEngineResult;
import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.components.crypto.Crypto;
import org.apache.ws.security.handler.RequestData;
import org.apache.ws.security.handler.WSHandlerConstants;
import org.apache.ws.security.message.token.Timestamp;
@@ -216,8 +217,15 @@ public class PolicyBasedWSS4JInIntercept
action = addToAction(action, "Signature", true);
action = addToAction(action, "Encrypt", true);
- Object s =
message.getContextualProperty(SecurityConstants.SIGNATURE_PROPERTIES);
- Object e =
message.getContextualProperty(SecurityConstants.ENCRYPT_PROPERTIES);
+ Object s =
message.getContextualProperty(SecurityConstants.SIGNATURE_CRYPTO);
+ if (s == null) {
+ s =
message.getContextualProperty(SecurityConstants.SIGNATURE_PROPERTIES);
+ }
+ Object e =
message.getContextualProperty(SecurityConstants.ENCRYPT_CRYPTO);
+ if (e == null) {
+ e =
message.getContextualProperty(SecurityConstants.ENCRYPT_PROPERTIES);
+ }
+
if (s != null) {
URL propsURL = getPropertiesFileURL(s, message);
String propsKey = s.toString();
@@ -225,7 +233,11 @@ public class PolicyBasedWSS4JInIntercept
propsKey = propsURL.getPath();
}
message.put(WSHandlerConstants.DEC_PROP_REF_ID, "RefId-" +
propsKey);
- message.put("RefId-" + propsKey, getProps(s, propsKey, propsURL,
message));
+ if (s instanceof Crypto) {
+ message.put("RefId-" + propsKey, (Crypto)s);
+ } else {
+ message.put("RefId-" + propsKey, getProps(s, propsKey,
propsURL, message));
+ }
if (e == null) {
e = s;
}
@@ -237,7 +249,11 @@ public class PolicyBasedWSS4JInIntercept
propsKey = propsURL.getPath();
}
message.put(WSHandlerConstants.SIG_PROP_REF_ID, "RefId-" +
propsKey);
- message.put("RefId-" + propsKey, getProps(e, propsKey, propsURL,
message));
+ if (e instanceof Crypto) {
+ message.put("RefId-" + propsKey, (Crypto)e);
+ } else {
+ message.put("RefId-" + propsKey, getProps(e, propsKey,
propsURL, message));
+ }
}
return action;
@@ -253,8 +269,15 @@ public class PolicyBasedWSS4JInIntercept
action = addToAction(action, "Signature", true);
action = addToAction(action, "Encrypt", true);
- Object s =
message.getContextualProperty(SecurityConstants.SIGNATURE_PROPERTIES);
- Object e =
message.getContextualProperty(SecurityConstants.ENCRYPT_PROPERTIES);
+ Object s =
message.getContextualProperty(SecurityConstants.SIGNATURE_CRYPTO);
+ if (s == null) {
+ s =
message.getContextualProperty(SecurityConstants.SIGNATURE_PROPERTIES);
+ }
+ Object e =
message.getContextualProperty(SecurityConstants.ENCRYPT_CRYPTO);
+ if (e == null) {
+ e =
message.getContextualProperty(SecurityConstants.ENCRYPT_PROPERTIES);
+ }
+
if (s != null) {
URL propsURL = getPropertiesFileURL(s, message);
String propsKey = s.toString();
@@ -262,7 +285,11 @@ public class PolicyBasedWSS4JInIntercept
propsKey = propsURL.getPath();
}
message.put(WSHandlerConstants.DEC_PROP_REF_ID, "RefId-" +
propsKey);
- message.put("RefId-" + propsKey, getProps(s, propsKey, propsURL,
message));
+ if (s instanceof Crypto) {
+ message.put("RefId-" + propsKey, (Crypto)s);
+ } else {
+ message.put("RefId-" + propsKey, getProps(s, propsKey,
propsURL, message));
+ }
if (e == null) {
e = s;
}
@@ -274,7 +301,11 @@ public class PolicyBasedWSS4JInIntercept
propsKey = propsURL.getPath();
}
message.put(WSHandlerConstants.SIG_PROP_REF_ID, "RefId-" +
propsKey);
- message.put("RefId-" + propsKey, getProps(e, propsKey, propsURL,
message));
+ if (e instanceof Crypto) {
+ message.put("RefId-" + propsKey, (Crypto)e);
+ } else {
+ message.put("RefId-" + propsKey, getProps(e, propsKey,
propsURL, message));
+ }
}
return action;
@@ -290,8 +321,15 @@ public class PolicyBasedWSS4JInIntercept
action = addToAction(action, "Signature", true);
action = addToAction(action, "Encrypt", true);
- Object s =
message.getContextualProperty(SecurityConstants.SIGNATURE_PROPERTIES);
- Object e =
message.getContextualProperty(SecurityConstants.ENCRYPT_PROPERTIES);
+ Object s =
message.getContextualProperty(SecurityConstants.SIGNATURE_CRYPTO);
+ if (s == null) {
+ s =
message.getContextualProperty(SecurityConstants.SIGNATURE_PROPERTIES);
+ }
+ Object e =
message.getContextualProperty(SecurityConstants.ENCRYPT_CRYPTO);
+ if (e == null) {
+ e =
message.getContextualProperty(SecurityConstants.ENCRYPT_PROPERTIES);
+ }
+
if (e != null && s == null) {
s = e;
} else if (s != null && e == null) {
@@ -306,7 +344,11 @@ public class PolicyBasedWSS4JInIntercept
propsKey = propsURL.getPath();
}
message.put(WSHandlerConstants.SIG_PROP_REF_ID, "RefId-" +
propsKey);
- message.put("RefId-" + propsKey, getProps(e, propsKey,
propsURL, message));
+ if (e instanceof Crypto) {
+ message.put("RefId-" + propsKey, (Crypto)e);
+ } else {
+ message.put("RefId-" + propsKey, getProps(e, propsKey,
propsURL, message));
+ }
}
if (s != null) {
URL propsURL = getPropertiesFileURL(s, message);
@@ -315,7 +357,11 @@ public class PolicyBasedWSS4JInIntercept
propsKey = propsURL.getPath();
}
message.put(WSHandlerConstants.DEC_PROP_REF_ID, "RefId-" +
propsKey);
- message.put("RefId-" + propsKey, getProps(s, propsKey,
propsURL, message));
+ if (s instanceof Crypto) {
+ message.put("RefId-" + propsKey, (Crypto)s);
+ } else {
+ message.put("RefId-" + propsKey, getProps(s, propsKey,
propsURL, message));
+ }
}
} else {
if (s != null) {
@@ -325,7 +371,11 @@ public class PolicyBasedWSS4JInIntercept
propsKey = propsURL.getPath();
}
message.put(WSHandlerConstants.SIG_PROP_REF_ID, "RefId-" +
propsKey);
- message.put("RefId-" + propsKey, getProps(s, propsKey,
propsURL, message));
+ if (s instanceof Crypto) {
+ message.put("RefId-" + propsKey, (Crypto)s);
+ } else {
+ message.put("RefId-" + propsKey, getProps(s, propsKey,
propsURL, message));
+ }
}
if (e != null) {
URL propsURL = getPropertiesFileURL(e, message);
@@ -334,7 +384,11 @@ public class PolicyBasedWSS4JInIntercept
propsKey = propsURL.getPath();
}
message.put(WSHandlerConstants.DEC_PROP_REF_ID, "RefId-" +
propsKey);
- message.put("RefId-" + propsKey, getProps(e, propsKey,
propsURL, message));
+ if (e instanceof Crypto) {
+ message.put("RefId-" + propsKey, (Crypto)e);
+ } else {
+ message.put("RefId-" + propsKey, getProps(e, propsKey,
propsURL, message));
+ }
}
}