X-Git-Url: https://git.sthu.org/?a=blobdiff_plain;f=caff%2Fcaff;h=cb25412c75d54e2dd68faf4174ae8a58d79b77a6;hb=09af3f20b50036e87bd32fa74978ad70fc669891;hp=8415af93cd7f2b9c083c666412278538c2172c0c;hpb=a35a7302a1bcb2d71ef0e7b0d3655684769bc82c;p=pgp-tools.git diff --git a/caff/caff b/caff/caff index 8415af9..cb25412 100755 --- a/caff/caff +++ b/caff/caff @@ -465,7 +465,8 @@ sub load_config() { check_executable("gpg", $CONFIG{'gpg'}); check_executable("gpg-sign", $CONFIG{'gpg-sign'}); check_executable("gpg-delsig", $CONFIG{'gpg-delsig'}); - $CONFIG{'secret-keyring'} = $ENV{'HOME'}.'/.gnupg/secring.gpg' unless defined $CONFIG{'secret-keyring'}; + $CONFIG{'secret-keyring'} = ($ENV{'GNUPGHOME'} || "$ENV{'HOME'}/.gnupg") . '/secring.gpg' + unless defined $CONFIG{'secret-keyring'}; $CONFIG{'no-download'} = 0 unless defined $CONFIG{'no-download'}; $CONFIG{'no-sign'} = 0 unless defined $CONFIG{'no-sign'}; $CONFIG{'key-files'} = () unless defined $CONFIG{'key-files'}; @@ -908,11 +909,11 @@ push @{$CONFIG{'key-files'}}, @{$params->{'key-files'}} if defined $params->{'ke for my $keyid (@ARGV) { $keyid =~ s/^0x//i; - unless ($keyid =~ /^([A-F0-9]{8}|[A-F0-9]{16}||[A-F0-9]{40})$/i) { - if ($keyid =~ /^[A-F0-9]{32}$/) { - info("Ignoring v3 fingerprint $keyid. v3 keys are obsolete."); - next; - }; + if ($keyid =~ /^[A-F0-9]{32}$/i) { + info("Ignoring v3 fingerprint $keyid. v3 keys are obsolete."); + next; + }; + if ($keyid !~ /^([A-F0-9]{8}|[A-F0-9]{16}|[A-F0-9]{40})$/i) { print STDERR "$keyid is not a keyid.\n"; usage(\*STDERR, 1); };