Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If signed, pass data to gpg validate #58

Closed
bwbroersma opened this issue Jul 17, 2023 · 1 comment
Closed

If signed, pass data to gpg validate #58

bwbroersma opened this issue Jul 17, 2023 · 1 comment

Comments

@bwbroersma
Copy link
Contributor

To prevent an invalid PGP signature like to pass, like:

The data could be passed to gpg to validate the form of the signature data.
E.g. an invalid escape like listed in #54 would produce:

$ gpg  --verify security-with-escaped-begin-signature.txt
gpg: unexpected armor: -----END PGP SIGNATURE-----\r\n
gpg: no valid OpenPGP data found.
gpg: no signature found
gpg: the signature could not be verified.
Please remember that the signature file (.sig or .asc)
should be the first file given on the command line.

While a parsable message results in:

$ gpg  --verify valid-pgp-security.txt
gpg: Signature made Sun 01 Jan 2023 12:34:46 PM CEST
gpg:                using RSA key XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
gpg: Can't check signature: No public key

Even the signature date could be checked for:

  • not a date in the future
  • sectxt Expire - PGP signature date < 1 year
@DigitalTrustCenter
Copy link
Owner

We attempted to use the GNUPG function mentioned in your issue. For this we tested python-gnupg, a wrapper for GnuPG. However for this the binary would need to be installed if you use this package. We did find a replacement module, PGPy Python library for implementing Pretty Good Privacy into Python programs, conforming to the OpenPGP specification per RFC 4880.
This package will detect any issue with the pgp message or the data within without decrypting the message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants