-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Description
In case of OCSP reponse signed with embedded OCSP responder cert (not by CA cert directly) ParseResponse from ocsp package does not check if embedded OCSP responder certificate is expired.
It seems...
https://pkg.go.dev/golang.org/x/crypto/ocsp#ParseResponse
https://github.com/golang/crypto/blob/master/ocsp/ocsp.go#L550
...only signatures are checked. This allows one to use old, expired OCSP responder certificate and its key to sign OCSP response and go application using ocsp.ParseResponse package will accept this response but should not (checked in go1.15.2 linux/amd64 but master sources seems to contain the same problem).
OpenSSL in such scenario throws Response Verify Failure
error:
OCSP routines:OCSP_basic_verify:certificate verify error:../crypto/ocsp/ocsp_vfy.c:93:Verify error:certificate has expired
Please see OpenSSL's OCSP response verification algo described on...
https://www.openssl.org/docs/man1.1.1/man1/ocsp.html#OCSP-Response-verification
...and do full responder cert verification, not just signatures.
Regards,
Paweł