-
Notifications
You must be signed in to change notification settings - Fork 18k
x/crypto/openpgp: new entities cannot be encrypted to by default #37646
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
Comments
Yup. I've almost had to add RIPEMD160 to WAL-G due to this wal-g/wal-g#362 If you do not prefer anything there should be sane SHA-256 but what we get is |
Wouldn't we want to take the first hash? RIPEMD160 is deprecated and staticcheck errors as such. I've tried specifying SHA256 and still been unable to encrypt. The error I get is similar to the original report. |
I'm trying to trace this down and it looks like the conversion between
Inside For SHA256 this seems to compare That comparison seems wrong. Shouldn't it be 5? None of those mappings seem correct, so I'm not sure how this ever worked. That makes me think I'm missing a mapping or using the wrong typed uint8. Specifying |
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 [email protected] 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. |
|
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Tried creating a new pgp private key with
openpgp.NewEntity
and use it to encrypt some text. I passednil
as config for sensible defaults as per the docs:If config is nil, sensible defaults will be used
.What did you expect to see?
That the encryption works with no errors
What did you see instead?
an error:
openpgp: invalid argument: cannot encrypt because no candidate hash functions are compiled in. (Wanted RIPEMD160 in this case.)
Note there's an old closed issue for this issue 12153, however it was closed without being fixed properly. Looking at the PR this is easy to see that the case where
config
isnil
is not handled correctly, at least as far as the docs say that there'll be sensible defaults.The text was updated successfully, but these errors were encountered: