ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1043507 - in /webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security: conversation/ConversationConstants.java conversation/dkalgo/AlgoFactory.java message/token/DerivedKeyToken.java
Date Wed, 08 Dec 2010 16:40:03 GMT
Author: coheigea
Date: Wed Dec  8 16:40:02 2010
New Revision: 1043507

URL: http://svn.apache.org/viewvc?rev=1043507&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/branches/1_5_x-fixes/src/org/apache/ws/security/conversation/ConversationConstants.java
    webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security/conversation/dkalgo/AlgoFactory.java
    webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security/message/token/DerivedKeyToken.java

Modified: webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security/conversation/ConversationConstants.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security/conversation/ConversationConstants.java?rev=1043507&r1=1043506&r2=1043507&view=diff
==============================================================================
--- webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security/conversation/ConversationConstants.java
(original)
+++ webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security/conversation/ConversationConstants.java
Wed Dec  8 16:40:02 2010
@@ -163,7 +163,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/branches/1_5_x-fixes/src/org/apache/ws/security/conversation/dkalgo/AlgoFactory.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security/conversation/dkalgo/AlgoFactory.java?rev=1043507&r1=1043506&r2=1043507&view=diff
==============================================================================
--- webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security/conversation/dkalgo/AlgoFactory.java
(original)
+++ webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security/conversation/dkalgo/AlgoFactory.java
Wed Dec  8 16:40:02 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/branches/1_5_x-fixes/src/org/apache/ws/security/message/token/DerivedKeyToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security/message/token/DerivedKeyToken.java?rev=1043507&r1=1043506&r2=1043507&view=diff
==============================================================================
--- webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security/message/token/DerivedKeyToken.java
(original)
+++ webservices/wss4j/branches/1_5_x-fixes/src/org/apache/ws/security/message/token/DerivedKeyToken.java
Wed Dec  8 16:40:02 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) {
-        this.element.setAttributeNS(
-            this.ns, ConversationConstants.WSC_PREFIX + ":Algorithm", algo
-        );
+        this.element.setAttributeNS(this.ns, "Algorithm", algo);
     }
 
 }



Mime
View raw message