Update session key decryption to not allow SED packets (#255)
This commit is contained in:
parent
0eace5479a
commit
da4cecfea5
4 changed files with 137 additions and 0 deletions
|
|
@ -409,6 +409,11 @@ func decryptStreamWithSessionKey(
|
|||
// Decrypt data packet
|
||||
switch p := p.(type) {
|
||||
case *packet.SymmetricallyEncrypted, *packet.AEADEncrypted:
|
||||
if symPacket, ok := p.(*packet.SymmetricallyEncrypted); ok {
|
||||
if !symPacket.IntegrityProtected {
|
||||
return nil, errors.New("gopenpgp: message is not authenticated")
|
||||
}
|
||||
}
|
||||
dc, err := sk.GetCipherFunc()
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "gopenpgp: unable to decrypt with session key")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue