summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2020-01-21 01:27:44 -0500
committerJay Satiro <raysatiro@yahoo.com>2020-01-21 01:27:44 -0500
commitc0217bb27ad5951b1c5c165f2af2967f83cb9679 (patch)
treebe3951f2699dadb7e064272c4007492de8405ee8
parentaabc492be6a6c79ab50861035212203af7f82a18 (diff)
downloadcurl-c0217bb27ad5951b1c5c165f2af2967f83cb9679.tar.gz
squashme: fix for windows
use perl function timegm instead of executing posix date command
-rwxr-xr-xlib/mk-ca-bundle.pl18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/mk-ca-bundle.pl b/lib/mk-ca-bundle.pl
index f7962f9ed..4833a54f6 100755
--- a/lib/mk-ca-bundle.pl
+++ b/lib/mk-ca-bundle.pl
@@ -38,6 +38,7 @@ use warnings;
use vars qw($opt_b $opt_d $opt_f $opt_h $opt_i $opt_k $opt_l $opt_m $opt_n $opt_p $opt_q $opt_s $opt_t $opt_u $opt_v $opt_w);
use List::Util;
use Text::Wrap;
+use Time::Local;
my $MOD_SHA = "Digest::SHA";
eval "require $MOD_SHA";
if ($@) {
@@ -465,15 +466,14 @@ while (<TXT>) {
}
# Example date: 200617000000Z
# Means 2020-06-17 00:00:00Z
- my $done = "20". $timestamp[0] . $timestamp[1]. "-".
- $timestamp[2]. $timestamp[3]. "-".
- $timestamp[4]. $timestamp[5]. " ".
- $timestamp[6]. $timestamp[7]. ":".
- $timestamp[8]. $timestamp[9]. ":".
- $timestamp[10]. $timestamp[11];
- my $distrustat = `date -d "$done" -u +"%s"`;
- my $now = `date -u +"%s"`;
- if($now > $distrustat) {
+ my $distrustat =
+ timegm($timestamp[10] . $timestamp[11], # second
+ $timestamp[8] . $timestamp[9], # minute
+ $timestamp[6] . $timestamp[7], # hour
+ $timestamp[4] . $timestamp[5], # day
+ ($timestamp[2] . $timestamp[3]) - 1, # month
+ "20" . $timestamp[0] . $timestamp[1]); # year
+ if(time >= $distrustat) {
# not trusted anymore
$skipnum++;
report "Skipping: $caname is not trusted anymore" if ($opt_v);