Add checking of a wire-formatted control message.

This commit is contained in:
Russ Allbery 2003-10-05 22:55:03 +00:00
parent 6891e0e77b
commit 531d853730

View file

@ -127,6 +127,26 @@ if (pgpverify ('../sample.control', 'news.announce.newgroups')) {
}
$tests++;
# Convert sample.control to wire format and then check its signature.
open (SAMPLE, '../sample.control')
or die "Can't open ../sample.control: $!\n";
open (WIRE, '> signed') or die "Can't create signed: $!\n";
while (<SAMPLE>) {
s/\n\z/\r\n/;
s/^\./../;
print WIRE;
}
print WIRE ".\r\n";
close SAMPLE;
close WIRE;
if (pgpverify ('signed', 'news.announce.newgroups')) {
print "PASS: pgpverify-wire\n";
} else {
print "FAIL: pgpverify-wire\n";
$failed++;
}
$tests++;
# Sign a message with signcontrol.
fix_signcontrol ($pgp);
my $status = system ('./signcontrol < ./messages/newgroup > signed');