Skip to content

Commit

Permalink
Added dependency on apache-commons-lang
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Jun 3, 2018
1 parent 3ee3c9d commit c0d9822
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 46 deletions.
1 change: 1 addition & 0 deletions .classpath
Expand Up @@ -4,5 +4,6 @@
<classpathentry kind="src" path="samples"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="/usr/share/java/slf4j/slf4j-api.jar"/>
<classpathentry kind="lib" path="/usr/share/java/apache-commons-lang.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
2 changes: 1 addition & 1 deletion build_java.pl
Expand Up @@ -162,7 +162,7 @@ sub setup_vars {
}
$jni_header_dir = "$dist_dir/private/jss/_jni";

$classpath = "-classpath /usr/share/java/slf4j/slf4j-api.jar";
$classpath = "-classpath /usr/share/java/slf4j/slf4j-api.jar:/usr/share/java/apache-commons-lang.jar";
if( $jce_jar ) {
$classpath .= ":$jce_jar";
}
Expand Down
3 changes: 3 additions & 0 deletions jss.spec.in
Expand Up @@ -41,6 +41,8 @@ BuildRequires: slf4j
%if 0%{?fedora} || 0%{?rhel} > 7
BuildRequires: slf4j-jdk14
%endif
BuildRequires: apache-commons-lang

%if 0%{?fedora} >= 25 || 0%{?rhel} > 7
BuildRequires: perl-interpreter
%endif
Expand All @@ -52,6 +54,7 @@ Requires: slf4j
%if 0%{?fedora} || 0%{?rhel} > 7
Requires: slf4j-jdk14
%endif
Requires: apache-commons-lang

