You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by di...@apache.org on 2004/03/11 14:41:30 UTC

cvs commit: ws-fx/wss4j/test/interop TestScenario4.java

dims        2004/03/11 05:41:30

  Modified:    wss4j/interop/org/apache/ws/axis/oasis Client_deploy.wsdd
                        Server_deploy.wsdd
               wss4j/interop/org/apache/ws/axis/oasis/ping deploy.wsdd
               wss4j/src/org/apache/ws/axis/security WSDoAllConstants.java
                        WSDoAllSender.java
               wss4j/src/org/apache/ws/security WSConstants.java
                        WSSecurityEngine.java
               wss4j/src/org/apache/ws/security/message WSEncryptBody.java
               wss4j/src/org/apache/ws/security/message/token
                        BinarySecurity.java
               wss4j/test/interop TestScenario4.java
  Log:
  Got Scenario 4 working against MSFT, BeTrusted and ContentGuard endpoints.
  
  Notes:
  As usual broke the local test for #4 :(
  
  Revision  Changes    Path
  1.9       +6 -5      ws-fx/wss4j/interop/org/apache/ws/axis/oasis/Client_deploy.wsdd
  
  Index: Client_deploy.wsdd
  ===================================================================
  RCS file: /home/cvs/ws-fx/wss4j/interop/org/apache/ws/axis/oasis/Client_deploy.wsdd,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Client_deploy.wsdd	10 Mar 2004 20:36:40 -0000	1.8
  +++ Client_deploy.wsdd	11 Mar 2004 13:41:30 -0000	1.9
  @@ -59,14 +59,15 @@
     <requestFlow>
      <handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
       <parameter name="action" value="Signature Encrypt"/>
  -    <parameter name="user" value="16c73ab6-b892-458f-abf5-2f875f74882e"/>
  +    <parameter name="user" value="86ab6c4828bcde6983d81b2b59ff426c_a8272f6f-2c94-436e-aa71-d8d2be4647f6"/>
       <parameter name="passwordCallbackClass" 
  -      value="org.apache.ws.axis.oasis.PWCallback"/>
  +      value="org.apache.ws.axis.oasis.PWCallback1"/>
       <parameter name="signatureKeyIdentifier" value="DirectReference" />
  -    <parameter name="signaturePropFile" value="crypto.properties" />
  +    <parameter name="signaturePropFile" value="wsstest2.properties" />
       <parameter name="encryptionKeyIdentifier" value="EmbeddedKeyName" />
       <parameter name="EmbeddedKeyCallbackClass" 
  -      value="org.apache.ws.axis.oasis.PWCallback" />
  +      value="org.apache.ws.axis.oasis.PWCallback1" />
  +    <parameter name="EmbeddedKeyName" value="SessionKey" />
      </handler>
     </requestFlow>
     <responseFlow>
  @@ -74,7 +75,7 @@
       <parameter name="passwordCallbackClass" 
         value="org.apache.ws.axis.oasis.PWCallback"/>
       <parameter name="action" value="Signature Encrypt"/>
  -    <parameter name="signaturePropFile" value="crypto.properties" />
  +    <parameter name="signaturePropFile" value="wsstest2.properties" />
      </handler>
     </responseFlow>
     
  
  
  
  1.6       +6 -6      ws-fx/wss4j/interop/org/apache/ws/axis/oasis/Server_deploy.wsdd
  
  Index: Server_deploy.wsdd
  ===================================================================
  RCS file: /home/cvs/ws-fx/wss4j/interop/org/apache/ws/axis/oasis/Server_deploy.wsdd,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Server_deploy.wsdd	11 Mar 2004 08:53:32 -0000	1.5
  +++ Server_deploy.wsdd	11 Mar 2004 13:41:30 -0000	1.6
  @@ -82,22 +82,22 @@
         <parameter name="allowedMethods" value="ping"/>
     <requestFlow>
      <handler type="java:org.apache.ws.axis.security.WSDoAllReceiver">
  -    <parameter name="passwordCallbackClass" value="org.apache.ws.axis.oasis.PWCallback"/>
  +    <parameter name="passwordCallbackClass" value="org.apache.ws.axis.oasis.PWCallback1"/>
       <parameter name="action" value="Signature Encrypt"/>
  -    <parameter name="signaturePropFile" value="crypto.properties" />
  +    <parameter name="signaturePropFile" value="wsstest2.properties" />
      </handler>
     </requestFlow>
     <responseFlow>
      <handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
       <parameter name="action" value="Signature Encrypt"/>
  -    <parameter name="user" value="16c73ab6-b892-458f-abf5-2f875f74882e"/>
  +    <parameter name="user" value="86ab6c4828bcde6983d81b2b59ff426c_a8272f6f-2c94-436e-aa71-d8d2be4647f6"/>
       <parameter name="passwordCallbackClass" 
  -      value="org.apache.ws.axis.oasis.PWCallback"/>
  +      value="org.apache.ws.axis.oasis.PWCallback1"/>
       <parameter name="signatureKeyIdentifier" value="DirectReference" />
  -    <parameter name="signaturePropFile" value="crypto.properties" />
  +    <parameter name="signaturePropFile" value="wsstest2.properties" />
       <parameter name="encryptionKeyIdentifier" value="EmbeddedKeyName" />
       <parameter name="EmbeddedKeyCallbackClass" 
  -      value="org.apache.ws.axis.oasis.PWCallback" />
  +      value="org.apache.ws.axis.oasis.PWCallback1" />
      </handler>
     </responseFlow>
     </service>
  
  
  
  1.6       +6 -6      ws-fx/wss4j/interop/org/apache/ws/axis/oasis/ping/deploy.wsdd
  
  Index: deploy.wsdd
  ===================================================================
  RCS file: /home/cvs/ws-fx/wss4j/interop/org/apache/ws/axis/oasis/ping/deploy.wsdd,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- deploy.wsdd	11 Mar 2004 08:53:32 -0000	1.5
  +++ deploy.wsdd	11 Mar 2004 13:41:30 -0000	1.6
  @@ -80,22 +80,22 @@
         <parameter name="allowedMethods" value="ping"/>
     <requestFlow>
      <handler type="java:org.apache.ws.axis.security.WSDoAllReceiver">
  -    <parameter name="passwordCallbackClass" value="org.apache.ws.axis.oasis.PWCallback"/>
  +    <parameter name="passwordCallbackClass" value="org.apache.ws.axis.oasis.PWCallback1"/>
       <parameter name="action" value="Signature Encrypt"/>
  -    <parameter name="signaturePropFile" value="crypto.properties" />
  +    <parameter name="signaturePropFile" value="wsstest2.properties" />
      </handler>
     </requestFlow>
     <responseFlow>
      <handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
       <parameter name="action" value="Signature Encrypt"/>
  -    <parameter name="user" value="16c73ab6-b892-458f-abf5-2f875f74882e"/>
  +    <parameter name="user" value="86ab6c4828bcde6983d81b2b59ff426c_a8272f6f-2c94-436e-aa71-d8d2be4647f6"/>
       <parameter name="passwordCallbackClass" 
  -      value="org.apache.ws.axis.oasis.PWCallback"/>
  +      value="org.apache.ws.axis.oasis.PWCallback1"/>
       <parameter name="signatureKeyIdentifier" value="DirectReference" />
  -    <parameter name="signaturePropFile" value="crypto.properties" />
  +    <parameter name="signaturePropFile" value="wsstest2.properties" />
       <parameter name="encryptionKeyIdentifier" value="EmbeddedKeyName" />
       <parameter name="EmbeddedKeyCallbackClass" 
  -      value="org.apache.ws.axis.oasis.PWCallback" />
  +      value="org.apache.ws.axis.oasis.PWCallback1" />
      </handler>
     </responseFlow>
     </service>
  
  
  
  1.4       +5 -0      ws-fx/wss4j/src/org/apache/ws/axis/security/WSDoAllConstants.java
  
  Index: WSDoAllConstants.java
  ===================================================================
  RCS file: /home/cvs/ws-fx/wss4j/src/org/apache/ws/axis/security/WSDoAllConstants.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- WSDoAllConstants.java	3 Mar 2004 20:44:51 -0000	1.3
  +++ WSDoAllConstants.java	11 Mar 2004 13:41:30 -0000	1.4
  @@ -301,6 +301,11 @@
   	 */
   	public static final String ENC_CALLBACK_REF = "EmbeddedKeyCallbackRef";
   
  +    /**
  +     * Text of the key name that needs to be sent
  +     */ 
  +    public static final String ENC_KEY_NAME = "EmbeddedKeyName";
  +    
   	/**
   	 * The name of the crypto propterty file to use for SOAP Signature.
   	 * <p/>
  
  
  
  1.7       +5 -0      ws-fx/wss4j/src/org/apache/ws/axis/security/WSDoAllSender.java
  
  Index: WSDoAllSender.java
  ===================================================================
  RCS file: /home/cvs/ws-fx/wss4j/src/org/apache/ws/axis/security/WSDoAllSender.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- WSDoAllSender.java	10 Mar 2004 14:23:34 -0000	1.6
  +++ WSDoAllSender.java	11 Mar 2004 13:41:30 -0000	1.7
  @@ -255,6 +255,11 @@
   						wsEncrypt.setKeyIdentifierType(encKeyId);
   					}
   					if (encKeyId == WSConstants.EMBEDDED_KEYNAME) {
  +                        String encKeyName = null;
  +                        if ((encKeyName = (String) getOption(WSDoAllConstants.ENC_KEY_NAME)) == null) {
  +                            encKeyName = (String) msgContext.getProperty(WSDoAllConstants.ENC_KEY_NAME);
  +                        }
  +                        wsEncrypt.setEmbeddedKeyName(encKeyName);
   						byte[] embeddedKey =
   							getPassword(
   								encUser,
  
  
  
  1.9       +1 -0      ws-fx/wss4j/src/org/apache/ws/security/WSConstants.java
  
  Index: WSConstants.java
  ===================================================================
  RCS file: /home/cvs/ws-fx/wss4j/src/org/apache/ws/security/WSConstants.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- WSConstants.java	10 Mar 2004 14:23:34 -0000	1.8
  +++ WSConstants.java	11 Mar 2004 13:41:30 -0000	1.9
  @@ -27,6 +27,7 @@
   public interface WSConstants {
       public static final String WSSE_NS = "http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
       public static final String USERNAMETOKEN_NS = "http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0";
  +    public static final String SOAPMESSAGE_NS = "http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0";
       public static final String X509TOKEN_NS = "http://www.docs.oasis-open.org/wss/2003/12/oasis-200401-wss-x509-token-profile-1.0";
       public static final String WSSE_PREFIX = "wsse";
       public static final String WSSE_LN = "Security";
  
  
  
  1.7       +5 -5      ws-fx/wss4j/src/org/apache/ws/security/WSSecurityEngine.java
  
  Index: WSSecurityEngine.java
  ===================================================================
  RCS file: /home/cvs/ws-fx/wss4j/src/org/apache/ws/security/WSSecurityEngine.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- WSSecurityEngine.java	10 Mar 2004 21:34:23 -0000	1.6
  +++ WSSecurityEngine.java	11 Mar 2004 13:41:30 -0000	1.7
  @@ -889,10 +889,10 @@
   
   		Document doc = elem.getOwnerDocument();
   
  -		Element tmpE = null;
  -		for (tmpE = (Element) elem.getFirstChild();
  +		Node tmpE = null;
  +		for (tmpE = elem.getFirstChild();
   			tmpE != null;
  -			tmpE = (Element) tmpE.getNextSibling()) {
  +			tmpE = tmpE.getNextSibling()) {
   			if (tmpE.getNodeType() != Node.ELEMENT_NODE) {
   				continue;
   			}
  @@ -900,10 +900,10 @@
   				continue;
   			}
   			if (tmpE.getLocalName().equals("DataReference")) {
  -				String dataRefURI = tmpE.getAttribute("URI");
  +				String dataRefURI = ((Element)tmpE).getAttribute("URI");
   				decryptDataRefEmbedded(doc, dataRefURI, cb);
   			} else if (tmpE.getLocalName().equals("KeyReference")) {
  -				String keyRefURI = tmpE.getAttribute("URI");
  +				String keyRefURI = ((Element) tmpE).getAttribute("URI");
   			}
   		}
   	}
  
  
  
  1.6       +12 -2     ws-fx/wss4j/src/org/apache/ws/security/message/WSEncryptBody.java
  
  Index: WSEncryptBody.java
  ===================================================================
  RCS file: /home/cvs/ws-fx/wss4j/src/org/apache/ws/security/message/WSEncryptBody.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- WSEncryptBody.java	10 Mar 2004 20:36:40 -0000	1.5
  +++ WSEncryptBody.java	11 Mar 2004 13:41:30 -0000	1.6
  @@ -59,7 +59,8 @@
   	protected String keyEncAlgo = WSConstants.KEYTRANSPORT_RSA15;
   	protected String encCanonAlgo = null;
   	protected byte[] embeddedKey = null;
  -
  +    protected String embeddedKeyName = null;
  +            
   	/**
   	 * Constructor.
   	 */
  @@ -124,6 +125,15 @@
   		this.user = user;
   	}
   
  +
  +    /**
  +     * Set the key name for EMBEDDED_KEYNAME
  +     * @param embeddedKeyName
  +     */ 
  +    public void setEmbeddedKeyName(String embeddedKeyName) {
  +        this.embeddedKeyName = embeddedKeyName;
  +    }
  +
   	/**
   	 * Set the name of the symmetric encryption algorithm to use
   	 * <p/>
  @@ -542,7 +552,7 @@
   				WSConstants.SIG_NS,
   				WSConstants.SIG_PREFIX);
   			WSSecurityUtil.appendChildElement(doc, keyInfo, keyName);
  -			Text keyText = doc.createTextNode(user);
  +			Text keyText = doc.createTextNode(embeddedKeyName == null ? user : embeddedKeyName);
   			keyName.appendChild(keyText);
   		}
   		/*
  
  
  
  1.3       +1 -1      ws-fx/wss4j/src/org/apache/ws/security/message/token/BinarySecurity.java
  
  Index: BinarySecurity.java
  ===================================================================
  RCS file: /home/cvs/ws-fx/wss4j/src/org/apache/ws/security/message/token/BinarySecurity.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- BinarySecurity.java	29 Feb 2004 12:30:35 -0000	1.2
  +++ BinarySecurity.java	11 Mar 2004 13:41:30 -0000	1.3
  @@ -38,7 +38,7 @@
   public class BinarySecurity {
       public static final QName TOKEN = new QName(WSConstants.WSSE_NS, "BinarySecurityToken");
       public static final QName TOKEN_KI = new QName(WSConstants.WSSE_NS, "KeyIdentifier");
  -    public static final String BASE64_ENCODING = WSConstants.WSSE_NS + "#Base64Binary";
  +    public static final String BASE64_ENCODING = WSConstants.SOAPMESSAGE_NS + "#Base64Binary";
       protected Element element = null;
   
       /**
  
  
  
  1.2       +2 -2      ws-fx/wss4j/test/interop/TestScenario4.java
  
  Index: TestScenario4.java
  ===================================================================
  RCS file: /home/cvs/ws-fx/wss4j/test/interop/TestScenario4.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestScenario4.java	13 Feb 2004 20:43:08 -0000	1.1
  +++ TestScenario4.java	11 Mar 2004 13:41:30 -0000	1.2
  @@ -55,8 +55,8 @@
        * 
        * @param args command line args
        */
  -    public static void main(String[] args) {
  -        junit.textui.TestRunner.run(suite());
  +    public static void main(String[] args) throws Exception {
  +        Scenario4.main(args);
       }
   
       public void testScenario4() throws Exception {