Skip to content

Commit a69a443

Browse files
committed
crypto: use X509V3_EXT_d2i
There is no need to reach into quite so many internals to decode an extension.
1 parent 488cab1 commit a69a443

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

src/node_crypto.cc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,12 +1483,7 @@ static bool SafeX509ExtPrint(BIO* out, X509_EXTENSION* ext) {
14831483
if (method != X509V3_EXT_get_nid(NID_subject_alt_name))
14841484
return false;
14851485

1486-
const unsigned char* p = ext->value->data;
1487-
GENERAL_NAMES* names = reinterpret_cast<GENERAL_NAMES*>(ASN1_item_d2i(
1488-
NULL,
1489-
&p,
1490-
ext->value->length,
1491-
ASN1_ITEM_ptr(method->it)));
1486+
GENERAL_NAMES* names = static_cast<GENERAL_NAMES*>(X509V3_EXT_d2i(ext));
14921487
if (names == NULL)
14931488
return false;
14941489

0 commit comments

Comments
 (0)