Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: x/crypto/ocsp: Return ocsp.Request from CreateRequest instead of []byte #37219

Open
divjotarora opened this issue Feb 14, 2020 · 0 comments
Labels
Milestone

Comments

@divjotarora
Copy link

@divjotarora divjotarora commented Feb 14, 2020

The ocsp.CreateRequest function returns an OCSP request as a []byte. It would be helpful to instead have it return ocsp.Request, which can then be marshalled into []byte if needed.

My specific use case is implementing a cache for OCSP responses. Per https://community.digicert.com/en/blogs.entry.html/2015/02/26/what-is-ocsp.html, the cache key should be the CertID sequence for the OCSP request (issueNameHash + issueKeyHash + serialNumber). All of these fields are calculated in ocsp.CreateRequest but because that function returns a []byte, accessing them after it's been called would require an additional call to ocsp.ParseRequest, which seems wasteful.

I'm not sure what the stability guarantee is for the x/crypto/ocsp library, but if changing the return type for the existing function isn't feasible, perhaps a new function could be added or the existing function could be deprecated and split into two functions.

@gopherbot gopherbot added this to the Proposal milestone Feb 14, 2020
@gopherbot gopherbot added the Proposal label Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.