errors: reject invalid TSA responses and preserve error chains #8
Labels
No labels
nagonag
nagonag/ignore
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
heiko/mailseal#8
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Error handling is inconsistent in security- and output-sensitive paths:
sign.goprintsResponse.Validatefailures as?? ...to stdout and continues. This can both accept invalid responses and corrupt an RFC 5322 message or DER stream.tsr.Formatfailures are sent throughverbosef, which may be disabled, and processing continues.%vinstead of%w(sign.goclient creation,internal/tsr.Base64), preventingerrors.Is/errors.Asinspection.query.goreturns dependency errors without operation context.Checklist: #49 (wrap errors intentionally), #52 (do not log and return/continue ambiguously), #53 (do not suppress required errors).
Proposed fix
%wand operation/endpoint context.Acceptance criteria
errors.Is/errors.Asthrough wrapped errors.Reviewed against
948b7a9onmaster(Go 1.26.2).