Fix signature status when verifying unsigned message
Return `SIGNATURE_NOT_SIGNED` instead of `SIGNATURE_NO_VERIFIER` when verifying a messages with no embedded signatures.
This commit is contained in:
parent
f4ccc63c40
commit
77df8cba3d
3 changed files with 13 additions and 3 deletions
|
|
@ -99,8 +99,10 @@ func processSignatureExpiration(md *openpgp.MessageDetails, verifyTime int64) {
|
|||
|
||||
// verifyDetailsSignature verifies signature from message details.
|
||||
func verifyDetailsSignature(md *openpgp.MessageDetails, verifierKey *KeyRing) error {
|
||||
if !md.IsSigned ||
|
||||
md.SignedBy == nil ||
|
||||
if !md.IsSigned {
|
||||
return newSignatureNotSigned()
|
||||
}
|
||||
if md.SignedBy == nil ||
|
||||
len(verifierKey.entities) == 0 ||
|
||||
len(verifierKey.entities.KeysById(md.SignedByKeyId)) == 0 {
|
||||
return newSignatureNoVerifier()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue