Skip to content

Commit

Permalink
Ensure DecryptSessionKey returns an error for a missing key packet (#245
Browse files Browse the repository at this point in the history
)
  • Loading branch information
lubux committed Jun 20, 2023
1 parent cf8b8d4 commit ca02a21
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crypto/keyring_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ Loop:
}

if !hasPacket {
return nil, errors.Wrap(err, "gopenpgp: couldn't find a session key packet")
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 {
Expand Down

0 comments on commit ca02a21

Please sign in to comment.