diff options
Diffstat (limited to 'acmeman')
-rwxr-xr-x | acmeman | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -1,4 +1,4 @@ -#! /usr/bin/perl +#!/usr/bin/perl # Copyright (C) 2017, 2018 Sergey Poznyakoff <gray@gnu.org> # # This program is free software; you can redistribute it and/or modify @@ -653,14 +653,11 @@ sub domain_cert_expires { if (exists($exts->{subjectAltName})) { my $msg = $config->get(qw(core check-alt-names)) ? 'will renew' : 'use -a to trigger renewal'; - # FIXME: Crypt::OpenSSL::X509 returns extensions as strings, - # instead of as ASN.1 objects. Until it is fixed, the - # following naive logic is implemented to split the string into - # names: - my $blob = $exts->{subjectAltName}->value(); + my @names = map { s/^DNS://; $_ } + split /,\s*/, $exts->{subjectAltName}->to_string(); my @missing; foreach my $vh (sort { length($b) <=> length($a) } $domain->names) { - unless ($blob =~ s/\Q$vh\E\b//) { + unless (grep { $_ eq $vh } @names) { push @missing, $vh; } } @@ -841,7 +838,7 @@ sub coalesce { foreach my $ent (sort { $a->{domain} cmp $b->{domain} } map { { ord => $i++, domain => $_ } } @{$ref}) { if (@domlist && $domlist[-1]->{domain}->cn eq $ent->{domain}->cn) { - $domlist[-1] += $ent; + $domlist[-1]->{domain} += $ent->{domain}; } else { push @domlist, $ent; } @@ -917,7 +914,8 @@ sub cb_parse_bool { true => 1, yes => 1 ); - if (my $res = $bt{lc($$vref)}) { + my $res = $bt{lc($$vref)}; + if (defined($res)) { $$vref = $res; return undef; } @@ -933,7 +931,7 @@ my %syntax = ( 'time-delta' => { default => 86400 }, source => { default => 'apache' }, 'check-alt-names' => { default => 0, parser => \&cb_parse_bool }, - 'key-size' => { re => '^\d+$', default => 4096 } + 'key-size' => { re => '^\d+$', default => 4096 } } }, files => { @@ -1030,7 +1028,7 @@ $config = new App::Acmeman::Config($config_file, syntax => \%syntax, defaults => { 'core.source' => 'apache', - 'core.key-size' => 4096, + 'core.key-size' => 4096 }); if ($config->success) { |