You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by is...@apache.org on 2019/03/23 17:21:04 UTC

[tomcat] branch master updated: Added test properties test.openssl.unimplemented to skip unimpl ciphers

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

isapir pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new a9c1a06  Added test properties test.openssl.unimplemented to skip unimpl ciphers
a9c1a06 is described below

commit a9c1a0661198d9ba37c1facd8385fe05d538c4ad
Author: Igal Sapir <is...@apache.org>
AuthorDate: Sat Mar 23 10:20:48 2019 -0700

    Added test properties test.openssl.unimplemented to skip unimpl ciphers
    
    Some distributions do not include all of the ciphers, resulting in false
    positives in unit tests. For example, the ciphers ARIA and IDEA are
    disabled in Debian. The newly added property allows to skip them by
    specifying:
    
        test.openssl.unimplemented=ARIA,IDEA
---
 build.xml                                                   |  1 +
 .../tomcat/util/net/openssl/ciphers/TesterOpenSSL.java      | 13 ++++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/build.xml b/build.xml
index 0453191..727c2fc 100644
--- a/build.xml
+++ b/build.xml
@@ -1623,6 +1623,7 @@
         <sysproperty key="tomcat.test.accesslog" value="${test.accesslog}" />
         <sysproperty key="tomcat.test.reports" value="${test.reports}" />
         <sysproperty key="tomcat.test.openssl.path" value="${test.openssl.path}" />
+        <sysproperty key="tomcat.test.openssl.unimplemented" value="${test.openssl.unimplemented}" />
         <sysproperty key="tomcat.test.relaxTiming" value="${test.relaxTiming}" />
         <sysproperty key="tomcat.test.sslImplementation" value="${test.sslImplementation}" />
         <!-- File for Cobertura to write coverage results to -->
diff --git a/test/org/apache/tomcat/util/net/openssl/ciphers/TesterOpenSSL.java b/test/org/apache/tomcat/util/net/openssl/ciphers/TesterOpenSSL.java
index fc2514d..91ac42e 100644
--- a/test/org/apache/tomcat/util/net/openssl/ciphers/TesterOpenSSL.java
+++ b/test/org/apache/tomcat/util/net/openssl/ciphers/TesterOpenSSL.java
@@ -307,6 +307,18 @@ public class TesterOpenSSL {
             unimplemented.add(Cipher.TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384);
         }
 
+        String skipCiphers = System.getProperty("tomcat.test.openssl.unimplemented", "");
+        if (!skipCiphers.isEmpty()) {
+            String[] skip = skipCiphers.split(",");
+            for (Cipher c : Cipher.values()) {
+                for (String s : skip) {
+                    if (c.toString().contains(s)) {
+                        unimplemented.add(c);
+                    }
+                }
+            }
+        }
+
         OPENSSL_UNIMPLEMENTED_CIPHERS = Collections.unmodifiableSet(unimplemented);
 
         Map<String,String> renamed = new HashMap<>();
@@ -346,7 +358,6 @@ public class TesterOpenSSL {
             result.add(cipher);
         }
         return result;
-
     }
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org