You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2022/06/14 07:03:10 UTC

[ws-wss4j] branch master updated (fbf412987 -> 4699e7ff8)

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/ws-wss4j.git


    from fbf412987 Finished pmd upgrade of ws-security-stax
     new 1bc3b45fb Finishing PMD migration
     new 73cb26713 Updating XML Unit to 2.9.0
     new 3b9d0e3a4 Updating Neethi to 3.2.0
     new dc611226d Updating asciidoctor-maven-plugin to 2.2.2
     new f5a4234e2 Updating cryptacular to 1.2.5
     new 4699e7ff8 Updating guava to 31.1-jre

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 parent/pom.xml                                               |  6 +++---
 pom.xml                                                      |  6 +++---
 ws-security-common/pom.xml                                   |  2 +-
 .../stax/assertionStates/KerberosTokenAssertionState.java    |  2 +-
 .../stax/assertionStates/ProtectionOrderAssertionState.java  |  4 ++--
 .../policy/stax/assertionStates/TokenAssertionState.java     | 12 ++++--------
 .../stax/assertionStates/TokenProtectionAssertionState.java  |  6 +-----
 .../stax/assertionStates/UsernameTokenAssertionState.java    |  4 ++--
 8 files changed, 17 insertions(+), 25 deletions(-)


[ws-wss4j] 03/06: Updating Neethi to 3.2.0

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ws-wss4j.git

commit 3b9d0e3a405348ade925e60eefeee6b65005bef9
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Tue Jun 14 07:54:14 2022 +0100

    Updating Neethi to 3.2.0
---
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parent/pom.xml b/parent/pom.xml
index b163dbf9b..934f3bd6e 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -42,7 +42,7 @@
         <jaxb-runtime.version>3.0.2</jaxb-runtime.version>
         <junit.version>5.8.1</junit.version>
         <kerby.version>2.0.2</kerby.version>
-        <neethi.version>3.1.1</neethi.version>
+        <neethi.version>3.2.0</neethi.version>
         <opensaml.version>4.2.0</opensaml.version>
         <slf4j.version>1.7.36</slf4j.version>
         <wsdl4j.version>1.6.3</wsdl4j.version>


[ws-wss4j] 04/06: Updating asciidoctor-maven-plugin to 2.2.2

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ws-wss4j.git

commit dc611226de558d07ad1eca6cdef653ea5cd32155
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Tue Jun 14 07:56:09 2022 +0100

    Updating asciidoctor-maven-plugin to 2.2.2
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 87ec827d2..aaf0ffff7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -313,7 +313,7 @@
                         <dependency>
                             <groupId>org.asciidoctor</groupId>
                             <artifactId>asciidoctor-maven-plugin</artifactId>
-                            <version>2.1.0</version>
+                            <version>2.2.2</version>
                         </dependency>
                     </dependencies>
                 </plugin>


[ws-wss4j] 02/06: Updating XML Unit to 2.9.0

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ws-wss4j.git

commit 73cb2671315608cd4f90edd999578d57fd240bd6
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Tue Jun 14 07:53:31 2022 +0100

    Updating XML Unit to 2.9.0
---
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parent/pom.xml b/parent/pom.xml
index f32433974..b163dbf9b 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -49,7 +49,7 @@
         <xalan.version>2.7.2</xalan.version>
         <xz.version>1.9</xz.version>
         <xmlsec.version>3.0.0</xmlsec.version>
-        <xmlunit.version>2.8.2</xmlunit.version>
+        <xmlunit.version>2.9.0</xmlunit.version>
         <!-- OSGi related properties -->
         <wss4j.osgi.import />
         <wss4j.osgi.symbolic.name>${project.groupId}.${project.artifactId}</wss4j.osgi.symbolic.name>


[ws-wss4j] 06/06: Updating guava to 31.1-jre

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ws-wss4j.git

commit 4699e7ff8124fd3e76b4e5f0f4c14829404959c0
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Tue Jun 14 07:56:50 2022 +0100

    Updating guava to 31.1-jre
---
 ws-security-common/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ws-security-common/pom.xml b/ws-security-common/pom.xml
