Ensure DecryptSessionKey returns an error for a missing key packet (#245)

This commit is contained in:
Lukas Burkhalter 2023-06-20 14:47:57 +02:00 committed by GitHub
parent cf8b8d4a80
commit ca02a218b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,7 +55,11 @@ Loop:
}
if !hasPacket {
if err != nil {
return nil, errors.Wrap(err, "gopenpgp: couldn't find a session key packet")
} else {
return nil, errors.New("gopenpgp: couldn't find a session key packet")
}
}
if decryptErr != nil {