neuhalje / bouncy-gpg

Make using Bouncy Castle with OpenPGP fun again!
https://neuhalje.github.io/bouncy-gpg/
Other
205 stars 58 forks source link

Fix for issue 50, encrypting with keys that don't have a KeyFlags subpacket #52

Closed mdesmons closed 4 years ago

mdesmons commented 4 years ago

The current code checks the KeyFlags subpacket to determine if a key can be used to encrypt/sign. However if the key doesn't have a KeyFlags subpacket Bouncy-GPG refuses to use it to encrypt/sign, whereas GPG has a fallback scenario where it analyses the key's algorithm to determine its role.

We implemented the same fallback scenario here, using the key algorithm if it doesn't have a KeyFlags subpacket.

neuhalje commented 4 years ago

Thanks for contributing!