Skip to content

Commit

Permalink
Update tests for new warning messages in gpg 2.4+
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnavy committed Apr 12, 2024
1 parent e84269f commit 8b57491
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions t/security/CVE-2012-4735-incoming-encryption-header.t
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 8b57491

Please sign in to comment.