Author: fadushin
Date: Tue Apr 29 14:31:59 2008
New Revision: 652149
URL: http://svn.apache.org/viewvc?rev=652149&view=rev
Log:
Preparation for RC2
* Version now at 1.5.4-RC2
* Removed BC Jars from repository and release
* Modified search for encrypted elements per Nandana's suggestions
* Changed organization name to "The Apache Software Foundation" in POM
Added:
webservices/wss4j/branches/1_5_4/src/org/apache/ws/security/processor/ProcessorBase.java
(with props)
Removed:
webservices/wss4j/branches/1_5_4/lib/bcprov-jdk13-132.jar
webservices/wss4j/branches/1_5_4/lib/bcprov-jdk15-132.jar
Modified:
webservices/wss4j/branches/1_5_4/README.txt
webservices/wss4j/branches/1_5_4/build.xml
webservices/wss4j/branches/1_5_4/pom.xml
webservices/wss4j/branches/1_5_4/src/org/apache/ws/security/processor/EncryptedKeyProcessor.java
webservices/wss4j/branches/1_5_4/src/org/apache/ws/security/processor/ReferenceListProcessor.java
webservices/wss4j/branches/1_5_4/test/wssec/TestWSSecurityNew2.java
Modified: webservices/wss4j/branches/1_5_4/README.txt
URL:
http://svn.apache.org/viewvc/webservices/wss4j/branches/1_5_4/README.txt?rev=652149&r1=652148&r2=652149&view=diff
==============================================================================
--- webservices/wss4j/branches/1_5_4/README.txt (original)
+++ webservices/wss4j/branches/1_5_4/README.txt Tue Apr 29 14:31:59 2008
@@ -131,10 +131,14 @@
needed by your SOAP base system, e.g. Apache Axis.
To simplify installation and operation of WSS4J an additional ZIP file
-is provided that holds all other JARs that are required by WSS4J. Please
+is provided that holds releasable JARs that are required by WSS4J. Please
note that we probably not use the very latest versions of these JARs, but
we used them during the tests.
+Note also that some required software that cannot be shipped due to
+license restrictions must be downloaded separately and manually installed.
+See the end of this section for more details.
+
To implement the Web Service Security (WSS) part specific software is
required:
@@ -155,13 +159,6 @@
deployment methods before you start with any WSS4J functions.
See: http://ws.apache.org/axis/
-
-bcprov-jdk13-132.jar
- This is the BouncyCastle library that implements all necessary
- encryption, hashing, certifcate, and keystore functions. Without
- this fanatstic library WSS4J wouldn't work at all.
-
- See: http://www.bouncycastle.org/
commons-codec-1.3.jar
commons-discovery-0.2.jar
@@ -216,3 +213,15 @@
The XML parser implementation. Required by anybody :-) .
See: http://xml.apache.org/xerces2-j/
+
+
+The following software is encumbered by U.S. patents, and therefore cannot
+be shipped with Apache software. This software must be manually downloaded and
+installed separately.
+
+bcprov-jdk13-132.jar
+ This is the BouncyCastle library that implements all necessary
+ encryption, hashing, certifcate, and keystore functions. Without
+ this fanatstic library WSS4J wouldn't work at all.
+
+ See: http://www.bouncycastle.org/
Modified: webservices/wss4j/branches/1_5_4/build.xml
URL:
http://svn.apache.org/viewvc/webservices/wss4j/branches/1_5_4/build.xml?rev=652149&r1=652148&r2=652149&view=diff
==============================================================================
--- webservices/wss4j/branches/1_5_4/build.xml (original)
+++ webservices/wss4j/branches/1_5_4/build.xml Tue Apr 29 14:31:59 2008
@@ -27,7 +27,7 @@
<property name='product.version.major' value='1'/>
<property name='product.version.minor' value='5'/>
- <property name='product.version.level' value='4-SNAPSHOT'/>
+ <property name='product.version.level' value='4-RC2'/>
<property name='product.version'
value='${product.version.major}.${product.version.minor}.${product.version.level}'/>
<property name="year" value="2008"/>
<property name="copyright" value="Copyright © ${year} Apache
WSS4J Project. All Rights Reserved."/>
@@ -69,7 +69,9 @@
<property name="build.javadoc" value="${build.doc.html}/api"/>
<property name="build.junit.xml" value="${build.doc.xml}/junit"/>
<property name="build.junit.html" value="${build.doc.html}/junit"/>
-
+
+ <property name="bc.provider.version" value="132"/>
+ <property name="bc.provider.path" value="${dir.libs}"/>
<condition property="jdk13.present">
<equals arg1="${ant.java.version}" arg2="1.3"/>
@@ -104,14 +106,19 @@
<path id="classpath.libraries" description="3rd party libs">
<fileset dir="${dir.libs}">
<include name="**/*.jar"/>
- <exclude name="**/bcprov-jdk15-*.jar" unless="jdk15.present"/>
- <exclude name="**/bcprov-jdk13-*.jar" if="jdk15.present" />
- <!-- <pathelement path="${java.class.path}"/> -->
+ <exclude name="**/bcprov-jdk15-*.jar" unless="jdk15.present"/>
+ <exclude name="**/bcprov-jdk13-*.jar" if="jdk15.present" />
+ <!-- <pathelement path="${java.class.path}"/> -->
</fileset>
<fileset dir="${dir.endorsed.libs}">
<include name="**/*.jar"/>
<!-- <pathelement path="${java.class.path}"/> -->
</fileset>
+ <fileset dir="${bc.provider.path}">
+ <include name="bcprov-jdk15-${bc.provider.version}.jar"
if="jdk15.present"/>
+ <include name="bcprov-jdk13-${bc.provider.version}.jar"
unless="jdk15.present" />
+ <!-- <pathelement path="${java.class.path}"/> -->
+ </fileset>
</path>
<path id="classpath.wss4j" description="wss4j classes; first try pure
class files, then jars">
Modified: webservices/wss4j/branches/1_5_4/pom.xml
URL:
http://svn.apache.org/viewvc/webservices/wss4j/branches/1_5_4/pom.xml?rev=652149&r1=652148&r2=652149&view=diff
==============================================================================
--- webservices/wss4j/branches/1_5_4/pom.xml (original)
+++ webservices/wss4j/branches/1_5_4/pom.xml Tue Apr 29 14:31:59 2008
@@ -7,7 +7,7 @@
<groupId>org.apache.ws.security</groupId>
<artifactId>wss4j</artifactId>
<name>WSS4J</name>
- <version>1.5.4-SNAPSHOT</version>
+ <version>1.5.4-RC2</version>
<description>
Apache WSS4J is an implementation of the Web Services Security
(WS-Security) being developed at
OASIS Web Services Security TC. WSS4J is a primarily a Java library that
can be used to sign and
@@ -97,7 +97,7 @@
<url>http://svn.apache.org/viewvc/webservices/wss4j/trunk</url>
</scm>
<organization>
- <name>Apache Software Foundation</name>
+ <name>The Apache Software Foundation</name>
<url>http://www.apache.org/</url>
</organization>
<build>
Modified:
webservices/wss4j/branches/1_5_4/src/org/apache/ws/security/processor/EncryptedKeyProcessor.java
URL:
http://svn.apache.org/viewvc/webservices/wss4j/branches/1_5_4/src/org/apache/ws/security/processor/EncryptedKeyProcessor.java?rev=652149&r1=652148&r2=652149&view=diff
==============================================================================
---
webservices/wss4j/branches/1_5_4/src/org/apache/ws/security/processor/EncryptedKeyProcessor.java
(original)
+++
webservices/wss4j/branches/1_5_4/src/org/apache/ws/security/processor/EncryptedKeyProcessor.java
Tue Apr 29 14:31:59 2008
@@ -55,7 +55,7 @@
import java.util.ArrayList;
import java.util.Vector;
-public class EncryptedKeyProcessor implements Processor {
+public class EncryptedKeyProcessor extends ProcessorBase {
private static Log log =
LogFactory.getLog(EncryptedKeyProcessor.class.getName());
private static Log tlog =
LogFactory.getLog("org.apache.ws.security.TIME");
@@ -472,77 +472,6 @@
}
return encBodyData;
}
-
- /**
- * @return a list of Nodes, representing the
- */
- private static java.util.List
- listChildren(
- final Node parent
- ) {
- if (parent == null) {
- return java.util.Collections.EMPTY_LIST;
- }
- final java.util.List ret = new java.util.ArrayList();
- if (parent.hasChildNodes()) {
- final NodeList children = parent.getChildNodes();
- if (children != null) {
- for (int i = 0, n = children.getLength(); i < n; ++i) {
- ret.add(children.item(i));
- }
- }
- }
- return ret;
- }
-
- /**
- * @return a list of Nodes in b that are not in a
- */
- private static java.util.List
- newNodes(
- final java.util.List a,
- final java.util.List b
- ) {
- if (a.size() == 0) {
- return b;
- }
- if (b.size() == 0) {
- return java.util.Collections.EMPTY_LIST;
- }
- final java.util.List ret = new java.util.ArrayList();
- for (
- final java.util.Iterator bpos = b.iterator();
- bpos.hasNext();
- ) {
- final Node bnode = (Node) bpos.next();
- final java.lang.String bns = bnode.getNamespaceURI();
- final java.lang.String bln = bnode.getLocalName();
- boolean found = false;
- for (
- final java.util.Iterator apos = a.iterator();
- apos.hasNext();
- ) {
- final Node anode = (Node) apos.next();
- final java.lang.String ans = anode.getNamespaceURI();
- final java.lang.String aln = anode.getLocalName();
- final boolean nsmatch =
- ans == null
- ? ((bns == null) ? true : false)
- : ((bns == null) ? false : ans.equals(bns));
- final boolean lnmatch =
- aln == null
- ? ((bln == null) ? true : false)
- : ((bln == null) ? false : aln.equals(bln));
- if (nsmatch && lnmatch) {
- found = true;
- }
- }
- if (!found) {
- ret.add(bnode);
- }
- }
- return ret;
- }
/**
* Get the Id of the encrypted key element.
Added:
webservices/wss4j/branches/1_5_4/src/org/apache/ws/security/processor/ProcessorBase.java
URL:
http://svn.apache.org/viewvc/webservices/wss4j/branches/1_5_4/src/org/apache/ws/security/processor/ProcessorBase.java?rev=652149&view=auto
==============================================================================
---
webservices/wss4j/branches/1_5_4/src/org/apache/ws/security/processor/ProcessorBase.java
(added)
+++
webservices/wss4j/branches/1_5_4/src/org/apache/ws/security/processor/ProcessorBase.java
Tue Apr 29 14:31:59 2008
@@ -0,0 +1,88 @@
+/*
+ * 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 org.apache.ws.security.processor;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+abstract class ProcessorBase implements Processor {
+
+
+ /**
+ * @return the list of children of the supplied parent node.
+ * This operation is guaranteed to return a non-null
+ * (though possibly empty) list.
+ */
+ protected static java.util.List
+ listChildren(
+ final Node parent
+ ) {
+ if (parent == null) {
+ return java.util.Collections.EMPTY_LIST;
+ }
+ final java.util.List ret = new java.util.ArrayList();
+ if (parent.hasChildNodes()) {
+ final NodeList children = parent.getChildNodes();
+ if (children != null) {
+ for (int i = 0, n = children.getLength(); i < n; ++i) {
+ ret.add(children.item(i));
+ }
+ }
+ }
+ return ret;
+ }
+
+ /**
+ * @return a list of Nodes in b that are not in a (b - a)
+ */
+ protected static java.util.List
+ newNodes(
+ final java.util.List a,
+ final java.util.List b
+ ) {
+ if (a.size() == 0) {
+ return b;
+ }
+ if (b.size() == 0) {
+ return java.util.Collections.EMPTY_LIST;
+ }
+ final java.util.List ret = new java.util.ArrayList();
+ for (
+ final java.util.Iterator bpos = b.iterator();
+ bpos.hasNext();
+ ) {
+ final Node bnode = (Node) bpos.next();
+ boolean found = false;
+ for (
+ final java.util.Iterator apos = a.iterator();
+ apos.hasNext();
+ ) {
+ final Node anode = (Node) apos.next();
+ if (anode == bnode) {
+ found = true;
+ }
+ }
+ if (!found) {
+ ret.add(bnode);
+ }
+ }
+ return ret;
+ }
+}
Propchange:
webservices/wss4j/branches/1_5_4/src/org/apache/ws/security/processor/ProcessorBase.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
webservices/wss4j/branches/1_5_4/src/org/apache/ws/security/processor/ProcessorBase.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Modified:
webservices/wss4j/branches/1_5_4/src/org/apache/ws/security/processor/ReferenceListProcessor.java
URL:
http://svn.apache.org/viewvc/webservices/wss4j/branches/1_5_4/src/org/apache/ws/security/processor/ReferenceListProcessor.java?rev=652149&r1=652148&r2=652149&view=diff
==============================================================================
---
webservices/wss4j/branches/1_5_4/src/org/apache/ws/security/processor/ReferenceListProcessor.java
(original)
+++
webservices/wss4j/branches/1_5_4/src/org/apache/ws/security/processor/ReferenceListProcessor.java
Tue Apr 29 14:31:59 2008
@@ -48,7 +48,7 @@
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-public class ReferenceListProcessor implements Processor {
+public class ReferenceListProcessor extends ProcessorBase {
private static Log log = LogFactory.getLog(ReferenceListProcessor.class
.getName());
@@ -328,75 +328,4 @@
}
return WSSecurityUtil.prepareSecretKey(algorithm,
decryptedData);
}
-
- /**
- * @return a list of Nodes, representing the
- */
- private static java.util.List
- listChildren(
- final Node parent
- ) {
- if (parent == null) {
- return java.util.Collections.EMPTY_LIST;
- }
- final java.util.List ret = new java.util.ArrayList();
- if (parent.hasChildNodes()) {
- final NodeList children = parent.getChildNodes();
- if (children != null) {
- for (int i = 0, n = children.getLength(); i < n; ++i)
{
- ret.add(children.item(i));
- }
- }
- }
- return ret;
- }
-
- /**
- * @return a list of Nodes in b that are not in a
- */
- private static java.util.List
- newNodes(
- final java.util.List a,
- final java.util.List b
- ) {
- if (a.size() == 0) {
- return b;
- }
- if (b.size() == 0) {
- return java.util.Collections.EMPTY_LIST;
- }
- final java.util.List ret = new java.util.ArrayList();
- for (
- final java.util.Iterator bpos = b.iterator();
- bpos.hasNext();
- ) {
- final Node bnode = (Node) bpos.next();
- final java.lang.String bns = bnode.getNamespaceURI();
- final java.lang.String bln = bnode.getLocalName();
- boolean found = false;
- for (
- final java.util.Iterator apos = a.iterator();
- apos.hasNext();
- ) {
- final Node anode = (Node) apos.next();
- final java.lang.String ans = anode.getNamespaceURI();
- final java.lang.String aln = anode.getLocalName();
- final boolean nsmatch =
- ans == null
- ? ((bns == null) ? true : false)
- : ((bns == null) ? false : ans.equals(bns));
- final boolean lnmatch =
- aln == null
- ? ((bln == null) ? true : false)
- : ((bln == null) ? false : aln.equals(bln));
- if (nsmatch && lnmatch) {
- found = true;
- }
- }
- if (!found) {
- ret.add(bnode);
- }
- }
- return ret;
- }
-}
\ No newline at end of file
+}
Modified: webservices/wss4j/branches/1_5_4/test/wssec/TestWSSecurityNew2.java
URL:
http://svn.apache.org/viewvc/webservices/wss4j/branches/1_5_4/test/wssec/TestWSSecurityNew2.java?rev=652149&r1=652148&r2=652149&view=diff
==============================================================================
--- webservices/wss4j/branches/1_5_4/test/wssec/TestWSSecurityNew2.java
(original)
+++ webservices/wss4j/branches/1_5_4/test/wssec/TestWSSecurityNew2.java Tue Apr
29 14:31:59 2008
@@ -32,6 +32,8 @@
import org.apache.ws.security.WSPasswordCallback;
import org.apache.ws.security.WSSecurityEngine;
import org.apache.ws.security.WSEncryptionPart;
+import org.apache.ws.security.WSSecurityEngineResult;
+import org.apache.ws.security.WSDataRef;
import org.apache.ws.security.components.crypto.Crypto;
import org.apache.ws.security.components.crypto.CryptoFactory;
import org.apache.ws.security.message.WSSecEncrypt;
@@ -236,10 +238,27 @@
* @throws Exception Thrown when there is a problem in verification
*/
private void verify(Document doc) throws Exception {
- secEngine.processSecurityHeader(doc, null, this, crypto);
+ final java.util.List results = secEngine.processSecurityHeader(doc,
null, this, crypto);
SOAPUtil.updateSOAPMessage(doc, message);
String decryptedString = message.getSOAPPartAsString();
assertTrue(decryptedString.indexOf("LogTestService2") > 0 ? true :
false);
+ boolean encrypted = false;
+ for (java.util.Iterator ipos = results.iterator(); ipos.hasNext();) {
+ final java.util.Map result = (java.util.Map) ipos.next();
+ final Integer action = (Integer)
result.get(WSSecurityEngineResult.TAG_ACTION);
+ assertNotNull(action);
+ if ((action.intValue() & WSConstants.ENCR) != 0) {
+ final java.util.List refs =
+ (java.util.List)
result.get(WSSecurityEngineResult.TAG_DATA_REF_URIS);
+ assertNotNull(refs);
+ encrypted = true;
+ for (java.util.Iterator jpos = refs.iterator();
jpos.hasNext();) {
+ final WSDataRef ref = (WSDataRef) jpos.next();
+ assertNotNull(ref);
+ }
+ }
+ }
+ assertTrue(encrypted);
}
public void handle(Callback[] callbacks)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]