summaryrefslogtreecommitdiff
path: root/lib/mk-ca-bundle.pl
diff options
context:
space:
mode:
authorGunter Knauf <gk@gknw.de>2008-02-11 18:52:45 +0000
committerGunter Knauf <gk@gknw.de>2008-02-11 18:52:45 +0000
commit019f6a1926e28bc2ecc12e0acf3b22fde481f235 (patch)
treeb52082495662ac933838078d4582df42ce3feb37 /lib/mk-ca-bundle.pl
parent44fba11b349ff1197a68b29f1d35fd13e5e61ce7 (diff)
downloadcurl-019f6a1926e28bc2ecc12e0acf3b22fde481f235.tar.gz
open pipe to openssl commandline instead of writing into temp file.
Diffstat (limited to 'lib/mk-ca-bundle.pl')
-rwxr-xr-xlib/mk-ca-bundle.pl9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/mk-ca-bundle.pl b/lib/mk-ca-bundle.pl
index 2463626be..4a70f715f 100755
--- a/lib/mk-ca-bundle.pl
+++ b/lib/mk-ca-bundle.pl
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/bin/perl -w
# ***************************************************************************
# * _ _ ____ _
# * Project ___| | | | _ \| |
@@ -66,7 +66,6 @@ if ($opt_i) {
}
my $crt = $ARGV[0] || 'ca-bundle.crt';
-my $tmp = 'mytmpfile.txt';
my $txt = substr($url, rindex($url, '/') + 1);
$txt =~ s/\?.*//;
@@ -164,10 +163,9 @@ while (<TXT>) {
}
close(CRT) or die "Couldn't close $crt: $!";
if ($opt_t) {
- open(TMP, ">$tmp") or die "Couldn't open $tmp: $!";
+ open(TMP, "|$openssl x509 -md5 -fingerprint -text -inform PEM >> $crt") or die "Couldn't open openssl pipe: $!";
print TMP $pem;
- close(TMP) or die "Couldn't close $tmp: $!";
- system("$openssl x509 -md5 -fingerprint -text -in $tmp -inform PEM >> $crt");
+ close(TMP) or die "Couldn't close openssl pipe: $!";
}
print "Parsing: $caname\n" if ($opt_v);
$certnum ++;
@@ -175,7 +173,6 @@ while (<TXT>) {
}
close(TXT) or die "Couldn't close $txt: $!";
unlink $txt if ($opt_u);
-unlink $tmp;
print "Done ($certnum CA certs processed).\n" if (!$opt_q);
exit;