ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [ws-wss4j] branch 2_2_x-fixes updated: Disabling some tests to work with the IBM JDK - namely issues with GCM
Date Fri, 14 Feb 2020 17:06:42 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/2_2_x-fixes by this push:
     new f0bc598  Disabling some tests to work with the IBM JDK - namely issues with GCM
f0bc598 is described below

commit f0bc598cf549f96c2491bf94ddee6f20ebf0df20
Author: Colm O hEigeartaigh <coheigea@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   | 28 ++++++++++++++++++++++
 .../apache/wss4j/dom/message/AttachmentTest.java   |  6 +++++
 .../wss4j/dom/message/EncryptionGCMTest.java       | 10 ++++++++
 .../org/apache/wss4j/stax/test/AttachmentTest.java |  5 ++++
 .../apache/wss4j/stax/test/EncDecryptionTest.java  | 15 ++++++++++--
 5 files changed, 62 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 e13f7c5..459f777 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
@@ -41,6 +41,8 @@ import org.apache.wss4j.common.util.Loader;
 import org.junit.Before;
 import org.junit.Test;
 
+import static org.junit.Assume.assumeFalse;
+
 /**
  * Tests the handling of {@code NameConstraint}s with {@code TrustAnchor}s in the
  * {@link Merlin}, {@link MerlinAKI}, and {@link CertificateStore} crypto implementations.
@@ -70,6 +72,8 @@ public class NameConstraintsTest extends org.junit.Assert {
 
     private static final Pattern SUBJ_PATTERN = Pattern.compile(".*OU=wss4j,O=apache");
 
+    private boolean isIBMJdK = System.getProperty("java.vendor").contains("IBM");
+
     @Before
     public void setup() throws Exception {
         WSProviderConfig.init();
@@ -116,6 +120,8 @@ public class NameConstraintsTest extends org.junit.Assert {
 
     @Test
     public void testNameConstraints() throws Exception {
+        assumeFalse(isIBMJdK);
+
         Merlin merlin = new Merlin();
         X509Certificate[] certificates = getTestCertificateChain(INTERMEDIATE_SIGNED);
 
@@ -134,6 +140,8 @@ public class NameConstraintsTest extends org.junit.Assert {
 
     @Test
     public void testNameConstraintsWithKeyStoreUsingMerlin() throws Exception {
+        assumeFalse(isIBMJdK);
+
         withKeyStoreUsingMerlin(getSelfKeyStore(),
                 getTestCertificateChain(SELF_SIGNED),
                 new Merlin());
@@ -147,6 +155,8 @@ public class NameConstraintsTest extends org.junit.Assert {
 
     @Test
     public void testNameConstraintsWithTrustStoreUsingMerlin() throws Exception {
+        assumeFalse(isIBMJdK);
+
         withTrustStoreUsingMerlin(getSelfKeyStore(),
                 getTestCertificateChain(SELF_SIGNED),
                 new Merlin());
@@ -160,6 +170,8 @@ public class NameConstraintsTest extends org.junit.Assert {
 
     @Test
     public void testNameConstraintsWithKeyStoreUsingMerlinAki() throws Exception {
+        assumeFalse(isIBMJdK);
+
         withKeyStoreUsingMerlinAKI(getSelfKeyStore(),
                 getTestCertificateChain(SELF_SIGNED),
                 new MerlinAKI());
@@ -173,6 +185,8 @@ public class NameConstraintsTest extends org.junit.Assert {
 
     @Test
     public void testNameConstraintsWithTrustStoreUsingMerlinAki() throws Exception {
+        assumeFalse(isIBMJdK);
+
         withTrustStoreUsingMerlinAKI(getSelfKeyStore(),
                 getTestCertificateChain(SELF_SIGNED),
                 new MerlinAKI());
@@ -186,6 +200,8 @@ public class NameConstraintsTest extends org.junit.Assert {
 
     @Test
     public void testNameConstraintsWithKeyStoreUsingMerlinBc() throws Exception {
+        assumeFalse(isIBMJdK);
+
         withKeyStoreUsingMerlin(getSelfKeyStore(),
                 getTestCertificateChain(SELF_SIGNED),
                 getMerlinBc());
@@ -199,6 +215,8 @@ public class NameConstraintsTest extends org.junit.Assert {
 
     @Test
     public void testNameConstraintsWithTrustStoreUsingMerlinBc() throws Exception {
+        assumeFalse(isIBMJdK);
+
         withTrustStoreUsingMerlin(getSelfKeyStore(),
                 getTestCertificateChain(SELF_SIGNED),
                 getMerlinBc());
@@ -212,6 +230,8 @@ public class NameConstraintsTest extends org.junit.Assert {
 
     @Test
     public void testNameConstraintsWithKeyStoreUsingMerlinAkiBc() throws Exception {
+        assumeFalse(isIBMJdK);
+
         withKeyStoreUsingMerlinAKI(getSelfKeyStore(),
                 getTestCertificateChain(SELF_SIGNED),
                 getMerlinAkiBc());
@@ -225,6 +245,8 @@ public class NameConstraintsTest extends org.junit.Assert {
 
     @Test
     public void testNameConstraintsWithTrustStoreUsingMerlinAkiBc() throws Exception {
+        assumeFalse(isIBMJdK);
+
         withTrustStoreUsingMerlinAKI(getSelfKeyStore(),
                 getTestCertificateChain(SELF_SIGNED),
                 getMerlinAkiBc());
@@ -238,6 +260,8 @@ public class NameConstraintsTest extends org.junit.Assert {
 
     @Test(expected = Exception.class)
     public void testNameConstraintsWithKeyStoreUsingMerlinBreaking() throws Exception {
+        assumeFalse(isIBMJdK);
+
         Properties properties = new Properties();
         properties.setProperty("org.apache.wss4j.crypto.merlin.cert.provider.nameconstraints",
                 "true");
@@ -252,6 +276,8 @@ public class NameConstraintsTest extends org.junit.Assert {
 
     @Test(expected = Exception.class)
     public void testNameConstraintsWithKeyStoreUsingMerlinAkiBreaking() throws Exception
{
+        assumeFalse(isIBMJdK);
+
         Properties properties = new Properties();
         properties.setProperty("org.apache.wss4j.crypto.merlin.cert.provider.nameconstraints",
                 "true");
@@ -266,6 +292,8 @@ public class NameConstraintsTest extends org.junit.Assert {
 
     @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 fed2f70..b4ee5b1 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
@@ -58,6 +58,8 @@ import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
 
+import static org.junit.Assume.assumeFalse;
+
 public class AttachmentTest extends Assert {
 
     private static final org.slf4j.Logger LOG =
@@ -66,6 +68,8 @@ public class AttachmentTest extends Assert {
     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();
@@ -417,6 +421,8 @@ public class AttachmentTest extends Assert {
 
     @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 8728889..27d396d 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
@@ -43,6 +43,8 @@ import org.w3c.dom.Document;
 import java.util.ArrayList;
 import java.util.List;
 
+import static org.junit.Assume.assumeFalse;
+
 /**
  * A set of test-cases for encrypting and decrypting SOAP requests using GCM. See:
  * https://issues.apache.org/jira/browse/WSS-325
@@ -60,6 +62,8 @@ public class EncryptionGCMTest extends org.junit.Assert {
     private CallbackHandler keystoreCallbackHandler = new KeystoreCallbackHandler();
     private Crypto crypto;
 
+    private boolean isIBMJdK = System.getProperty("java.vendor").contains("IBM");
+
     @org.junit.AfterClass
     public static void cleanup() throws Exception {
         SecurityTestUtil.cleanup();
@@ -81,6 +85,8 @@ public class EncryptionGCMTest extends org.junit.Assert {
 
     @Test
     public void testAES128GCM() throws Exception {
+        assumeFalse(isIBMJdK);
+
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         WSSecHeader secHeader = new WSSecHeader(doc);
         secHeader.insertSecurityHeader();
@@ -103,6 +109,8 @@ public class EncryptionGCMTest extends org.junit.Assert {
 
     @Test
     public void testAES256GCM() throws Exception {
+        assumeFalse(isIBMJdK);
+
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         WSSecHeader secHeader = new WSSecHeader(doc);
         secHeader.insertSecurityHeader();
@@ -125,6 +133,8 @@ public class EncryptionGCMTest extends org.junit.Assert {
 
     @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 67b3419..b8f0c6c 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
@@ -69,8 +69,12 @@ import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
 
+import static org.junit.Assume.assumeFalse;
+
 public class AttachmentTest extends AbstractTestBase {
 
+    private boolean isIBMJdK = System.getProperty("java.vendor").contains("IBM");
+
     public AttachmentTest() throws Exception {
     }
 
@@ -482,6 +486,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 80f4ee3..68c1a12 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
@@ -87,8 +87,12 @@ import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
+import static org.junit.Assume.assumeFalse;
+
 public class EncDecryptionTest extends AbstractTestBase {
 
+    private boolean isIBMJdK = System.getProperty("java.vendor").contains("IBM");
+
     @Test
     public void testEncDecryptionDefaultConfigurationOutbound() throws Exception {
 
@@ -1828,6 +1832,7 @@ public class EncDecryptionTest extends AbstractTestBase {
      */
     @Test
     public void testKeyWrappingRSAOAEPMGF1AESGCM128Outbound() throws Exception {
+        assumeFalse(isIBMJdK);
         try {
             Security.addProvider(new BouncyCastleProvider());
             ByteArrayOutputStream baos;
@@ -1888,7 +1893,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");
@@ -1934,6 +1939,7 @@ public class EncDecryptionTest extends AbstractTestBase {
     */
     @Test
     public void testKeyWrappingRSAOAEPAESGCM192SHA256Outbound() throws Exception {
+        assumeFalse(isIBMJdK);
         try {
             Security.addProvider(new BouncyCastleProvider());
             ByteArrayOutputStream baos;
@@ -1997,7 +2003,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");
@@ -2049,6 +2056,7 @@ public class EncDecryptionTest extends AbstractTestBase {
      */
     @Test
     public void testKeyWrappingRSAOAEPAES192GCMSHA384MGF1sha384Outbound() throws Exception
{
+        assumeFalse(isIBMJdK);
         try {
             Security.addProvider(new BouncyCastleProvider());
 
@@ -2120,6 +2128,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");
@@ -2175,6 +2184,7 @@ public class EncDecryptionTest extends AbstractTestBase {
 
     @Test
     public void testKeyWrappingRSAOAEPAESGCM192SHA384MGF1SHA384PSourceOutbound() throws Exception
{
+        assumeFalse(isIBMJdK);
         try {
             Security.addProvider(new BouncyCastleProvider());
             ByteArrayOutputStream baos;
@@ -2250,6 +2260,7 @@ public class EncDecryptionTest extends AbstractTestBase {
     @Test
     @org.junit.Ignore //WSS4J does not support OAEPParams atm
     public void testKeyWrappingRSAOAEPAESGCM192SHA384MGF1SHA384PSourceInbound() throws Exception
{
+        assumeFalse(isIBMJdK);
 
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         {


Mime
View raw message