Author: coheigea
Date: Wed Jan 20 11:50:09 2010
New Revision: 901148
URL: http://svn.apache.org/viewvc?rev=901148&view=rev
Log:
[WSS-224] - SAMLTokenSignedAction and WSSecSignatureSAML do not honor signature
algorithm or digest algorithm from WSSHandler configuration
- Applied patch to trunk.
Modified:
webservices/wss4j/trunk/src/org/apache/ws/security/action/SAMLTokenSignedAction.java
webservices/wss4j/trunk/test/wssec/TestWSSecurityNewST3.java
Modified:
webservices/wss4j/trunk/src/org/apache/ws/security/action/SAMLTokenSignedAction.java
URL:
http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/org/apache/ws/security/action/SAMLTokenSignedAction.java?rev=901148&r1=901147&r2=901148&view=diff
==============================================================================
---
webservices/wss4j/trunk/src/org/apache/ws/security/action/SAMLTokenSignedAction.java
(original)
+++
webservices/wss4j/trunk/src/org/apache/ws/security/action/SAMLTokenSignedAction.java
Wed Jan 20 11:50:09 2010
@@ -86,6 +86,12 @@
if (reqData.getSigKeyId() != 0) {
wsSign.setKeyIdentifierType(reqData.getSigKeyId());
}
+ if (reqData.getSigAlgorithm() != null) {
+ wsSign.setSignatureAlgorithm(reqData.getSigAlgorithm());
+ }
+ if (reqData.getSigDigestAlgorithm() != null) {
+ wsSign.setDigestAlgo(reqData.getSigDigestAlgorithm());
+ }
/*
* required to add support for the
Modified: webservices/wss4j/trunk/test/wssec/TestWSSecurityNewST3.java
URL:
http://svn.apache.org/viewvc/webservices/wss4j/trunk/test/wssec/TestWSSecurityNewST3.java?rev=901148&r1=901147&r2=901148&view=diff
==============================================================================
--- webservices/wss4j/trunk/test/wssec/TestWSSecurityNewST3.java (original)
+++ webservices/wss4j/trunk/test/wssec/TestWSSecurityNewST3.java Wed Jan 20
11:50:09 2010
@@ -103,6 +103,8 @@
SAMLAssertion assertion = saml.newAssertion();
WSSecSignatureSAML wsSign = new WSSecSignatureSAML();
+ wsSign.setDigestAlgo("http://www.w3.org/2001/04/xmlenc#sha256");
+
wsSign.setSignatureAlgorithm("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256");
wsSign.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
wsSign.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
@@ -117,12 +119,14 @@
Document signedDoc = wsSign.build(doc, crypto, assertion, null, null,
null, secHeader);
LOG.info("After SAMLSignedKeyHolder....");
+ String outputString =
+
org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(signedDoc);
if (LOG.isDebugEnabled()) {
LOG.debug("Signed SAML message (key holder):");
- String outputString =
-
org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(signedDoc);
LOG.debug(outputString);
}
+
assertTrue(outputString.indexOf("http://www.w3.org/2001/04/xmlenc#sha256") !=
-1);
+
assertTrue(outputString.indexOf("http://www.w3.org/2001/04/xmldsig-more#rsa-sha256")
!= -1);
List results = verify(signedDoc);
WSSecurityEngineResult actionResult =
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]