Skip to content

PGP Dash-Escaped Text is still parsed for pgp #54

@bwbroersma

Description

@bwbroersma

PGP Dash-Escaped Text is still parsed for the PGP signature. Note that the File Format Description and ABNF Grammar of RFC 9116 explicitly only allows - in the cleartext part, not the signature. Specific problematic code that currently only checks if it's signed and not still reading the hash-header:

sectxt/sectxt/__init__.py

Lines 135 to 137 in 79bb386

# signed content might be dash escaped
if self._signed and not self._reading_sig and line.startswith("- "):
line = line[2:]

Solution would be some cleartext variable to be set and reset per line if - is parsed, not to parse - -----END PGP SIGNATURE----- as valid, which is currently the case. There seems to be no need to ever use - escaping in sectxt, since all lined should either start with a field name or # comment. Probably it is there to be compatible with other PGP tooling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions