dougm 01/12/18 20:08:54
Modified: perl-framework/Apache-Test/lib/Apache TestConfig.pm
TestSSLCA.pm
Log:
win32 fixes for ssl ca generation
replace index.txt usage with SSLCA_DB constant
Revision Changes Path
1.111 +4 -0
httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm
Index: TestConfig.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -r1.110 -r1.111
--- TestConfig.pm 2001/12/18 00:19:56 1.110
+++ TestConfig.pm 2001/12/19 04:08:54 1.111
@@ -1161,6 +1161,10 @@
sub which {
foreach (map { catfile $_, $_[0] } File::Spec->path) {
return $_ if -x;
+ if (WIN32) {
+ my $exe = "$_.exe";
+ return $exe if -x $exe;
+ }
}
}
1.3 +15 -3
httpd-test/perl-framework/Apache-Test/lib/Apache/TestSSLCA.pm
Index: TestSSLCA.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestSSLCA.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TestSSLCA.pm 2001/12/14 18:40:43 1.2
+++ TestSSLCA.pm 2001/12/19 04:08:54 1.3
@@ -5,10 +5,13 @@
use Cwd ();
use File::Path ();
+use File::Copy 'cp';
use File::Basename;
use Apache::TestConfig ();
use Apache::TestTrace;
+use constant SSLCA_DB => 'index.txt';
+
use vars qw(@EXPORT_OK &import);
@EXPORT_OK = qw(dn dn_vars dn_oneline);
@@ -131,6 +134,7 @@
return $file if -e $file;
my $dn = dn($name);
+ my $db = SSLCA_DB;
writefile($file, <<EOF);
[ req ]
@@ -159,7 +163,7 @@
certs = certs # Where the issued certs are kept
new_certs_dir = newcerts # default place for new certs.
crl_dir = crl # Where the issued crl are kept
-database = index.txt # database index file.
+database = $db # database index file.
serial = serial # The current serial number
certificate = $cacert # The CA certificate
@@ -199,7 +203,7 @@
my $digest_auth_hash = '$1$OXLyS...$Owx8s2/m9/gfkcRVXzgoE/';
sub new_ca {
- writefile('index.txt', '', 1);
+ writefile(SSLCA_DB, '', 1);
writefile('serial', "01\n", 1);
writefile('ssl.htpasswd',
@@ -251,8 +255,16 @@
my @args = (config('cacrl'), $passin);
- #revokes in the index.txt database
+ #revokes in the SSLCA_DB database
openssl ca => "-revoke certs/$name.crt", @args;
+
+ unless (-e SSLCA_DB) {
+ #hack require for win32
+ my $new = join '.', SSLCA_DB, 'new';
+ if (-e $new) {
+ cp $new, SSLCA_DB;
+ }
+ }
#generates crl from the index.txt database
openssl ca => "-gencrl -out $cacrl", @args;