diff --git a/src/crypto/crypto_common.cc b/src/crypto/crypto_common.cc index c6120a655ec853..3517c39ad0b71a 100644 --- a/src/crypto/crypto_common.cc +++ b/src/crypto/crypto_common.cc @@ -815,8 +815,7 @@ static bool PrintGeneralName(const BIOPointer& out, const GENERAL_NAME* gen) { } bool SafeX509SubjectAltNamePrint(const BIOPointer& out, X509_EXTENSION* ext) { - const X509V3_EXT_METHOD* method = X509V3_EXT_get(ext); - CHECK(method == X509V3_EXT_get_nid(NID_subject_alt_name)); + CHECK_EQ(OBJ_obj2nid(X509_EXTENSION_get_object(ext)), NID_subject_alt_name); GENERAL_NAMES* names = static_cast(X509V3_EXT_d2i(ext)); if (names == nullptr) @@ -840,8 +839,7 @@ bool SafeX509SubjectAltNamePrint(const BIOPointer& out, X509_EXTENSION* ext) { } bool SafeX509InfoAccessPrint(const BIOPointer& out, X509_EXTENSION* ext) { - const X509V3_EXT_METHOD* method = X509V3_EXT_get(ext); - CHECK(method == X509V3_EXT_get_nid(NID_info_access)); + CHECK_EQ(OBJ_obj2nid(X509_EXTENSION_get_object(ext)), NID_info_access); AUTHORITY_INFO_ACCESS* descs = static_cast(X509V3_EXT_d2i(ext));