Skip to content

Commit e63b517

Browse files
author
Shigeki Ohtsu
committed
crypto: fix to check ext method for shared lib
In the case of using openssl with shared library, reinterpret_cast<X509V3_EXT_I2V>(i2v_GENERAL_NAMES)) refers plt pointer so that SafeX509ExtPrint returns false. Fix it to check it with method of NID_subject_alt_name This patch originally was created by Fedor Indutny and Ben Noordhuis Fixes: #617 PR-URL: #800 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Fedor Indutny <[email protected]>
1 parent 15d156e commit e63b517

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/node_crypto.cc

+1-7
Original file line numberDiff line numberDiff line change
@@ -1099,15 +1099,9 @@ void SSLWrap<Base>::OnClientHello(void* arg,
10991099

11001100

11011101
static bool SafeX509ExtPrint(BIO* out, X509_EXTENSION* ext) {
1102-
// Only alt_name is escaped at the moment
1103-
if (OBJ_obj2nid(ext->object) != NID_subject_alt_name)
1104-
return false;
1105-
11061102
const X509V3_EXT_METHOD* method = X509V3_EXT_get(ext);
1107-
if (method == NULL || method->it == NULL)
1108-
return false;
11091103

1110-
if (method->i2v != reinterpret_cast<X509V3_EXT_I2V>(i2v_GENERAL_NAMES))
1104+
if (method != X509V3_EXT_get_nid(NID_subject_alt_name))
11111105
return false;
11121106

11131107
const unsigned char* p = ext->value->data;

0 commit comments

Comments
 (0)