Closed chjj closed 8 years ago
Nice!
@indutny, what do you make of the parse errors (minus the lines of code below the "XXX" comments). The RFC is implemented correctly, but I will still get errors on certain certs (including the test cert included).
@chjj could you please try to reduce the problem to a minimal test case?
Fixed style concerns and implemented the rest of the CRL extensions.
And yeah, I will try to isolate the issue more.
Added a cert chain to test with.
Everything is working except for the lines below the "XXX Workaround for parse error" comments. Not sure why. may be a problem with the cert, or something internal within asn1.js. One thing is for sure: this schema abides by the specification correctly.
@chjj also, the patch does not seem to apply to master branch anymore :( Could you please squash it and rebase?
@chjj ? ;)
@chjj ping?
@chjj pang? :)
chjj's extension parsing has been used in #47
Most of this functionality has been merged into master now.
NOTE: This is a work in progress.
This implements 17 TBSCertificate Extensions as laid out in rfc5280: http://www.ietf.org/rfc/rfc5280.txt
This also adds all string types to the DER encoder/decoder aside from a few which I couldn't find much documentation on.
It ultimately adds an `rfc5280.decodeExtensions(cert, ...)' function which can parse all extensions of a TBSCert and returns an object potentially containing all 17 standardized extensions, decoded.
I'm still receiving parse errors on certain certificates. You may see my old debugging code in past commits. I receive a parse error on the test cert itself, so I'll have to do some more debugging. I hope there is not a problem with the core DER decoder (I tried to obey the specification perfectly, but on the cert chain I was testing on, I was receiving parse errors. You will see some "XXX" comments noting workarounds for the parse errors I was receiving. The lines of code below those comments did not exist prior trying to workaround parse errors, and the cert chain I was testing on is completely valid).
I still have to work on tests.