You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sec: ValidateAtSignatureTime panics on nil Data (regression from d2666063) #217
d266606 ("sec: improved certcache, certlist and expired cert validation") dropped the nil-Data branch from the exported ValidateAtSignatureTime expiry policy:
A nil Data is the documented case where the certificate itself is the object being validated and the signature-time check is deferred until the certificate is used to validate another packet. With the branch gone, the nil Data reaches ValidateSigTime, which dereferences it (data.Signature()) and the process dies with a nil pointer panic - a crash, not a validation result, for any consumer that registered this stock policy and hits the deferred path.
To Reproduce
Add the test file from the linked PR, then: go test ./std/security/ -run NilData -v
=== RUN TestValidateAtSignatureTimeNilData
Panic value: runtime error: invalid memory address or nil pointer dereference
--- FAIL: TestValidateAtSignatureTimeNilData (0.00s)
=== RUN TestValidateSigTimeNilData
Panic value: runtime error: invalid memory address or nil pointer dereference
--- FAIL: TestValidateSigTimeNilData (0.00s)
FAIL
Expected behavior
ValidateAtSignatureTime with a nil Data defers (accepts) as documented, and ValidateSigTime rejects nil input instead of panicking.
Activity