x/crypto/openpgp: compression options are not used in Encrypt function #41213
installed Golang version and architecture details :
What did you do?
I'm trying to replicate following gpg command with
What did you expect to see?
I'm expected to see my plain text input message to be PGP encrypted and must have ZIP compression.
What did you see instead?
Message I get from
Upon inspecting the Encrypt function and debugging the code, found out that it's not making use of compression config passed as argument anywhere in the flow. Made a change in write.go and added compression. After this change, the messages are properly encrypted and compressed.
A PR is already raised in golang/crypto repository. golang/crypto#103. This PR and debug info is from last year when i raised it in crypto repo. Posting it here due to inactivity there.
The text was updated successfully, but these errors were encountered:
Per the accepted #44226 proposal and due to lack of maintenance, the golang.org/x/crypto/openpgp package is now frozen and deprecated. No new changes will be accepted except for security fixes. The package will not be removed.
If this is a security issue, please email firstname.lastname@example.org and we will assess it and provide a fix.
If you're looking for alternatives, consider the crypto/ed25519 package for simple signatures, golang.org/x/mod/sumdb/note for inline signatures, or filippo.io/age for encryption. You can read a summary of OpenPGP issues and alternatives here.
If you are required to interoperate with OpenPGP systems and need a maintained package, we suggest considering one of multiple community forks of golang.org/x/crypto/openpgp. We don't endorse any specific one.