From 8de74ffb4a2008a61c05e9a24c8fa9b14858d2be Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Fri, 19 Feb 2021 18:31:20 +0100 Subject: Remove dependency on List::Util (core module). --- Changelog | 1 + INSTALL | 1 - lacme | 7 +++---- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Changelog b/Changelog index abdb3ef..8952ba6 100644 --- a/Changelog +++ b/Changelog @@ -50,6 +50,7 @@ lacme (0.7.1) upstream; + accountd: replace internal option --conn-fd=FD with flag --stdio. Using stdin/stdout makes it possible to tunnel the accountd connection through ssh. + + Remove dependency on List::Util (core module). - lacme: delay webserver socket shutdown to after the process has terminated. - documentation: suggest to generate private key material with diff --git a/INSTALL b/INSTALL index cb8d57f..85bd0c2 100644 --- a/INSTALL +++ b/INSTALL @@ -28,7 +28,6 @@ lacme depends on OpenSSL ≥1.1.0 and the following Perl modules: - File::Temp (core module) - Getopt::Long (core module) - JSON (optionally C/XS-accelerated with JSON::XS) - - List::Util (core module) - LWP::UserAgent - LWP::Protocol::https (for https:// ACME directory URIs) - MIME::Base64 (core module) diff --git a/lacme b/lacme index 9f46b47..cb399f9 100755 --- a/lacme +++ b/lacme @@ -30,7 +30,6 @@ use Fcntl qw/F_GETFD F_SETFD FD_CLOEXEC O_CREAT O_EXCL O_WRONLY SEEK_SET/; use File::Basename 'dirname'; use File::Temp (); use Getopt::Long qw/:config posix_default no_ignore_case gnu_getopt auto_version/; -use List::Util 'first'; use POSIX (); use Socket 1.95 qw/AF_UNIX AF_INET AF_INET6 PF_UNIX PF_INET PF_INET6 PF_UNSPEC INADDR_ANY IN6ADDR_ANY IPPROTO_IPV6 @@ -744,15 +743,15 @@ elsif ($COMMAND eq 'newOrder' or $COMMAND eq 'new-cert') { print STDERR " $_ = $conf->{$_}\n" foreach grep { defined $conf->{$_} } (sort keys %$conf); } - my $certtype = first { defined $conf->{$_} } qw/certificate certificate-chain/; - unless (defined $certtype) { + my $cert = $conf->{'certificate-chain'} // $conf->{'certificate'}; + unless (defined $cert) { print STDERR "[$s] Warning: Missing 'certificate' and 'certificate-chain', skipping\n"; $rv = 1; next; } # skip certificates that expire at least $conf->{'min-days'} days in the future - if (-f $conf->{$certtype} and defined (my $t = x509_enddate($conf->{$certtype}))) { + if (-f $cert and defined (my $t = x509_enddate($cert))) { my $d = $OPTS{'min-days'} // $conf->{'min-days'} // 21; if ($d >= 0 and $t - time > $d*86400) { my $d = POSIX::strftime('%Y-%m-%d %H:%M:%S UTC', gmtime($t)); -- cgit v1.2.3