index 346e50fb2..704fcf71d 100644
--- a/ws-security-common/pom.xml
+++ b/ws-security-common/pom.xml
@@ -163,7 +163,7 @@
         <dependency>
             <groupId>com.google.guava</groupId>
             <artifactId>guava</artifactId>
-            <version>30.1-jre</version>
+            <version>31.1-jre</version>
             <scope>compile</scope>
             <exclusions>
                 <exclusion>


[ws-wss4j] 05/06: Updating cryptacular to 1.2.5

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ws-wss4j.git

commit f5a4234e29efdc969fad2f2919d450f6a0a449a6
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Tue Jun 14 07:56:26 2022 +0100

    Updating cryptacular to 1.2.5
---
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/parent/pom.xml b/parent/pom.xml
index 934f3bd6e..fb9297621 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -34,7 +34,7 @@
     <properties>
         <bcprov.version>1.70</bcprov.version>
         <commons.compress.version>1.21</commons.compress.version>
-        <cryptacular.version>1.2.4</cryptacular.version>
+        <cryptacular.version>1.2.5</cryptacular.version>
         <ehcache.version>3.10.0</ehcache.version>
         <hamcrest.version>2.2</hamcrest.version>
         <jakarta.mail.api.version>2.1.0</jakarta.mail.api.version>


[ws-wss4j] 01/06: Finishing PMD migration

Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ws-wss4j.git

commit 1bc3b45fbf591ce4c656d3f46d2edf683b479fdf
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Tue Jun 14 07:48:07 2022 +0100

    Finishing PMD migration
---
 pom.xml                                                      |  4 ++--
 .../stax/assertionStates/KerberosTokenAssertionState.java    |  2 +-
 .../stax/assertionStates/ProtectionOrderAssertionState.java  |  4 ++--
 .../policy/stax/assertionStates/TokenAssertionState.java     | 12 ++++--------
 .../stax/assertionStates/TokenProtectionAssertionState.java  |  6 +-----
 .../stax/assertionStates/UsernameTokenAssertionState.java    |  4 ++--
 6 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/pom.xml b/pom.xml
index 2ba961416..87ec827d2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -130,7 +130,7 @@
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-pmd-plugin</artifactId>
-                <version>3.7</version>
+                <version>3.16.0</version>
                 <configuration>
                     <rulesets>
                         <ruleset>${buildtools.dir}/wss4j-pmd-ruleset.xml</ruleset>
@@ -139,7 +139,7 @@
                     <failOnViolation>true</failOnViolation>
                     <linkXRef>false</linkXRef>
                     <verbose>true</verbose>
-                    <includeTests>true</includeTests>
+                    <includeTests>false</includeTests>
                     <!-- TODO <targetJdk>${targetJdk}</targetJdk>-->
                     <targetJdk>1.8</targetJdk>
                     <excludeRoots>
diff --git a/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/KerberosTokenAssertionState.java b/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/KerberosTokenAssertionState.java
index 3a7ca1b25..1ab21c82b 100644
--- a/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/KerberosTokenAssertionState.java
+++ b/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/KerberosTokenAssertionState.java
@@ -96,7 +96,7 @@ public class KerberosTokenAssertionState extends TokenAssertionState {
             }
         }
         if (kerberosToken.getApReqTokenType() != null) {
-            switch (kerberosToken.getApReqTokenType()) {
+            switch (kerberosToken.getApReqTokenType()) {    //NOPMD
                 case WssKerberosV5ApReqToken11:
                     if (!kerberosTokenSecurityEvent.isKerberosV5ApReqToken11()) {
                         setErrorMessage("Policy enforces " + kerberosToken.getApReqTokenType());
diff --git a/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/ProtectionOrderAssertionState.java b/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/ProtectionOrderAssertionState.java
index 4688e508a..3e4a718ca 100644
--- a/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/ProtectionOrderAssertionState.java
+++ b/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/ProtectionOrderAssertionState.java
@@ -60,7 +60,7 @@ public class ProtectionOrderAssertionState extends AssertionState implements Ass
             String namespace = getAssertion().getName().getNamespaceURI();
             AbstractSymmetricAsymmetricBinding.ProtectionOrder protectionOrder =
                 ((AbstractSymmetricAsymmetricBinding) getAssertion()).getProtectionOrder();
-            switch (protectionOrder) {
+            switch (protectionOrder) {  //NOPMD
             case SignBeforeEncrypting:
                 policyAsserter.assertPolicy(new QName(namespace, SPConstants.SIGN_BEFORE_ENCRYPTING));
                 break;
@@ -131,7 +131,7 @@ public class ProtectionOrderAssertionState extends AssertionState implements Ass
                                      List<XMLSecurityConstants.ContentType> contentTypes, List<QName> elementPath) {
         String namespace = getAssertion().getName().getNamespaceURI();
 
-        switch (protectionOrder) {
+        switch (protectionOrder) {  //NOPMD
             case SignBeforeEncrypting:
                 int lastSignature = contentTypes.lastIndexOf(XMLSecurityConstants.ContentType.SIGNATURE);
                 int firstEncryption = contentTypes.indexOf(XMLSecurityConstants.ContentType.ENCRYPTION);
diff --git a/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenAssertionState.java b/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenAssertionState.java
index d1044e841..95aa96f94 100644
--- a/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenAssertionState.java
+++ b/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenAssertionState.java
@@ -246,14 +246,10 @@ public abstract class TokenAssertionState extends AssertionState implements Asse
         if (asserted) {
             setAsserted(true);
         }
-        if (!asserted && (tokenUsages.contains(WSSecurityTokenConstants.TOKENUSAGE_MAIN_SIGNATURE)
-                || tokenUsages.contains(WSSecurityTokenConstants.TOKENUSAGE_MAIN_ENCRYPTION))) {
-            //return false if not asserted for the main signature and encryption tokens
-            return false;
-        } else {
-            //always return true for supporting tokens.
-            return true;
-        }
+        //return false if not asserted for the main signature and encryption tokens
+        //always return true for supporting tokens.
+        return !(!asserted && (tokenUsages.contains(WSSecurityTokenConstants.TOKENUSAGE_MAIN_SIGNATURE)
+                || tokenUsages.contains(WSSecurityTokenConstants.TOKENUSAGE_MAIN_ENCRYPTION)));
     }
 
     public abstract boolean assertToken(TokenSecurityEvent<? extends SecurityToken> tokenSecurityEvent,
diff --git a/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenProtectionAssertionState.java b/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenProtectionAssertionState.java
index 197c6f9db..7c5598797 100644
--- a/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenProtectionAssertionState.java
+++ b/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/TokenProtectionAssertionState.java
@@ -289,11 +289,7 @@ public class TokenProtectionAssertionState extends AssertionState implements Ass
                 }
             }
         }
-        if (signedSupportingTokens.size() > signedElements.size()) {
-            return false;
-        }
-
-        return true;
+        return signedSupportingTokens.size() <= signedElements.size();
     }
 
     private SecurityToken getEffectiveSignatureToken(SecurityToken securityToken) throws XMLSecurityException {
diff --git a/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/UsernameTokenAssertionState.java b/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/UsernameTokenAssertionState.java
index ac9bc1507..9bc965445 100644
--- a/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/UsernameTokenAssertionState.java
+++ b/ws-security-policy-stax/src/main/java/org/apache/wss4j/policy/stax/assertionStates/UsernameTokenAssertionState.java
@@ -85,7 +85,7 @@ public class UsernameTokenAssertionState extends TokenAssertionState {
 
         String namespace = getAssertion().getName().getNamespaceURI();
         if (usernameToken.getPasswordType() != null) {
-            switch (usernameToken.getPasswordType()) {
+            switch (usernameToken.getPasswordType()) {  //NOPMD
                 case NoPassword:
                     if (usernameTokenSecurityEvent.getUsernameTokenPasswordType()
                         != WSSConstants.UsernameTokenPasswordType.PASSWORD_NONE) {
@@ -141,7 +141,7 @@ public class UsernameTokenAssertionState extends TokenAssertionState {
         }
 
         if (usernameToken.getUsernameTokenType() != null) {
-            switch (usernameToken.getUsernameTokenType()) {
+            switch (usernameToken.getUsernameTokenType()) { //NOPMD
                 case WssUsernameToken10:
                     if (usernameTokenSecurityEvent.getUsernameTokenProfile() != null
                         && usernameTokenSecurityEvent.getUsernameTokenProfile().equals(WSSConstants.NS_USERNAMETOKEN_PROFILE11)) {