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

reta pushed a commit to branch 4.1.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 00b2d5893f4116adc0d1c62a91f34175c3f4f199
Author: Andriy Redko <[email protected]>
AuthorDate: Mon Dec 15 11:26:12 2025 -0500

    Fix JAXRSJweJwsTest::testJweRsaJwsRsaEncryptThenSign test case (#2782)
    
    (cherry picked from commit f853577e5fc5fdf1361fd097eda8ead40d5a5a77)
---
 .../security/jose/jwejws/JAXRSJweJwsTest.java      |   9 +++++---
 .../src/test/resources/keys/alice-jwejws.jks       | Bin 0 -> 4125 bytes
 .../src/test/resources/keys/bob-jwejws.jks         | Bin 0 -> 4122 bytes
 .../jaxrs/security/alice-jwejws.rs.properties      |  23 +++++++++++++++++++
 .../jaxrs/security/bob-jwejws.rs.properties        |  25 +++++++++++++++++++++
 .../systest/jaxrs/security/jose/jwejws/server.xml  |   4 ++--
 6 files changed, 56 insertions(+), 5 deletions(-)

diff --git 
a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JAXRSJweJwsTest.java
 
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JAXRSJweJwsTest.java
index 1f189977e9..7ca16379c0 100644
--- 
a/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JAXRSJweJwsTest.java
+++ 
b/systests/rs-security/src/test/java/org/apache/cxf/systest/jaxrs/security/jose/jwejws/JAXRSJweJwsTest.java
@@ -62,6 +62,10 @@ public class JAXRSJweJwsTest extends 
AbstractBusClientServerTestBase {
         "org/apache/cxf/systest/jaxrs/security/bob.rs.properties";
     private static final String SERVER_JWEJWS_PROPERTIES =
         "org/apache/cxf/systest/jaxrs/security/alice.rs.properties";
+    private static final String CLIENT_SIGN_JWEJWS_PROPERTIES =
+            "org/apache/cxf/systest/jaxrs/security/bob-jwejws.rs.properties";
+    private static final String SERVER_SIGN_JWEJWS_PROPERTIES =
+            "org/apache/cxf/systest/jaxrs/security/alice-jwejws.rs.properties";
     private static final String ENCODED_MAC_KEY = 
"AyM1SysPpbyDfgZld3umj1qzKObwVMkoqQ-EstJQLr_T-1qS0gZH75"
         + "aKtMN3Yj0iPS4hcgUuTwjAzZr1Z9CAow";
     @BeforeClass
@@ -175,7 +179,6 @@ public class JAXRSJweJwsTest extends 
AbstractBusClientServerTestBase {
     }
 
     @Test
-    @org.junit.Ignore // TODO not working since keys were upgraded for some 
reason
     public void testJweRsaJwsRsaEncryptThenSign() throws Exception {
         String address = "https://localhost:"; + PORT + "/jwejwsrsaencrsign";
 
@@ -194,8 +197,8 @@ public class JAXRSJweJwsTest extends 
AbstractBusClientServerTestBase {
         jwsWriter.setUseJwsOutputStream(true);
         providers.add(jwsWriter);
         bean.setProviders(providers);
-        bean.getProperties(true).put("rs.security.encryption.out.properties", 
SERVER_JWEJWS_PROPERTIES);
-        bean.getProperties(true).put("rs.security.signature.out.properties", 
CLIENT_JWEJWS_PROPERTIES);
+        bean.getProperties(true).put("rs.security.encryption.out.properties", 
SERVER_SIGN_JWEJWS_PROPERTIES);
+        bean.getProperties(true).put("rs.security.signature.out.properties", 
CLIENT_SIGN_JWEJWS_PROPERTIES);
         PrivateKeyPasswordProvider provider = new 
PrivateKeyPasswordProviderImpl();
         
bean.getProperties(true).put("rs.security.signature.key.password.provider", 
provider);
         BookStore bs = bean.create(BookStore.class);
diff --git a/systests/rs-security/src/test/resources/keys/alice-jwejws.jks 
b/systests/rs-security/src/test/resources/keys/alice-jwejws.jks
new file mode 100644
index 0000000000..213b26cac3
Binary files /dev/null and 
b/systests/rs-security/src/test/resources/keys/alice-jwejws.jks differ
diff --git a/systests/rs-security/src/test/resources/keys/bob-jwejws.jks 
b/systests/rs-security/src/test/resources/keys/bob-jwejws.jks
new file mode 100644
index 0000000000..55509125b4
Binary files /dev/null and 
b/systests/rs-security/src/test/resources/keys/bob-jwejws.jks differ
diff --git 
a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/alice-jwejws.rs.properties
 
b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/alice-jwejws.rs.properties
new file mode 100644
index 0000000000..58bbf085f2
--- /dev/null
+++ 
b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/alice-jwejws.rs.properties
@@ -0,0 +1,23 @@
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you 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.
+rs.security.keystore.type=jks
+rs.security.keystore.password=password
+rs.security.keystore.alias=alice
+rs.security.keystore.file=keys/alice-jwejws.jks
+rs.security.encryption.content.algorithm=A128GCM
+rs.security.encryption.key.algorithm=RSA-OAEP
+rs.security.signature.algorithm=RS256
diff --git 
a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/bob-jwejws.rs.properties
 
b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/bob-jwejws.rs.properties
new file mode 100644
index 0000000000..c1ffc53310
--- /dev/null
+++ 
b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/bob-jwejws.rs.properties
@@ -0,0 +1,25 @@
+#
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you 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.
+#
+rs.security.keystore.type=jks
+rs.security.keystore.password=password
+rs.security.keystore.alias=bob
+rs.security.keystore.file=keys/bob-jwejws.jks
+rs.security.encryption.content.algorithm=A128GCM
+rs.security.encryption.key.algorithm=RSA-OAEP
+rs.security.signature.algorithm=RS256
diff --git 
a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/jose/jwejws/server.xml
 
b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/jose/jwejws/server.xml
index 425e817776..ebf21f6244 100644
--- 
a/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/jose/jwejws/server.xml
+++ 
b/systests/rs-security/src/test/resources/org/apache/cxf/systest/jaxrs/security/jose/jwejws/server.xml
@@ -119,8 +119,8 @@ under the License.
             <ref bean="encrSignJwsInFilter"/>
         </jaxrs:providers>
         <jaxrs:properties>
-            <entry key="rs.security.encryption.in.properties" 
value="org/apache/cxf/systest/jaxrs/security/alice.rs.properties"/>
-            <entry key="rs.security.signature.in.properties" 
value="org/apache/cxf/systest/jaxrs/security/bob.rs.properties"/>
+            <entry key="rs.security.encryption.in.properties" 
value="org/apache/cxf/systest/jaxrs/security/alice-jwejws.rs.properties"/>
+            <entry key="rs.security.signature.in.properties" 
value="org/apache/cxf/systest/jaxrs/security/bob-jwejws.rs.properties"/>
             <entry key="rs.security.decryption.key.password.provider" 
value-ref="keyPasswordProvider"/>
         </jaxrs:properties>
     </jaxrs:server>

Reply via email to