Skip to content

Commit

Permalink
[RESTEASY-3344] Workaround a permission issue with BouncyCastle.
Browse files Browse the repository at this point in the history
https://issues.redhat.com/browse/RESTEASY-3344
Signed-off-by: James R. Perkins <jperkins@redhat.com>
  • Loading branch information
jamezp committed Aug 3, 2023
1 parent 17f96fb commit 7cc626c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jboss.resteasy.test.crypto;

import java.security.SecurityPermission;
import java.util.ArrayList;
import java.util.List;

Expand All @@ -14,6 +15,7 @@
import org.jboss.logging.Logger;
import org.jboss.resteasy.security.smime.PKCS7SignatureInput;
import org.jboss.resteasy.test.crypto.resource.PKCS7SignatureSmokeResource;
import org.jboss.resteasy.utils.PermissionUtil;
import org.jboss.resteasy.utils.PortProviderUtil;
import org.jboss.resteasy.utils.TestUtil;
import org.jboss.shrinkwrap.api.Archive;
Expand Down Expand Up @@ -51,6 +53,10 @@ public static Archive<?> deploy() {
WebArchive war = TestUtil.prepareArchive(PKCS7SignatureSmokeTest.class.getSimpleName());
List<Class<?>> singletons = new ArrayList<>(1);
singletons.add(PKCS7SignatureSmokeResource.class);
// This can be removed once RESTEASY-3344 is resolved and the WildFly upgrade (WFLY-18231) is done
war.addAsManifestResource(PermissionUtil.createPermissionsXmlAsset(
new SecurityPermission("removeProviderProperty.BC"),
new SecurityPermission("putProviderProperty.BC")), "permissions.xml");
return TestUtil.finishContainerPrepare(war, null, singletons, (Class<?>[]) null);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.io.FileInputStream;
import java.lang.reflect.ReflectPermission;
import java.security.PrivateKey;
import java.security.SecurityPermission;
import java.security.cert.X509Certificate;

import jakarta.ws.rs.client.ClientBuilder;
Expand Down Expand Up @@ -81,7 +82,10 @@ public static Archive<?> deploy() throws Exception {
new RuntimePermission("getClassLoader"),
new RuntimePermission("getenv.org.apache.james.mime4j.defaultStorageProvider"),
new ReflectPermission("suppressAccessChecks"),
new RuntimePermission("accessDeclaredMembers")), "permissions.xml");
new RuntimePermission("accessDeclaredMembers"),
// These two can be removed once RESTEASY-3344 is resolved and the WildFly upgrade (WFLY-18231) is done
new SecurityPermission("removeProviderProperty.BC"),
new SecurityPermission("putProviderProperty.BC")), "permissions.xml");
return TestUtil.finishContainerPrepare(war, null, VerifyDecryptResource.class);
}

Expand Down

0 comments on commit 7cc626c

Please sign in to comment.