From 2e750ce452c37ec4cd494538d2f3c94acde3e718 Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Sun, 30 Oct 2016 01:01:29 -0400 Subject: mk-ca-bundle.vbs: Fix UTF-8 output - Change initial message box to mention delay when downloading/parsing. Since there is no progress meter it was somewhat unexpected that after choosing a filename nothing appears to happen, when actually the cert data is in the process of being downloaded and parsed. - Warn if OpenSSL is not present. - Use a UTF-8 stream to make the ca-bundle data. - Save the UTF-8 ca-bundle stream as binary so that no BOM is added. --- This is a follow-up to d2c6d15 which switched mk-ca-bundle.vbs output to ANSI due to corrupt UTF-8 output, now fixed. This change completes making the default certificate bundle output of mk-ca-bundle.vbs as close as possible to that of mk-ca-bundle.pl, which should make it easier to review any difference between their output. Ref: https://github.com/curl/curl/pull/1012 --- lib/mk-ca-bundle.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/mk-ca-bundle.pl') diff --git a/lib/mk-ca-bundle.pl b/lib/mk-ca-bundle.pl index 75278f168..9574f1dbf 100755 --- a/lib/mk-ca-bundle.pl +++ b/lib/mk-ca-bundle.pl @@ -30,6 +30,7 @@ # dependency is the OpenSSL commandline tool for optional text listing. # Hacked by Guenter Knauf. # +use Encode; use Getopt::Std; use MIME::Base64; use strict; @@ -487,7 +488,7 @@ while () { . "-----END CERTIFICATE-----\n"; print CRT "\n$caname\n"; print CRT @precert if($opt_m); - my $maxStringLength = length($caname); + my $maxStringLength = length(decode('UTF-8', $caname, Encode::FB_CROAK)); if ($opt_t) { foreach my $key (keys %trust_purposes_by_level) { my $string = $key . ": " . join(", ", @{$trust_purposes_by_level{$key}}); -- cgit v1.2.3