neuhalje/bouncy-gpg

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

ispringer opened this issue · 3 comments

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

  • Version: 2.2.0

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.

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

Fixed in 2.3.0