golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
122.87k stars 17.52k forks source link

x/crypto/ocsp: ParseResponse pitfalls #11984

Open takeyourhatoff opened 9 years ago

takeyourhatoff commented 9 years ago

There are two pitfalls in the ParseResponse method of "x/cryto/ocsp". The first being that if you forget to pass in an issuer then the response will be parsed but signature verification will not be performed. The second is that some people might assume that when err != nil, Response.Status == Good. I would suggest an additional idiot proof method VerifyResponse which might look a little like this:

https://play.golang.org/p/eTkpQi_gDk

adg commented 9 years ago

cc @agl

odeke-em commented 7 years ago

Hello there @takeyourhatoff, still interested in working on this? Perhaps a CL might re-ignite the conversation and it can then be reviewed. Thanks!