From d2c6d1568e85b97cf3a74437709c52885da6aab8 Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Tue, 25 Oct 2016 03:17:26 -0400 Subject: mk-ca-bundle: Update the vbscript version Bring the VBScript version more in line with the perl version: - Change timestamp to UTC. - Change URL retrieval to HTTPS-only by default. - Comment out the options that disabled SSL cert checking by default. - Assume OpenSSL is present, get SHA256. And add a flag to toggle it. - Fix cert issuer name output. The cert issuer output is now ansi, converted from UTF-8. Prior to this it was corrupt UTF-8. It turns out though we can work with UTF-8 the FSO object that writes ca-bundle can't write UTF-8, so there will have to be some alternative if UTF-8 is needed (like an ADODB.Stream). - Disable the certificate text info feature. The certificate text info doesn't work properly with any recent OpenSSL. --- lib/mk-ca-bundle.pl | 5 ++- lib/mk-ca-bundle.vbs | 114 +++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 101 insertions(+), 18 deletions(-) (limited to 'lib') diff --git a/lib/mk-ca-bundle.pl b/lib/mk-ca-bundle.pl index 38e7ff73c..75278f168 100755 --- a/lib/mk-ca-bundle.pl +++ b/lib/mk-ca-bundle.pl @@ -244,7 +244,8 @@ sub sha256 { close(FILE); } else { # Use OpenSSL command if Perl Digest::SHA modules not available - $result = (split(/ |\r|\n/,`$openssl dgst -sha256 $_[0]`))[1]; + $result = `"$openssl" dgst -r -sha256 "$_[0]"`; + $result =~ s/^([0-9a-f]{64}) .+/$1/is; } return $result; } @@ -392,7 +393,7 @@ print CRT <