neuhalje / bouncy-gpg

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

KeyFlag#extractPublicKeyFlags throws NullPointerException if called on an older public key with no hashed subpackets #48

Closed ispringer closed 4 years ago

ispringer commented 4 years ago

Describe the bug signature.getHashedSubPackets() will return null for older (v2 or earlier) public keys. And then the hashedSubPackets.getKeyFlags() call will cause an NPE.

To Reproduce Try to call KeyFlag#extractPublicKeyFlags on an older public key that does not contain any hashed subpackets.

Expected behavior No NPE.

System

zigouras commented 4 years ago

Hi, will a production Maven release be made with a fix for this issue? I ran into this bug recently and had to go to stackoverflow to figure it out: https://stackoverflow.com/questions/63852907/bouncy-gpg-bouncycastle-pgp-gpg-java-api-nullpointerexception-when-trying-to-enc

Thanks for the useful project!

PS: hey I realized @ispringer is in Philadelphia, me too! It is a small world. HMU if you want to talk about development in Philly.

neuhalje commented 3 years ago

I will try to make a release this weekend. $DAYJOB is kind of eating all of my free time

neuhalje commented 3 years ago

Fixed in 2.3.0