Fix various keys issues (#117)

* Fix armouring headers for public keys
* Fix error for session key decryption failure
This commit is contained in:
wussler 2021-03-09 19:06:35 +01:00 committed by GitHub
parent 27efcb4627
commit ff54225384
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 75 additions and 6 deletions

View file

@ -55,15 +55,15 @@ Loop:
}
if !hasPacket {
return nil, errors.Wrap(err, "gopenpgp: couldn't find a session key packet that could be decrypted")
return nil, errors.Wrap(err, "gopenpgp: couldn't find a session key packet")
}
if decryptErr != nil {
return nil, errors.Wrap(decryptErr, "gopenpgp: error in decrypting")
}
if ek == nil {
return nil, errors.New("gopenpgp: unable to decrypt session key")
if ek == nil || ek.Key == nil {
return nil, errors.New("gopenpgp: unable to decrypt session key: no valid decryption key")
}
return newSessionKeyFromEncrypted(ek)