This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=205f9f13f69ea7486e5babeadc3e95b2620cc668

commit 205f9f13f69ea7486e5babeadc3e95b2620cc668
Author: Guillem Jover <[email protected]>
AuthorDate: Thu Nov 10 04:51:40 2022 +0100

    Dpkg::OpenPGP: Call dearmor() unconditionally for GnuPG certificate imports
    
    We can simply call dearmor() instead of trying to infer the contents
    from the extension. Decide whether to use the resulting dearmored file
    based on the function error code.
---
 scripts/Dpkg/OpenPGP.pm | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/scripts/Dpkg/OpenPGP.pm b/scripts/Dpkg/OpenPGP.pm
index 4c1cd9bbc..7e7be1444 100644
--- a/scripts/Dpkg/OpenPGP.pm
+++ b/scripts/Dpkg/OpenPGP.pm
@@ -184,13 +184,9 @@ sub _gpg_verify {
     push @exec, _gpg_options_weak_digests();
     push @exec, '--homedir', $gpg_home;
     foreach my $cert (@certs) {
-        my $certring;
-        if ($cert =~ m/\.asc/) {
-            $certring = File::Temp->new(UNLINK => 1, SUFFIX => '.pgp');
-            $self->dearmor('PUBLIC KEY BLOCK', $cert, $certring);
-        } else {
-            $certring = $cert;
-        }
+        my $certring = File::Temp->new(UNLINK => 1, SUFFIX => '.pgp');
+        my $rc = $self->dearmor('PUBLIC KEY BLOCK', $cert, $certring);
+        $certring = $cert if $rc;
         push @exec, '--keyring', $certring;
     }
     push @exec, '--output', $data if defined $data;

-- 
Dpkg.Org's dpkg

Reply via email to