aboutsummaryrefslogtreecommitdiff
path: root/deps/openssl/openssl/tools
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2012-04-10 15:57:21 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2012-04-12 01:34:05 +0200
commit30e7fb7307011a3c8d2586d73817ec967a863647 (patch)
tree8d51607ed56bc08fe4222fae6e2cd02bc81d871d /deps/openssl/openssl/tools
parentaa5961a445acbd2b533ef870eb19733be7b7ede5 (diff)
downloadandroid-node-v8-30e7fb7307011a3c8d2586d73817ec967a863647.tar.gz
android-node-v8-30e7fb7307011a3c8d2586d73817ec967a863647.tar.bz2
android-node-v8-30e7fb7307011a3c8d2586d73817ec967a863647.zip
deps: upgrade openssl to 1.0.0f
Diffstat (limited to 'deps/openssl/openssl/tools')
-rw-r--r--deps/openssl/openssl/tools/Makefile1
-rw-r--r--deps/openssl/openssl/tools/c_rehash29
-rw-r--r--deps/openssl/openssl/tools/c_rehash.in29
3 files changed, 49 insertions, 10 deletions
diff --git a/deps/openssl/openssl/tools/Makefile b/deps/openssl/openssl/tools/Makefile
index 4ca835c4af..bb6fb71f3e 100644
--- a/deps/openssl/openssl/tools/Makefile
+++ b/deps/openssl/openssl/tools/Makefile
@@ -49,6 +49,7 @@ depend:
dclean:
$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
mv -f Makefile.new $(MAKEFILE)
+ rm -f c_rehash
clean:
rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
diff --git a/deps/openssl/openssl/tools/c_rehash b/deps/openssl/openssl/tools/c_rehash
index ba4e3944f3..6a20011a4c 100644
--- a/deps/openssl/openssl/tools/c_rehash
+++ b/deps/openssl/openssl/tools/c_rehash
@@ -16,13 +16,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} = "$prefix/bin" . ($ENV{PATH} ? $path_delim . $ENV{PATH} : ""); # prefix our path
if(! -x $openssl) {
my $found = 0;
- foreach (split /:/, $ENV{PATH}) {
+ foreach (split /$path_delim/, $ENV{PATH}) {
if(-x "$_/$openssl") {
$found = 1;
+ $openssl = "$_/$openssl";
last;
}
}
@@ -35,11 +45,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 $_) {
@@ -102,7 +117,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/^.*=//;
@@ -123,7 +138,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;
}
diff --git a/deps/openssl/openssl/tools/c_rehash.in b/deps/openssl/openssl/tools/c_rehash.in
index 8b6d3f5647..bfc4a69ed4 100644
--- a/deps/openssl/openssl/tools/c_rehash.in
+++ b/deps/openssl/openssl/tools/c_rehash.in
@@ -16,13 +16,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} = "$prefix/bin" . ($ENV{PATH} ? $path_delim . $ENV{PATH} : ""); # prefix our path
if(! -x $openssl) {
my $found = 0;
- foreach (split /:/, $ENV{PATH}) {
+ foreach (split /$path_delim/, $ENV{PATH}) {
if(-x "$_/$openssl") {
$found = 1;
+ $openssl = "$_/$openssl";
last;
}
}
@@ -35,11 +45,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 $_) {
@@ -102,7 +117,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/^.*=//;
@@ -123,7 +138,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;
}