%description
Java Security Services (JSS) is a java native interface which provides a bridge
Expand Down
90 changes: 45 additions & 45 deletions org/mozilla/jss/tests/all.pl
Expand Up @@ -428,25 +428,25 @@ sub print_case_result {
my $command;
my $serverCommand;

$jss_classpath = "/usr/share/java/slf4j/slf4j-api.jar:$jss_classpath";
$classpath = "/usr/share/java/slf4j/slf4j-api.jar:/usr/share/java/slf4j/slf4j-jdk14.jar:/usr/share/java/apache-commons-lang.jar:$jss_classpath";

$testname = "Setup DBs";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.SetupDBs $testdir $pwfile";
$command = "$java -cp $classpath org.mozilla.jss.tests.SetupDBs $testdir $pwfile";
run_test($testname, $command);

updateCertSN();
$testname = "Generate known RSA cert pair";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.GenerateTestCert $testdir $pwfile $certSN localhost SHA-256/RSA CA_RSA Server_RSA Client_RSA";
$command = "$java -cp $classpath org.mozilla.jss.tests.GenerateTestCert $testdir $pwfile $certSN localhost SHA-256/RSA CA_RSA Server_RSA Client_RSA";
run_test($testname, $command);

updateCertSN();
$testname = "Generate known ECDSA cert pair";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.GenerateTestCert $testdir $pwfile $certSN localhost SHA-256/EC CA_ECDSA Server_ECDSA Client_ECDSA";
$command = "$java -cp $classpath org.mozilla.jss.tests.GenerateTestCert $testdir $pwfile $certSN localhost SHA-256/EC CA_ECDSA Server_ECDSA Client_ECDSA";
run_test($testname, $command);

updateCertSN();
$testname = "Generate known DSS cert pair";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.GenerateTestCert $testdir $pwfile $certSN localhost SHA-1/DSA CA_DSS Server_DSS Client_DSS";
$command = "$java -cp $classpath org.mozilla.jss.tests.GenerateTestCert $testdir $pwfile $certSN localhost SHA-1/DSA CA_DSS Server_DSS Client_DSS";
run_test($testname, $command);

$testname = "Create PKCS11 cert to PKCS12 rsa.pfx";
Expand All @@ -462,75 +462,75 @@ sub print_case_result {
run_test($testname, $command);

#$testname = "Convert nss db to Java keystore";
#$command = "$java -cp $jss_classpath org.mozilla.jss.tests.NSS2JKS $keystore $dbPwd $configfile $dbPwd";
#$command = "$java -cp $classpath org.mozilla.jss.tests.NSS2JKS $keystore $dbPwd $configfile $dbPwd";
#run_test($testname, $command);


$testname = "List CA certs";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.ListCACerts $testdir";
$command = "$java -cp $classpath org.mozilla.jss.tests.ListCACerts $testdir";
run_test($testname, $command);

updateCertSN();
$serverPort = checkPort($serverPort);
$testname = "SSLClientAuth";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.SSLClientAuth $testdir $pwfile $serverPort $certSN";
$command = "$java -cp $classpath org.mozilla.jss.tests.SSLClientAuth $testdir $pwfile $serverPort $certSN";
run_test($testname, $command);


$testname = "Key Generation";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.TestKeyGen $testdir $pwfile";
$command = "$java -cp $classpath org.mozilla.jss.tests.TestKeyGen $testdir $pwfile";
run_test($testname, $command);

$testname = "Key Factory";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.KeyFactoryTest $testdir $pwfile";
$command = "$java -cp $classpath org.mozilla.jss.tests.KeyFactoryTest $testdir $pwfile";
run_test($testname, $command);

$testname = "Digest";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.DigestTest $testdir $pwfile";
$command = "$java -cp $classpath org.mozilla.jss.tests.DigestTest $testdir $pwfile";
run_test($testname, $command);

$testname = "HMAC ";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.HMACTest $testdir $pwfile";
$command = "$java -cp $classpath org.mozilla.jss.tests.HMACTest $testdir $pwfile";
run_test($testname, $command);

$testname = "HMAC Unwrap";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.HmacTest $testdir $pwfile";
$command = "$java -cp $classpath org.mozilla.jss.tests.HmacTest $testdir $pwfile";
run_test($testname, $command);

$testname = "KeyWrapping ";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.JCAKeyWrap $testdir $pwfile";
$command = "$java -cp $classpath org.mozilla.jss.tests.JCAKeyWrap $testdir $pwfile";
run_test($testname, $command);

$testname = "Mozilla-JSS JCA Signature ";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.JCASigTest $testdir $pwfile";
$command = "$java -cp $classpath org.mozilla.jss.tests.JCASigTest $testdir $pwfile";
run_test($testname, $command);

$testname = "Mozilla-JSS NSS Signature ";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.SigTest $testdir $pwfile";
$command = "$java -cp $classpath org.mozilla.jss.tests.SigTest $testdir $pwfile";
run_test($testname, $command);

$testname = "JSS Signature test";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.SigTest $testdir $pwfile";
$command = "$java -cp $classpath org.mozilla.jss.tests.SigTest $testdir $pwfile";
run_test($testname, $command);

$testname = "Secret Decoder Ring";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.TestSDR $testdir $pwfile";
$command = "$java -cp $classpath org.mozilla.jss.tests.TestSDR $testdir $pwfile";
run_test($testname, $command);

$testname = "List cert by certnick";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.ListCerts $testdir Server_RSA";
$command = "$java -cp $classpath org.mozilla.jss.tests.ListCerts $testdir Server_RSA";
run_test($testname, $command);

$testname = "Verify cert by certnick";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.VerifyCert $testdir $pwfile Server_RSA";
$command = "$java -cp $classpath org.mozilla.jss.tests.VerifyCert $testdir $pwfile Server_RSA";
run_test($testname, $command);

$testname = "Secret Key Generation";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.SymKeyGen $testdir";
$command = "$java -cp $classpath org.mozilla.jss.tests.SymKeyGen $testdir";
run_test($testname, $command);

$testname = "Mozilla-JSS Secret Key Generation";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.JCASymKeyGen $testdir";
$command = "$java -cp $classpath org.mozilla.jss.tests.JCASymKeyGen $testdir";
run_test($testname, $command);


Expand All @@ -542,24 +542,24 @@ sub print_case_result {

$serverPort = checkPort($serverPort);
$testname = "SSL Ciphersuite JSS Server and JSS client both";
$serverCommand = "$run_shell ./startJssSelfServ.$scriptext $jss_classpath $testdir $hostname $serverPort $java";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.JSS_SelfServClient 2 -1 $testdir $pwfile $hostname $serverPort verboseoff JSS";
$serverCommand = "$run_shell ./startJssSelfServ.$scriptext $classpath $testdir $hostname $serverPort $java";
$command = "$java -cp $classpath org.mozilla.jss.tests.JSS_SelfServClient 2 -1 $testdir $pwfile $hostname $serverPort verboseoff JSS";
# To be restored when bug 1321594 is fixed
# run_ssl_test($testname, $serverCommand, $command);


$serverPort = checkPort($serverPort);
$testname = "SSL Ciphersuite JSS Server and JSSE client";
$serverCommand = "$run_shell ./startJssSelfServ.$scriptext $jss_classpath $testdir $hostname $serverPort $java";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.JSSE_SSLClient $testdir $serverPort $hostname JSS";
$serverCommand = "$run_shell ./startJssSelfServ.$scriptext $classpath $testdir $hostname $serverPort $java";
$command = "$java -cp $classpath org.mozilla.jss.tests.JSSE_SSLClient $testdir $serverPort $hostname JSS";
# To be restored when bug 1321594 is fixed
#run_ssl_test($testname, $serverCommand, $command);


$serverPort = checkPort($serverPort);
$testname = "SSL Ciphersuite JSSE Server using default provider and JSS client";
$serverCommand = "$run_shell ./startJsseServ.$scriptext $jss_classpath $serverPort false $testdir rsa.pfx default $configfile $pwfile $java";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.JSS_SelfServClient 2 -1 $testdir $pwfile $hostname $serverPort verboseoff JSSE";
$serverCommand = "$run_shell ./startJsseServ.$scriptext $classpath $serverPort false $testdir rsa.pfx default $configfile $pwfile $java";
$command = "$java -cp $classpath org.mozilla.jss.tests.JSS_SelfServClient 2 -1 $testdir $pwfile $hostname $serverPort verboseoff JSSE";
# To be restored when bug 1321594 is fixed
#run_ssl_test($testname, $serverCommand, $command);

Expand All @@ -572,21 +572,21 @@ sub print_case_result {
#with JSS is being build with JDK 1.5 add the Sunpkcs11-NSS support back in!
#$serverPort = checkPort($serverPort);
#$testname = "SSL Ciphersuite JSSE Server using Sunpkcs11-NSS provider and JSS client";
#$serverCommand = "./startJsseServ.$scriptext $jss_classpath $serverPort false $testdir rsa.pfx Sunpkcs11 $configfile $pwfile $java";
#$command = "$java -cp $jss_classpath org.mozilla.jss.tests.JSS_SelfServClient 2 -1 $testdir $pwfile $hostname $serverPort verboseoff JSSE";
#$serverCommand = "./startJsseServ.$scriptext $classpath $serverPort false $testdir rsa.pfx Sunpkcs11 $configfile $pwfile $java";
#$command = "$java -cp $classpath org.mozilla.jss.tests.JSS_SelfServClient 2 -1 $testdir $pwfile $hostname $serverPort verboseoff JSSE";
#run_ssl_test($testname, $serverCommand, $command);

#$serverPort = checkPort($serverPort);
#$testname = "SSL Ciphersuite JSSE Server using Sunpkcs11-NSS provider and JSS client";
#$serverCommand = "./startJsseServ.$scriptext $jss_classpath $serverPort false $testdir rsa.pfx Sunpkcs11 $configfile $pwfile $java";
#$command = "$java -cp $jss_classpath org.mozilla.jss.tests.JSS_SelfServClient 2 -1 $testdir $pwfile $hostname $serverPort verboseoff JSSE";
#$serverCommand = "./startJsseServ.$scriptext $classpath $serverPort false $testdir rsa.pfx Sunpkcs11 $configfile $pwfile $java";
#$command = "$java -cp $classpath org.mozilla.jss.tests.JSS_SelfServClient 2 -1 $testdir $pwfile $hostname $serverPort verboseoff JSSE";
#run_ssl_test($testname, $serverCommand, $command);

#Mozilla-JSS only works with JDK 1.5 or higher when used as provider for SunJSSE
$serverPort = checkPort($serverPort);
$testname = "SSL Ciphersuite JSSE Server using Mozilla-JSS provider and JSS client";
$serverCommand = "$run_shell ./startJsseServ.$scriptext $jss_classpath $serverPort false $testdir rsa.pfx Mozilla-JSS $configfile $pwfile $java";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.JSS_SelfServClient 2 -1 $testdir $pwfile $hostname $serverPort verboseoff Mozilla-JSS";
$serverCommand = "$run_shell ./startJsseServ.$scriptext $classpath $serverPort false $testdir rsa.pfx Mozilla-JSS $configfile $pwfile $java";
$command = "$java -cp $classpath org.mozilla.jss.tests.JSS_SelfServClient 2 -1 $testdir $pwfile $hostname $serverPort verboseoff Mozilla-JSS";
# To be restored when bug 1321594 is fixed
#run_ssl_test($testname, $serverCommand, $command);

Expand All @@ -598,51 +598,51 @@ sub print_case_result {
#

$testname = "Enable FipsMODE";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.FipsTest $testdir enable";
$command = "$java -cp $classpath org.mozilla.jss.tests.FipsTest $testdir enable";
run_test($testname, $command);

$testname = "check FipsMODE";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.FipsTest $testdir chkfips";
$command = "$java -cp $classpath org.mozilla.jss.tests.FipsTest $testdir chkfips";
run_test($testname, $command);

updateCertSN();
$testname = "SSLClientAuth FIPSMODE";
$serverPort = checkPort(++$serverPort);
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.SSLClientAuth $testdir $pwfile $serverPort $certSN";
$command = "$java -cp $classpath org.mozilla.jss.tests.SSLClientAuth $testdir $pwfile $serverPort $certSN";
run_test($testname, $command);

$testname = "HMAC FIPSMODE";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.HMACTest $testdir $pwfile";
$command = "$java -cp $classpath org.mozilla.jss.tests.HMACTest $testdir $pwfile";
run_test($testname, $command);

$testname = "KeyWrapping FIPSMODE";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.JCAKeyWrap $testdir $pwfile";
$command = "$java -cp $classpath org.mozilla.jss.tests.JCAKeyWrap $testdir $pwfile";
run_test($testname, $command);

$testname = "Mozilla-JSS JCA Signature FIPSMODE";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.JCASigTest $testdir $pwfile";
$command = "$java -cp $classpath org.mozilla.jss.tests.JCASigTest $testdir $pwfile";
run_test($testname, $command);

$testname = "JSS Signature test FipsMODE";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.SigTest $testdir $pwfile";
$command = "$java -cp $classpath org.mozilla.jss.tests.SigTest $testdir $pwfile";
run_test($testname, $command);

$serverPort = checkPort($serverPort);
$testname = "SSL Ciphersuite FIPSMODE JSS Server and JSS client both";
$serverCommand = "$run_shell ./startJssSelfServ.$scriptext $jss_classpath $testdir $hostname $serverPort $java";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.JSS_SelfServClient 2 -1 $testdir $pwfile $hostname $serverPort verboseoff JSS";
$serverCommand = "$run_shell ./startJssSelfServ.$scriptext $classpath $testdir $hostname $serverPort $java";
$command = "$java -cp $classpath org.mozilla.jss.tests.JSS_SelfServClient 2 -1 $testdir $pwfile $hostname $serverPort verboseoff JSS";
# To be restored when bug 1321594 is fixed
#run_ssl_test($testname, $serverCommand, $command);

$testname = "Disable FipsMODE";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.FipsTest $testdir disable";
$command = "$java -cp $classpath org.mozilla.jss.tests.FipsTest $testdir disable";
run_test($testname, $command);

#
# Test for JSS jar and library revision
#
$testname = "Check JSS jar version";
$command = "$java -cp $jss_classpath org.mozilla.jss.tests.JSSPackageTest $testdir";
$command = "$java -cp $classpath org.mozilla.jss.tests.JSSPackageTest $testdir";
run_test($testname, $command);

my $LIB = "$lib_jss"."4"."$lib_suffix";
Expand Down

0 comments on commit c0d9822

Please sign in to comment.