[Rt-commit] rt branch 5.0/update-tests-for-gpg-2.4 created. rt-5.0.5-200-g8b57491564

BPS Git Server git at git.bestpractical.com
Fri Apr 12 18:17:29 UTC 2024


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/update-tests-for-gpg-2.4 has been created
        at  8b574915649a424370aff12282360bed08623c47 (commit)

- Log -----------------------------------------------------------------
commit 8b574915649a424370aff12282360bed08623c47
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Apr 3 13:53:45 2024 -0400

    Update tests for new warning messages in gpg 2.4+

diff --git a/t/security/CVE-2012-4735-incoming-encryption-header.t b/t/security/CVE-2012-4735-incoming-encryption-header.t
index e067ff1136..d4f080736d 100644
--- a/t/security/CVE-2012-4735-incoming-encryption-header.t
+++ b/t/security/CVE-2012-4735-incoming-encryption-header.t
@@ -54,13 +54,21 @@ This was _totally_ encrypted.
 EOF
 
     my ($status, $id);
-    warnings_like {
+    {
+        my @warnings;
+        local $SIG{__WARN__} = sub { push @warnings, @_ };
         ($status, $id) = RT::Test->send_via_mailgate($mail);
         ok $id, "created a ticket";
-    } [qr/(?:keyring|keybox) .* created/,
-       qr/Failure during GnuPG data: No data has been found\. The reason is 'Invalid packet found'/,
-       qr/Failure during GnuPG data: No data has been found\. The reason is 'No armored data'/,
-   ];
+
+        like($warnings[0], qr/(?:keyring|keybox) .* created/, 'GnuPG warning');
+        like($warnings[1], qr/Failure during GnuPG data: No data has been found\. The reason is 'Invalid packet found'/, 'GnuPG warning');
+        like($warnings[2], qr/Failure during GnuPG data: No data has been found\. The reason is 'No armored data'/, 'GnuPG warning');
+
+        # GnuPG 2.4.5+ issues another warning for gpg-exit
+        if ( $warnings[3] ) {
+            like($warnings[3], qr/Failure during GnuPG gpg-exit: Failed to gpg-exit/, 'GnuPG warning');
+        }
+    }
 
     my $ticket = RT::Ticket->new( RT->SystemUser );
     $ticket->Load( $id );

-----------------------------------------------------------------------


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list