Author: markt
Date: Wed Jul 30 08:57:16 2014
New Revision: 1614587

URL: http://svn.apache.org/r1614587
Log:
Refactor the openssl binary location setting to correctly handle case when it 
is not set

Modified:
    tomcat/trunk/build.xml
    tomcat/trunk/test/org/apache/tomcat/util/net/jsse/openssl/TestCipher.java

Modified: tomcat/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/build.xml?rev=1614587&r1=1614586&r2=1614587&view=diff
==============================================================================
--- tomcat/trunk/build.xml (original)
+++ tomcat/trunk/build.xml Wed Jul 30 08:57:16 2014
@@ -179,6 +179,9 @@
   <available file="/dev/urandom" property="test.jvmarg.egd" 
value="-Djava.security.egd=file:/dev/./urandom"/>
   <property name="test.jvmarg.egd" value="" />
 
+  <!-- Location of OpenSSL binary -->
+  <property name="test.openssl.path" value="" />
+
   <!-- Include .gitignore in src distributions. -->
   <!-- .git and .gitignore are in defaultexcludes since Ant 1.8.2 -->
   <defaultexcludes add="**/.git" />
@@ -1370,13 +1373,11 @@
     <condition property="test.openssl.exists">
       <or>
         <and>
-          <isset property="test.openssl.path"/>
+          <length string="${test.openssl.path}" trim="true" length="0" 
when="gt"/>
           <available file="${test.openssl.path}" 
property="test.openssl.exists"/>
         </and>
         <and>
-          <not>
-            <isset property="test.openssl.path"/>
-          </not>
+          <length string="${test.openssl.path}" trim="true" length="0" 
when="eq"/>
           <available file="openssl" filepath="${env.PATH}" 
property="test.openssl.exists"/>
         </and>
       </or>

Modified: 
tomcat/trunk/test/org/apache/tomcat/util/net/jsse/openssl/TestCipher.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/util/net/jsse/openssl/TestCipher.java?rev=1614587&r1=1614586&r2=1614587&view=diff
==============================================================================
--- tomcat/trunk/test/org/apache/tomcat/util/net/jsse/openssl/TestCipher.java 
(original)
+++ tomcat/trunk/test/org/apache/tomcat/util/net/jsse/openssl/TestCipher.java 
Wed Jul 30 08:57:16 2014
@@ -26,6 +26,7 @@ import java.util.Set;
 import org.junit.Assert;
 import org.junit.Ignore;
 import org.junit.Test;
+
 import org.apache.catalina.util.IOTools;
 import org.apache.tomcat.util.http.fileupload.ByteArrayOutputStream;
 
@@ -105,7 +106,10 @@ public class TestCipher {
 
 
     private static String getOpenSSLCiphersAsExpression(String specification) 
throws Exception {
-        String openSSLPath = 
System.getProperty("tomcat.test.openssl.path","openssl");
+        String openSSLPath = System.getProperty("tomcat.test.openssl.path");
+        if (openSSLPath == null || openSSLPath.length() == 0) {
+            openSSLPath = "openssl";
+        }
         StringBuilder cmd = new StringBuilder(openSSLPath + " ciphers");
         if (specification != null) {
             cmd.append(' ');



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

Reply via email to