Repository navigation
crypto: expose certificate decoding function - #30675
sam-github wants to merge 1 commit into
Conversation
|
I am not a big fan of this format, but I am afraid we might have to stick to it. |
|
@tniessen Can you think of a better name? So, a couple +'s, so I should finish this off? |
|
And yeah, I don't love the legacy format either, but its what we have until someone adds another. |
|
+1 to getting this in. For future changes, perhaps add an options argument that accepts a |
There was a problem hiding this comment.
Couple of width/sign issues here: buf.length() returns a size_t, d2i_X509 takes an int. Suggestion:
size_t data_len = buf.length();
CHECK_LE(data_len, INT_MAX);There was a problem hiding this comment.
Style/local consistency: no braces, ditto on line 2219.
In general, I think JavaScript and Node.js are leaning towards verbosity, so I think |
|
Existing uses of |
8326473 to
8d8f6d1
Compare
8d8f6d1 to
2a14032
Compare
2a14032 to
70e7ec6
Compare
8ae28ff to
2935f72
Compare
|
@sam-github did this get closed for any particular reason? It's not merged in yet, right? |
Format is the same as:
No docs or tests yet, @nodejs/crypto, I'll finish this if we want it.
Its easy, it just exposes current data format of the tls APIs, and makes testing whether certificates can be decoded quite easy, rather than having to round-trip them through TLS just to get a parsed cert :-(.
Maybe some other format would be better, and then it could be added to tls and crypto, but starting with a "better" format in crypto that is different from what tls does seems like it would increase inconsistency.
Fixes: #29181
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes