You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2026/09/30 15:12:06 UTC
(cxf) branch 4.1.x-fixes updated (df7757f90b9 -> 1346ea667b0)
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a change to branch 4.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
from df7757f90b9 Updating WSS4J to 4.0.2 (#3527)
new f6dd9646c98 Store the whole Signature value for SignatureConfirmation (#3529)
new 1346ea667b0 Fix encrypted properties tests to work with WSS4J 4.0.2 (#3458)
The 2 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:
.../policyhandlers/AbstractBindingBuilder.java | 6 ++--
.../security/wss4j/SignatureConfirmationTest.java | 4 +--
.../apache/cxf/systest/ws/action/ActionTest.java | 39 ++++++++++++---------
.../cxf/systest/ws/fault/ModifiedRequestTest.java | 2 ++
.../apache/cxf/systest/ws/x509/X509TokenTest.java | 40 +++++++++++++---------
5 files changed, 53 insertions(+), 38 deletions(-)
(cxf) 02/02: Fix encrypted properties tests to work with WSS4J 4.0.2 (#3458)
Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch 4.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 1346ea667b074be2b9a23c52c89440d09adda5a4
Author: Colm O hEigeartaigh <co...@users.noreply.github.com>
AuthorDate: Thu Sep 10 12:20:09 2026 +0100
Fix encrypted properties tests to work with WSS4J 4.0.2 (#3458)
---
.../apache/cxf/systest/ws/action/ActionTest.java | 39 ++++++++++++---------
.../cxf/systest/ws/fault/ModifiedRequestTest.java | 2 ++
.../apache/cxf/systest/ws/x509/X509TokenTest.java | 40 +++++++++++++---------
3 files changed, 47 insertions(+), 34 deletions(-)
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java
index 5931869f640..8f1a69e4322 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/action/ActionTest.java
@@ -235,23 +235,28 @@ public class ActionTest extends AbstractBusClientServerTestBase {
return;
}
- SpringBusFactory bf = new SpringBusFactory();
- URL busFile = ActionTest.class.getResource("client.xml");
-
- Bus bus = bf.createBus(busFile.toString());
- BusFactory.setDefaultBus(bus);
- BusFactory.setThreadDefaultBus(bus);
-
- URL wsdl = ActionTest.class.getResource("DoubleItAction.wsdl");
- Service service = Service.create(wsdl, SERVICE_QNAME);
- QName portQName = new QName(NAMESPACE, "DoubleItEncryptedPasswordPort");
- DoubleItPortType port =
- service.getPort(portQName, DoubleItPortType.class);
- updateAddressPort(port, PORT);
- assertEquals(50, port.doubleIt(25));
-
- ((java.io.Closeable)port).close();
- bus.shutdown(true);
+ try {
+ System.setProperty("org.apache.wss4j.crypto.jasypt.useLegacyDefaultAlgorithm", "true");
+ SpringBusFactory bf = new SpringBusFactory();
+ URL busFile = ActionTest.class.getResource("client.xml");
+
+ Bus bus = bf.createBus(busFile.toString());
+ BusFactory.setDefaultBus(bus);
+ BusFactory.setThreadDefaultBus(bus);
+
+ URL wsdl = ActionTest.class.getResource("DoubleItAction.wsdl");
+ Service service = Service.create(wsdl, SERVICE_QNAME);
+ QName portQName = new QName(NAMESPACE, "DoubleItEncryptedPasswordPort");
+ DoubleItPortType port =
+ service.getPort(portQName, DoubleItPortType.class);
+ updateAddressPort(port, PORT);
+ assertEquals(50, port.doubleIt(25));
+
+ ((java.io.Closeable)port).close();
+ bus.shutdown(true);
+ } finally {
+ System.clearProperty("org.apache.wss4j.crypto.jasypt.useLegacyDefaultAlgorithm");
+ }
}
@org.junit.Test
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/ModifiedRequestTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/ModifiedRequestTest.java
index 8eb1d215159..4a323af39ed 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/ModifiedRequestTest.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/fault/ModifiedRequestTest.java
@@ -73,11 +73,13 @@ public class ModifiedRequestTest extends AbstractBusClientServerTestBase {
// set this to false to fork
launchServer(ModifiedRequestServer.class, true)
);
+ System.setProperty("org.apache.wss4j.crypto.jasypt.useLegacyDefaultAlgorithm", "true");
}
@org.junit.AfterClass
public static void cleanup() throws Exception {
stopAllServers();
+ System.clearProperty("org.apache.wss4j.crypto.jasypt.useLegacyDefaultAlgorithm");
}
@org.junit.Test
diff --git a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/X509TokenTest.java b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/X509TokenTest.java
index 834e9a0beae..20a7d550bac 100644
--- a/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/X509TokenTest.java
+++ b/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/x509/X509TokenTest.java
@@ -763,28 +763,34 @@ public class X509TokenTest extends AbstractBusClientServerTestBase {
return;
}
- SpringBusFactory bf = new SpringBusFactory();
- URL busFile = X509TokenTest.class.getResource("client.xml");
+ try {
+ System.setProperty("org.apache.wss4j.crypto.jasypt.useLegacyDefaultAlgorithm", "true");
- Bus bus = bf.createBus(busFile.toString());
- BusFactory.setDefaultBus(bus);
- BusFactory.setThreadDefaultBus(bus);
+ SpringBusFactory bf = new SpringBusFactory();
+ URL busFile = X509TokenTest.class.getResource("client.xml");
- URL wsdl = X509TokenTest.class.getResource("DoubleItX509.wsdl");
- Service service = Service.create(wsdl, SERVICE_QNAME);
- QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricEncryptedPasswordPort");
- DoubleItPortType x509Port =
- service.getPort(portQName, DoubleItPortType.class);
- updateAddressPort(x509Port, test.getPort());
+ Bus bus = bf.createBus(busFile.toString());
+ BusFactory.setDefaultBus(bus);
+ BusFactory.setThreadDefaultBus(bus);
- if (test.isStreaming()) {
- SecurityTestUtil.enableStreaming(x509Port);
- }
+ URL wsdl = X509TokenTest.class.getResource("DoubleItX509.wsdl");
+ Service service = Service.create(wsdl, SERVICE_QNAME);
+ QName portQName = new QName(NAMESPACE, "DoubleItAsymmetricEncryptedPasswordPort");
+ DoubleItPortType x509Port =
+ service.getPort(portQName, DoubleItPortType.class);
+ updateAddressPort(x509Port, test.getPort());
- assertEquals(50, x509Port.doubleIt(25));
+ if (test.isStreaming()) {
+ SecurityTestUtil.enableStreaming(x509Port);
+ }
- ((java.io.Closeable)x509Port).close();
- bus.shutdown(true);
+ assertEquals(50, x509Port.doubleIt(25));
+
+ ((java.io.Closeable)x509Port).close();
+ bus.shutdown(true);
+ } finally {
+ System.clearProperty("org.apache.wss4j.crypto.jasypt.useLegacyDefaultAlgorithm");
+ }
}
@org.junit.Test
(cxf) 01/02: Store the whole Signature value for SignatureConfirmation (#3529)
Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch 4.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit f6dd9646c9803173ee286ab53505b9396667f53b
Author: Colm O hEigeartaigh <co...@users.noreply.github.com>
AuthorDate: Wed Sep 30 15:20:45 2026 +0100
Store the whole Signature value for SignatureConfirmation (#3529)
(cherry picked from commit 5d3864f1c8c48088bcea8d91e020f55d5c65e971)
---
.../ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java | 6 ++++--
.../org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java | 4 ++--
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
index 59d76a1f919..923cab1db45 100644
--- a/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
+++ b/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
@@ -24,6 +24,7 @@ import java.security.cert.X509Certificate;
import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Base64;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
@@ -177,7 +178,7 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
protected Set<WSEncryptionPart> encryptedTokensList = new HashSet<>();
- protected Set<Integer> signatures = new HashSet<>();
+ protected Set<String> signatures = new HashSet<>();
protected Element bottomUpElement;
protected Element topDownElement;
@@ -2396,7 +2397,8 @@ public abstract class AbstractBindingBuilder extends AbstractCommonBindingHandle
protected void addSig(byte[] val) {
if (val != null && val.length > 0) {
- signatures.add(Arrays.hashCode(val));
+ // Store the whole value (as WSS4J's WSHandler does) rather than a collidable 32-bit hash
+ signatures.add(Base64.getEncoder().encodeToString(val));
}
}
diff --git a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java
index 8f584d9458d..c8addc3cf80 100644
--- a/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java
+++ b/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/SignatureConfirmationTest.java
@@ -83,7 +83,7 @@ public class SignatureConfirmationTest extends AbstractSecurityTest {
//
// Save the signature for future confirmation
//
- Set<Integer> sigv = CastUtils.cast((Set<?>)msg.get(WSHandlerConstants.SEND_SIGV));
+ Set<String> sigv = CastUtils.cast((Set<?>)msg.get(WSHandlerConstants.SEND_SIGV));
assertNotNull(sigv);
assertFalse(sigv.isEmpty());
@@ -116,7 +116,7 @@ public class SignatureConfirmationTest extends AbstractSecurityTest {
private void testSignatureConfirmationResponse(
- Set<Integer> sigSaved,
+ Set<String> sigSaved,
List<WSHandlerResult> sigReceived
) throws Exception {
Document doc = readDocument("wsse-request-clean.xml");