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 0168ffa699d9497bd8f1d0c61942a0881be2eb71
Author: Colm O hEigeartaigh <cohei...@apache.org>
AuthorDate: Fri Feb 14 12:04:30 2020 +0000

    Disabling some tests to work with the IBM JDK - namely issues with GCM
---
 .../wss4j/common/crypto/NameConstraintsTest.java   | 27 ++++++++++++++++++++++
 .../apache/wss4j/dom/message/AttachmentTest.java   |  5 ++++
 .../wss4j/dom/message/EncryptionGCMTest.java       |  9 ++++++++
 .../org/apache/wss4j/stax/test/AttachmentTest.java |  4 ++++
 .../apache/wss4j/stax/test/EncDecryptionTest.java  | 14 +++++++++--
 5 files changed, 57 insertions(+), 2 deletions(-)

diff --git 
a/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/NameConstraintsTest.java
 
b/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/NameConstraintsTest.java
index 6f0b7ad..6727359 100644
--- 
a/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/NameConstraintsTest.java
+++ 
b/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/NameConstraintsTest.java
@@ -45,6 +45,7 @@ import org.junit.jupiter.api.Test;
 
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assumptions.assumeFalse;
 
 /**
  * Tests the handling of {@code NameConstraint}s with {@code TrustAnchor}s in 
the
@@ -75,6 +76,8 @@ public class NameConstraintsTest {
 
     private static final Pattern SUBJ_PATTERN = 
Pattern.compile(".*OU=wss4j,O=apache");
 
+    private boolean isIBMJdK = 
System.getProperty("java.vendor").contains("IBM");
+
     @BeforeEach
     public void setup() throws Exception {
         WSProviderConfig.init();
@@ -121,6 +124,8 @@ public class NameConstraintsTest {
 
     @Test
     public void testNameConstraints() throws Exception {
+        assumeFalse(isIBMJdK);
+
         Merlin merlin = new Merlin();
         X509Certificate[] certificates = 
getTestCertificateChain(INTERMEDIATE_SIGNED);
 
@@ -139,6 +144,8 @@ public class NameConstraintsTest {
 
     @Test
     public void testNameConstraintsWithKeyStoreUsingMerlin() throws Exception {
+        assumeFalse(isIBMJdK);
+
         withKeyStoreUsingMerlin(getSelfKeyStore(),
                 getTestCertificateChain(SELF_SIGNED),
                 new Merlin());
@@ -152,6 +159,8 @@ public class NameConstraintsTest {
 
     @Test
     public void testNameConstraintsWithTrustStoreUsingMerlin() throws 
Exception {
+        assumeFalse(isIBMJdK);
+
         withTrustStoreUsingMerlin(getSelfKeyStore(),
                 getTestCertificateChain(SELF_SIGNED),
                 new Merlin());
@@ -165,6 +174,8 @@ public class NameConstraintsTest {
 
     @Test
     public void testNameConstraintsWithKeyStoreUsingMerlinAki() throws 
Exception {
+        assumeFalse(isIBMJdK);
+
         withKeyStoreUsingMerlinAKI(getSelfKeyStore(),
                 getTestCertificateChain(SELF_SIGNED),
                 new MerlinAKI());
@@ -178,6 +189,8 @@ public class NameConstraintsTest {
 
     @Test
     public void testNameConstraintsWithTrustStoreUsingMerlinAki() throws 
Exception {
+        assumeFalse(isIBMJdK);
+
         withTrustStoreUsingMerlinAKI(getSelfKeyStore(),
                 getTestCertificateChain(SELF_SIGNED),
                 new MerlinAKI());
@@ -191,6 +204,8 @@ public class NameConstraintsTest {
 
     @Test
     public void testNameConstraintsWithKeyStoreUsingMerlinBc() throws 
Exception {
+        assumeFalse(isIBMJdK);
+
         withKeyStoreUsingMerlin(getSelfKeyStore(),
                 getTestCertificateChain(SELF_SIGNED),
                 getMerlinBc());
@@ -204,6 +219,8 @@ public class NameConstraintsTest {
 
     @Test
     public void testNameConstraintsWithTrustStoreUsingMerlinBc() throws 
Exception {
+        assumeFalse(isIBMJdK);
+
         withTrustStoreUsingMerlin(getSelfKeyStore(),
                 getTestCertificateChain(SELF_SIGNED),
                 getMerlinBc());
@@ -217,6 +234,8 @@ public class NameConstraintsTest {
 
     @Test
     public void testNameConstraintsWithKeyStoreUsingMerlinAkiBc() throws 
Exception {
+        assumeFalse(isIBMJdK);
+
         withKeyStoreUsingMerlinAKI(getSelfKeyStore(),
                 getTestCertificateChain(SELF_SIGNED),
                 getMerlinAkiBc());
@@ -230,6 +249,8 @@ public class NameConstraintsTest {
 
     @Test
     public void testNameConstraintsWithTrustStoreUsingMerlinAkiBc() throws 
Exception {
+        assumeFalse(isIBMJdK);
+
         withTrustStoreUsingMerlinAKI(getSelfKeyStore(),
                 getTestCertificateChain(SELF_SIGNED),
                 getMerlinAkiBc());
@@ -243,6 +264,8 @@ public class NameConstraintsTest {
 
     @Test
     public void testNameConstraintsWithKeyStoreUsingMerlinBreaking() throws 
Exception {
+        assumeFalse(isIBMJdK);
+
         Properties properties = new Properties();
         
properties.setProperty("org.apache.wss4j.crypto.merlin.cert.provider.nameconstraints",
                 "true");
@@ -259,6 +282,8 @@ public class NameConstraintsTest {
 
     @Test
     public void testNameConstraintsWithKeyStoreUsingMerlinAkiBreaking() throws 
Exception {
+        assumeFalse(isIBMJdK);
+
         Properties properties = new Properties();
         
properties.setProperty("org.apache.wss4j.crypto.merlin.cert.provider.nameconstraints",
                 "true");
@@ -275,6 +300,8 @@ public class NameConstraintsTest {
 
     @Test
     public void testNameConstraintsUsingCertificateStore() throws Exception {
+        assumeFalse(isIBMJdK);
+
         usingCertificateStore(getSelfKeyStore(), 
getTestCertificateChain(SELF_SIGNED));
         usingCertificateStore(getRootKeyStore(), 
getTestCertificateChain(ROOT_SIGNED));
         usingCertificateStore(getRootKeyStore(), 
getTestCertificateChain(INTERMEDIATE_SIGNED));
diff --git 
a/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentTest.java
 
b/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentTest.java
index 6e0fe1a..9077853 100644
--- 
a/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentTest.java
+++ 
b/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentTest.java
@@ -64,6 +64,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assumptions.assumeFalse;
 
 public class AttachmentTest {
 
@@ -73,6 +74,8 @@ public class AttachmentTest {
     private WSSecurityEngine secEngine = new WSSecurityEngine();
     private Crypto crypto;
 
+    private boolean isIBMJdK = 
System.getProperty("java.vendor").contains("IBM");
+
     public AttachmentTest() throws Exception {
         WSSConfig.init();
         crypto = CryptoFactory.getInstance();
@@ -426,6 +429,8 @@ public class AttachmentTest {
 
     @Test
     public void testXMLAttachmentContentEncryptionGCM() throws Exception {
+        assumeFalse(isIBMJdK);
+
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         WSSecHeader secHeader = new WSSecHeader(doc);
         secHeader.insertSecurityHeader();
diff --git 
a/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionGCMTest.java
 
b/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionGCMTest.java
index ff0ca26..c26ceb8 100644
--- 
a/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionGCMTest.java
+++ 
b/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionGCMTest.java
@@ -51,6 +51,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assumptions.assumeFalse;
 
 /**
  * A set of test-cases for encrypting and decrypting SOAP requests using GCM. 
See:
@@ -69,6 +70,8 @@ public class EncryptionGCMTest {
     private CallbackHandler keystoreCallbackHandler = new 
KeystoreCallbackHandler();
     private Crypto crypto;
 
+    private boolean isIBMJdK = 
System.getProperty("java.vendor").contains("IBM");
+
     @AfterAll
     public static void cleanup() throws Exception {
         SecurityTestUtil.cleanup();
@@ -90,6 +93,8 @@ public class EncryptionGCMTest {
 
     @Test
     public void testAES128GCM() throws Exception {
+        assumeFalse(isIBMJdK);
+
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         WSSecHeader secHeader = new WSSecHeader(doc);
         secHeader.insertSecurityHeader();
@@ -115,6 +120,8 @@ public class EncryptionGCMTest {
 
     @Test
     public void testAES256GCM() throws Exception {
+        assumeFalse(isIBMJdK);
+
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         WSSecHeader secHeader = new WSSecHeader(doc);
         secHeader.insertSecurityHeader();
@@ -140,6 +147,8 @@ public class EncryptionGCMTest {
 
     @Test
     public void testAES192GCM_RSAOAEP_SHA256_MGFSHA256() throws Exception {
+        assumeFalse(isIBMJdK);
+
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         WSSecHeader secHeader = new WSSecHeader(doc);
         secHeader.insertSecurityHeader();
diff --git 
a/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AttachmentTest.java 
b/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AttachmentTest.java
index 0aa94c2..ef64f17 100644
--- 
a/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AttachmentTest.java
+++ 
b/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AttachmentTest.java
@@ -76,9 +76,12 @@ import static org.junit.jupiter.api.Assertions.assertFalse;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assumptions.assumeFalse;
 
 public class AttachmentTest extends AbstractTestBase {
 
+    private boolean isIBMJdK = 
System.getProperty("java.vendor").contains("IBM");
+
     public AttachmentTest() throws Exception {
     }
 
@@ -490,6 +493,7 @@ public class AttachmentTest extends AbstractTestBase {
 
     @Test
     public void testXMLAttachmentContentEncryptionGCM() throws Exception {
+        assumeFalse(isIBMJdK);
 
         final String attachmentId = UUID.randomUUID().toString();
         final Attachment attachment = new Attachment();
diff --git 
a/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncDecryptionTest.java
 
b/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncDecryptionTest.java
index 2773d96..e00357f 100644
--- 
a/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncDecryptionTest.java
+++ 
b/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncDecryptionTest.java
@@ -91,9 +91,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertNotNull;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 import static org.junit.jupiter.api.Assertions.fail;
+import static org.junit.jupiter.api.Assumptions.assumeFalse;
 
 public class EncDecryptionTest extends AbstractTestBase {
 
+    private boolean isIBMJdK = 
System.getProperty("java.vendor").contains("IBM");
+
     @Test
     public void testEncDecryptionDefaultConfigurationOutbound() throws 
Exception {
 
@@ -1832,6 +1835,7 @@ public class EncDecryptionTest extends AbstractTestBase {
      */
     @Test
     public void testKeyWrappingRSAOAEPMGF1AESGCM128Outbound() throws Exception 
{
+        assumeFalse(isIBMJdK);
         try {
             Security.addProvider(new BouncyCastleProvider());
             ByteArrayOutputStream baos;
@@ -1892,7 +1896,7 @@ public class EncDecryptionTest extends AbstractTestBase {
 
     @Test
     public void testKeyWrappingRSAOAEPMGF1AESGCM128Inbound() throws Exception {
-
+        assumeFalse(isIBMJdK);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         {
             InputStream sourceDocument = 
this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
@@ -1938,6 +1942,7 @@ public class EncDecryptionTest extends AbstractTestBase {
     */
     @Test
     public void testKeyWrappingRSAOAEPAESGCM192SHA256Outbound() throws 
Exception {
+        assumeFalse(isIBMJdK);
         try {
             Security.addProvider(new BouncyCastleProvider());
             ByteArrayOutputStream baos;
@@ -2001,7 +2006,8 @@ public class EncDecryptionTest extends AbstractTestBase {
     }
 
     @Test
-    public void testKeyWrappingRSAOAEPAESGMC192SHA256Inbound() throws 
Exception {
+    public void testKeyWrappingRSAOAEPAESGCM192SHA256Inbound() throws 
Exception {
+        assumeFalse(isIBMJdK);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         {
             InputStream sourceDocument = 
this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
@@ -2053,6 +2059,7 @@ public class EncDecryptionTest extends AbstractTestBase {
      */
     @Test
     public void testKeyWrappingRSAOAEPAES192GCMSHA384MGF1sha384Outbound() 
throws Exception {
+        assumeFalse(isIBMJdK);
         try {
             Security.addProvider(new BouncyCastleProvider());
 
@@ -2124,6 +2131,7 @@ public class EncDecryptionTest extends AbstractTestBase {
     @Test
     public void testKeyWrappingRSAOAEPAES192GCMSHA384MGF1sha1Inbound() throws 
Exception {
 
+        assumeFalse(isIBMJdK);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         {
             InputStream sourceDocument = 
this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
@@ -2179,6 +2187,7 @@ public class EncDecryptionTest extends AbstractTestBase {
 
     @Test
     public void 
testKeyWrappingRSAOAEPAESGCM192SHA384MGF1SHA384PSourceOutbound() throws 
Exception {
+        assumeFalse(isIBMJdK);
         try {
             Security.addProvider(new BouncyCastleProvider());
             ByteArrayOutputStream baos;
@@ -2254,6 +2263,7 @@ public class EncDecryptionTest extends AbstractTestBase {
     @Test
     @org.junit.jupiter.api.Disabled //WSS4J does not support OAEPParams atm
     public void 
testKeyWrappingRSAOAEPAESGCM192SHA384MGF1SHA384PSourceInbound() throws 
Exception {
+        assumeFalse(isIBMJdK);
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         {

Reply via email to