diff options
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | scripts/Dpkg/Control/HashCore.pm | 20 |
2 files changed, 12 insertions, 10 deletions
diff --git a/debian/changelog b/debian/changelog index 00793402c..38a2a0b74 100644 --- a/debian/changelog +++ b/debian/changelog @@ -92,6 +92,8 @@ dpkg (1.19.0) UNRELEASED; urgency=medium in Dpkg::Vendor::Debian. - Do not use an intermediate variable in Dpkg::Control::HashCore::Tie STORE method. + - Expect deb822 stanza delimiters more often than OpenPGP Armor Headers + in Dpkg::Control::HashCore parse method. * Documentation: - Document currently accepted syntax for changelogs in deb-changelog(5). Closes: #858579 diff --git a/scripts/Dpkg/Control/HashCore.pm b/scripts/Dpkg/Control/HashCore.pm index 91b279d43..a3ea4bc96 100644 --- a/scripts/Dpkg/Control/HashCore.pm +++ b/scripts/Dpkg/Control/HashCore.pm @@ -227,16 +227,6 @@ sub parse { $line = substr $line, 1; } $self->{$cf} .= "\n$line"; - } elsif (m/^-----BEGIN PGP SIGNED MESSAGE-----[\r\t ]*$/) { - $expect_pgp_sig = 1; - if ($$self->{allow_pgp} and not $parabody) { - # Skip OpenPGP headers - while (<$fh>) { - last if m/^\s*$/; - } - } else { - $self->parse_error($desc, g_('OpenPGP signature not allowed here')); - } } elsif (m/^\s*$/ || ($expect_pgp_sig && m/^-----BEGIN PGP SIGNATURE-----[\r\t ]*$/)) { if ($expect_pgp_sig) { @@ -264,6 +254,16 @@ sub parse { $$self->{is_pgp_signed} = 1; } last; # Finished parsing one block + } elsif (m/^-----BEGIN PGP SIGNED MESSAGE-----[\r\t ]*$/) { + $expect_pgp_sig = 1; + if ($$self->{allow_pgp} and not $parabody) { + # Skip OpenPGP headers + while (<$fh>) { + last if m/^\s*$/; + } + } else { + $self->parse_error($desc, g_('OpenPGP signature not allowed here')); + } } else { $self->parse_error($desc, g_('line with unknown format (not field-colon-value)')); |