Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit af63b38

Browse filesBrowse files
davidbenMylesBorins
authored andcommitted
crypto: use X509V3_EXT_d2i
There is no need to reach into quite so many internals to decode an extension. PR-URL: #15348 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 6b08128 commit af63b38
Copy full SHA for af63b38

File tree

Expand file treeCollapse file tree

1 file changed

+1
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-6
lines changed
Open diff view settings
Collapse file

‎src/node_crypto.cc‎

Copy file name to clipboardExpand all lines: src/node_crypto.cc
+1-6Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,12 +1463,7 @@ static bool SafeX509ExtPrint(BIO* out, X509_EXTENSION* ext) {
14631463
if (method != X509V3_EXT_get_nid(NID_subject_alt_name))
14641464
return false;
14651465

1466-
const unsigned char* p = ext->value->data;
1467-
GENERAL_NAMES* names = reinterpret_cast<GENERAL_NAMES*>(ASN1_item_d2i(
1468-
NULL,
1469-
&p,
1470-
ext->value->length,
1471-
ASN1_ITEM_ptr(method->it)));
1466+
GENERAL_NAMES* names = static_cast<GENERAL_NAMES*>(X509V3_EXT_d2i(ext));
14721467
if (names == NULL)
14731468
return false;
14741469

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.