const X509V3_EXT_METHOD *X509V3_EXT_get_nid(int nid)
{
	X509V3_EXT_METHOD tmp;
	const X509V3_EXT_METHOD *t = &tmp, * const *ret;
	int idx;
	if(nid < 0) return NULL;
	tmp.ext_nid = nid;
	ret = OBJ_bsearch_ext(&t, standard_exts, STANDARD_EXTENSION_COUNT);
	if(ret) return *ret;
	if(!ext_list) return NULL;
	idx = sk_X509V3_EXT_METHOD_find(ext_list, &tmp);
	if(idx == -1) return NULL;
	return sk_X509V3_EXT_METHOD_value(ext_list, idx);
}