Author: coheigea
Date: Wed Dec 8 16:58:03 2010
New Revision: 1043520
URL: http://svn.apache.org/viewvc?rev=1043520&view=rev
Log:
[WSS-258] - "Newer version of SecureConversation not recognised for derived key
algorithm"
- Added support for processing the more recent URI for P_SHA1
- Fixed a bug in DerivedKeyToken where it was adding a prefix for the
"Algorithm" attribute. This attribute is not actually used by default, so it's
unlikely to affect any existing code.
Modified:
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/ConversationConstants.java
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/dkalgo/AlgoFactory.java
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/DerivedKeyToken.java
Modified:
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/ConversationConstants.java
URL:
http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/ConversationConstants.java?rev=1043520&r1=1043519&r2=1043520&view=diff
==============================================================================
---
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/ConversationConstants.java
(original)
+++
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/ConversationConstants.java
Wed Dec 8 16:58:03 2010
@@ -164,7 +164,11 @@ public class ConversationConstants {
public static final String KEY_CONTEXT_MAP = "contextMap";
public interface DerivationAlgorithm {
- public static final String P_SHA_1 =
"http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1";
+ public static final String P_SHA_1 =
+ "http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1";
+
+ public static final String P_SHA_1_2005_12 =
+
"http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512/dk/p_sha1";
}
public static String getWSCNs(int version) throws ConversationException {
Modified:
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/dkalgo/AlgoFactory.java
URL:
http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/dkalgo/AlgoFactory.java?rev=1043520&r1=1043519&r2=1043520&view=diff
==============================================================================
---
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/dkalgo/AlgoFactory.java
(original)
+++
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/conversation/dkalgo/AlgoFactory.java
Wed Dec 8 16:58:03 2010
@@ -38,7 +38,8 @@ public class AlgoFactory {
*/
public static DerivationAlgorithm getInstance(String algorithm) throws
ConversationException {
- if
(algorithm.equals(ConversationConstants.DerivationAlgorithm.P_SHA_1)) {
+ if
((ConversationConstants.DerivationAlgorithm.P_SHA_1_2005_12).equals(algorithm)
+ ||
(ConversationConstants.DerivationAlgorithm.P_SHA_1).equals(algorithm)) {
return new P_SHA1();
} else {
throw new ConversationException("No such algorithm");
Modified:
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/DerivedKeyToken.java
URL:
http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/DerivedKeyToken.java?rev=1043520&r1=1043519&r2=1043520&view=diff
==============================================================================
---
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/DerivedKeyToken.java
(original)
+++
webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/DerivedKeyToken.java
Wed Dec 8 16:58:03 2010
@@ -493,13 +493,11 @@ public class DerivedKeyToken {
/**
* Set the derivation algorithm of this derived key token.
*
- * @param algo the value for the <code>wsu:Algorithm</code> attribute of
this
+ * @param algo the value for the <code>Algorithm</code> attribute of this
* DerivedKeyToken
*/
public void setAlgorithm(String algo) {
- element.setAttributeNS(
- ns, ConversationConstants.WSC_PREFIX + ":Algorithm", algo
- );
+ element.setAttributeNS(ns, "Algorithm", algo);
}
}