Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions crypto/keyring_streaming.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ func (msg *PlainMessageReader) Read(b []byte) (n int, err error) {
n, err = msg.details.UnverifiedBody.Read(b)
if errors.Is(err, io.EOF) {
msg.readAll = true
if vErr := msg.VerifySignature(); vErr != nil {
err = vErr
}
}
return
}
Expand All @@ -174,8 +177,6 @@ func (msg *PlainMessageReader) VerifySignature() (err error) {
if msg.verifyKeyRing != nil {
processSignatureExpiration(msg.details, msg.verifyTime)
err = verifyDetailsSignature(msg.details, msg.verifyKeyRing)
} else {
err = errors.New("gopenpgp: no verify keyring was provided before decryption")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API is such that if the caller sets the verification key ring to nil, the library should not do any verification. So I don't think we need an error here.

}
return
}
Expand Down