if(crit) *crit = found_ex->critical;
if(crit) *crit = X509_EXTENSION_get_critical(found_ex);
void *X509V3_get_d2i(STACK_OF(X509_EXTENSION) *x, int nid, int *crit, int *idx){	int lastpos, i;	X509_EXTENSION *ex, *found_ex = NULL;	if(!x) {		if(idx) *idx = -1;		if(crit) *crit = -1;		return NULL;	}	if(idx) lastpos = *idx + 1;	else lastpos = 0;	if(lastpos < 0) lastpos = 0;	for(i = lastpos; i < sk_X509_EXTENSION_num(x); i++)	{		ex = sk_X509_EXTENSION_value(x, i);		if(OBJ_obj2nid(ex->object) == nid) {			if(idx) {				*idx = i;				break;			} else if(found_ex) {				/* Found more than one */				if(crit) *crit = -2;				return NULL;			}			found_ex = ex;		}	}	if(found_ex) {		/* Found it */		if(crit) *crit = found_ex->critical;		return X509V3_EXT_d2i(found_ex);	}	/* Extension not found */	if(idx) *idx = -1;	if(crit) *crit = -1;	return NULL;}