Skip to content

Commit

Permalink
fix: (verify,decrypt) using isSigned to validate instead of SignedBy
Browse files Browse the repository at this point in the history
  • Loading branch information
jerson committed May 28, 2024
1 parent dad939b commit 701f096
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion openpgp/decrypt.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (o *FastOpenPGP) decrypt(reader io.Reader, privateKey, passphrase string, s
return nil, fmt.Errorf("signature error: %w", md.SignatureError)
}

if md.SignedBy == nil {
if !md.IsSigned {
return nil, errors.New("message is not signed")
}

Expand Down
2 changes: 1 addition & 1 deletion openpgp/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (o *FastOpenPGP) verifyDataBytes(signedData io.Reader, publicKey string, sh
return false, fmt.Errorf("invalid read message: %w", err)
}

if md.SignedBy == nil {
if !md.IsSigned {
return false, errors.New("message was not signed")
}

Expand Down

0 comments on commit 701f096

Please sign in to comment.