Hi,
I fixed the tests that failed in secconv.components.* package
The problems were due to:
- Incorrect initialization of xml-sec
- Hardcoded namespace in org.apache.ws.security.conversation.ConversationManager
Please apply the attached patches.
ws-sc_patch_02_06_2005.txt - diff on the wss4j/src
ws-sc_tests_patch_02_06_2005.txt - diff on the wss4j/test
Thanks
Ruchith
On 6/1/05, Davanum Srinivas <[EMAIL PROTECTED]> wrote:
> Ruchith,
>
> Checked in the files...Can you please fix the test cases in
> "secconv/components/PackageTests" and send in a new patch? the tests
> are failing.
>
> thanks,
> dims
>
> On 6/1/05, Ruchith Fernando <[EMAIL PROTECTED]> wrote:
> > HI,
> >
> > I refactored the org.apache.ws.security.trust.message.token.* classes
> > of the WS-Trust impl.
> >
> > Changes:
> >
> > * RequestSecurityToken, RequestSecurityTokenResponse,
> > RequestedProofToken, RequestedSecurityToken were moved into the Trust
> > Impl. where they actually belong.
> >
> > * All the WS-Trust related security token classes extends from AbstractToken
> > Removed the unnecessary methods from these classes and added missing ones
> >
> > * Added a few missing tokens: RenewTarget, Claims
> >
> > ws-trust_patch_01_06_2005.txt - Changes to files in the wss4j/src
> > source directory
> > ws-trust_tests_patch_01_06_2005.txt - Changes to files in the
> > wss4j/test source directory
> >
> > Can someone please apply the patches. :-)
> >
> > Thanks,
> > Ruchith
> >
> >
> >
>
>
> --
> Davanum Srinivas - http://webservices.apache.org/~dims/
>
--
Ruchith Fernando
www.ruchith.org
Index: org/apache/ws/security/conversation/ConversationManager.java
===================================================================
RCS file:
/home/cvspublic/ws-fx/wss4j/src/org/apache/ws/security/conversation/ConversationManager.java,v
retrieving revision 1.10
diff -u -r1.10 ConversationManager.java
--- org/apache/ws/security/conversation/ConversationManager.java 22 Nov
2004 22:45:33 -0000 1.10
+++ org/apache/ws/security/conversation/ConversationManager.java 2 Jun
2005 05:47:30 -0000
@@ -93,7 +93,7 @@
// step 1 : Creating wsse:Reference to DerivedKeyToken
Reference ref = new Reference(WSSConfig.getDefaultWSConfig(), doc);
ref.setURI("#" + genID);
-
ref.setValueType("http://schemas.xmlsoap.org/ws/2004/04/security/sc/dk");
+ ref.setValueType(ConversationConstants.TOKEN_TYPE_DERIVED_KEY_TOKEN);
SecurityTokenReference stRef = new
SecurityTokenReference(WSSConfig.getDefaultWSConfig(), doc);
stRef.setReference(ref);
Index: secconv/components/PackageTests.java
===================================================================
RCS file:
/home/cvspublic/ws-fx/wss4j/test/secconv/components/PackageTests.java,v
retrieving revision 1.2
diff -u -r1.2 PackageTests.java
--- secconv/components/PackageTests.java 11 Aug 2004 06:03:15 -0000
1.2
+++ secconv/components/PackageTests.java 2 Jun 2005 05:46:06 -0000
@@ -15,23 +15,6 @@
*
*/
-/*
- * Copyright 2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
package secconv.components;
import junit.framework.Test;
Index: secconv/components/TestRSTR.java
===================================================================
RCS file: /home/cvspublic/ws-fx/wss4j/test/secconv/components/TestRSTR.java,v
retrieving revision 1.5
diff -u -r1.5 TestRSTR.java
--- secconv/components/TestRSTR.java 1 Jun 2005 10:54:50 -0000 1.5
+++ secconv/components/TestRSTR.java 2 Jun 2005 05:46:07 -0000
@@ -52,9 +52,11 @@
import org.apache.ws.security.conversation.message.info.SecurityContextInfo;
import org.apache.ws.security.conversation.message.token.SecurityContextToken;
import org.apache.ws.security.handler.WSHandlerConstants;
+import org.apache.ws.security.transform.STRTransform;
import org.apache.ws.security.trust.message.token.RequestSecurityTokenResponse;
import org.apache.ws.security.trust.message.token.RequestedProofToken;
import org.apache.ws.security.util.WSSecurityUtil;
+import org.apache.xml.security.transforms.Transform;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -86,7 +88,19 @@
Crypto crypto = CryptoFactory.getInstance();
static{
- org.apache.xml.security.Init.init();
+ org.apache.xml.security.Init.init();
+ String Id = "BC";
+ if (java.security.Security.getProvider(Id) == null) {
+ log.debug("The provider " + Id
+ + " had to be added to the java.security.Security");
+ java.security.Security.addProvider(new
org.bouncycastle.jce.provider.BouncyCastleProvider());
+ }
+ Transform.init();
+ try {
+ Transform.register(STRTransform.implementedTransformURI,
+ "org.apache.ws.security.transform.STRTransform");
+ } catch (Exception ex) {
+ }
}
//sharedSecret = "SriLankaSriLankaSriLanka".getBytes();