summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/.cvsignore2
-rw-r--r--tools/Makefile.ssl64
-rw-r--r--tools/c_rehash.in29
3 files changed, 26 insertions, 69 deletions
diff --git a/tools/.cvsignore b/tools/.cvsignore
index af0e591579..cde7450dfc 100644
--- a/tools/.cvsignore
+++ b/tools/.cvsignore
@@ -1,2 +1,4 @@
c_rehash
c_rehash.bak
+*.flc
+semantic.cache
diff --git a/tools/Makefile.ssl b/tools/Makefile.ssl
deleted file mode 100644
index cb33d4a41e..0000000000
--- a/tools/Makefile.ssl
+++ /dev/null
@@ -1,64 +0,0 @@
-#
-# SSLeay/tools/Makefile
-#
-
-DIR= tools
-TOP= ..
-CC= cc
-INCLUDES= -I$(TOP) -I../../include
-CFLAG=-g
-INSTALL_PREFIX=
-OPENSSLDIR= /usr/local/ssl
-INSTALLTOP=/usr/local/ssl
-MAKE= make -f Makefile.ssl
-MAKEDEPPROG= makedepend
-MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
-MAKEFILE= Makefile.ssl
-
-CFLAGS= $(INCLUDES) $(CFLAG)
-
-GENERAL=Makefile.ssl
-TEST=
-APPS= c_rehash
-MISC_APPS= c_hash c_info c_issuer c_name
-
-all:
-
-install:
- @for i in $(APPS) ; \
- do \
- (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
- chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \
- mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \
- done;
- @for i in $(MISC_APPS) ; \
- do \
- (cp $$i $(INSTALL_PREFIX)$(OPENSSLDIR)/misc/$$i.new; \
- chmod 755 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc/$$i.new; \
- mv -f $(INSTALL_PREFIX)$(OPENSSLDIR)/misc/$$i.new $(INSTALL_PREFIX)$(OPENSSLDIR)/misc/$$i ); \
- done;
-
-files:
- $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
-
-links:
- @sh $(TOP)/util/point.sh Makefile.ssl Makefile
-
-lint:
-
-tags:
-
-errors:
-
-depend:
-
-dclean:
- $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
- mv -f Makefile.new $(MAKEFILE)
-
-clean:
- rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
-
-errors:
-
-# DO NOT DELETE THIS LINE -- make depend depends on it.
diff --git a/tools/c_rehash.in b/tools/c_rehash.in
index 4497cbd9f1..6dd3c24fc1 100644
--- a/tools/c_rehash.in
+++ b/tools/c_rehash.in
@@ -15,13 +15,23 @@ if(defined $ENV{OPENSSL}) {
$ENV{OPENSSL} = $openssl;
}
-$ENV{PATH} .= ":$dir/bin";
+my $pwd;
+eval "require Cwd";
+if (defined(&Cwd::getcwd)) {
+ $pwd=Cwd::getcwd();
+} else {
+ $pwd=`pwd`; chomp($pwd);
+}
+my $path_delim = ($pwd =~ /^[a-z]\:/i) ? ';' : ':'; # DOS/Win32 or Unix delimiter?
+
+$ENV{PATH} .= "$path_delim$dir/bin";
if(! -x $openssl) {
my $found = 0;
- foreach (split /:/, $ENV{PATH}) {
+ foreach (split /$path_delim/, $ENV{PATH}) {
if(-x "$_/$openssl") {
$found = 1;
+ $openssl = "$_/$openssl";
last;
}
}
@@ -34,11 +44,16 @@ if(! -x $openssl) {
if(@ARGV) {
@dirlist = @ARGV;
} elsif($ENV{SSL_CERT_DIR}) {
- @dirlist = split /:/, $ENV{SSL_CERT_DIR};
+ @dirlist = split /$path_delim/, $ENV{SSL_CERT_DIR};
} else {
$dirlist[0] = "$dir/certs";
}
+if (-d $dirlist[0]) {
+ chdir $dirlist[0];
+ $openssl="$pwd/$openssl" if (!-x $openssl);
+ chdir $pwd;
+}
foreach (@dirlist) {
if(-d $_ and -w $_) {
@@ -101,7 +116,7 @@ sub check_file {
sub link_hash_cert {
my $fname = $_[0];
$fname =~ s/'/'\\''/g;
- my ($hash, $fprint) = `"$openssl" x509 -hash -fingerprint -noout -in '$fname'`;
+ my ($hash, $fprint) = `"$openssl" x509 -hash -fingerprint -noout -in "$fname"`;
chomp $hash;
chomp $fprint;
$fprint =~ s/^.*=//;
@@ -122,7 +137,11 @@ sub link_hash_cert {
if ($symlink_exists) {
symlink $fname, $hash;
} else {
- system ("cp", $fname, $hash);
+ open IN,"<$fname" or die "can't open $fname for read";
+ open OUT,">$hash" or die "can't open $hash for write";
+ print OUT <IN>; # does the job for small text files
+ close OUT;
+ close IN;
}
$hashlist{$hash} = $fprint;
}