News for hackers. Stuff that matters.
Re:Rolling Your Own Crypto by pvg on Tuesday December 20, 2016 @03:14PM (#13223510)
Serious question: what are the common, practical situations you've run into or can think of where you need to be validating certificate chains yourself in your application code?
Re:Rolling Your Own Crypto by wbond on Tuesday December 20, 2016 @03:15PM (#13223520)
Document signing is what pushed me down that path. It uses the same ecosystem and technologies as TLS, but cares more about revocation.
Re:Rolling Your Own Crypto by pvg on Tuesday December 20, 2016 @03:22PM (#13223572)
Ah I see. Seems a bit off the beaten path already, though. Were they some sort of existing documents, generated by something not easily available server side?
Re:Rolling Your Own Crypto by wolf550e on Tuesday December 20, 2016 @03:58PM (#13223890)
Did you require online (not cached) revocation check? That would require buying more HSMs.
Re:Rolling Your Own Crypto by wbond on Tuesday December 20, 2016 @04:36PM (#13224278)
No, I'm just implementing code that signs and verifies PDF digital signatures for compliance with EU regulations. I'm not dealing with HSMs, or even the PKIX infrastructure other than verifying a certificate is valid according to Adobe/ETSI and generating/checking signatures. The certificate issuers need to provide the CRLs and OCSP responders/responses.
Re:Rolling Your Own Crypto by wolf550e on Tuesday December 20, 2016 @08:51PM (#13226184)
Why is this downvoted? Could the downvoter please comment?
Re:Rolling Your Own Crypto by viraptor on Wednesday December 21, 2016 @01:50AM (#13227293)
Online revocation check doesn't require buying HSMs. HSMs also usually operate on a much lower level / aren't really connected to the internet.
Re:Rolling Your Own Crypto by wolf550e on Wednesday December 21, 2016 @06:11AM (#13228262)
If you can't use a cached OCSP response and instead need a fresh one (or the cache is valid for a short period only), that means the CA must sign a new OCSP response much more often.

The key the CA uses to sign OCSP must be held safely because it is important, even if that key can't sign new certificates. I think it belongs in an HSM.

I've read Let's Encrypt spends ~98% of the time of its intermediate signing keys on OCSP, not on new certs. If the OCSP was good only for an hour instead of a week, they would need to perform many more signatures per unit of time which would require more hardware.

Re:Rolling Your Own Crypto by viraptor on Wednesday December 21, 2016 @06:23AM (#13228307)
But that's an implementation detail. Sure, some HSMs will make signing faster, some won't. You don't need to use HSMs which will have a considerable markup too. You can use more servers if you prefer.

And anyway, that's the server case. OP just wanted to check the revocation as a client as far as I can tell, which definitely doesn't require any extra hardware.

Re:Rolling Your Own Crypto by wbond on Wednesday December 21, 2016 @08:26AM (#13228866)
In some cases revocation info will be live, in others it will be stored inside of the document.

My use case involves embedding it, but also being able to verify it (Adobe distributes trusted CA certs through a signed PDF). Never would I need to run my own PKIX infrastructure.

Re:Rolling Your Own Crypto by paulddraper on Tuesday December 20, 2016 @05:41PM (#13224944)
I want to implement SAML (as a consumer).

(To be fair, it can be done without certificate chains, but it could also be done with chains.)

Re:Rolling Your Own Crypto by pvg on Tuesday December 20, 2016 @09:44PM (#13226423)
Yep, I saw your more general list further upthread as well. I'd argue that much of the time these things are bad and essentially a kind of unnecessary, self-inflicted cryptography. In most cases the same things can be accomplished with a secure authenticated channel, someone hanging on to the relevant state and a cryptographically secure random id. A prime example is all the 'state-carrying authenticated/encrypted session cookie' infrastructure typically built into ruby and python web frameworks.