ProtonMail / gopenpgp

A high-level OpenPGP library
https://gopenpgp.org
MIT License
1.01k stars 111 forks source link

Ensure that DecryptSessionKey returns an error for no key packet #245

Closed lubux closed 1 year ago

lubux commented 1 year ago

DecryptSessionKey returns no error if the input packet stream only contains a SymmetricallyEncrypted packet although no session key is found. The issue is that errors.Wrap returns nil if err is nil.

This pull request ensures that an error is returned if no session key is found.