static int idp_check_scope(X509 *x, X509_CRL *crl, int *pimatch)
	{
	int i;
	if (crl->idp_flags & IDP_ONLYATTR)
		return 0;
	if (x->ex_flags & EXFLAG_CA)
		{
		if (crl->idp_flags & IDP_ONLYUSER)
			return 0;
		}
	else
		{
		if (crl->idp_flags & IDP_ONLYCA)
			return 0;
		}
	if (!crl->idp->distpoint && *pimatch)
		return 1;
	for (i = 0; i < sk_DIST_POINT_num(x->crldp); i++)
		{
		DIST_POINT *dp = sk_DIST_POINT_value(x->crldp, i);
		/* We don't handle these at present */
		if (dp->reasons)
			continue;
		if (idp_check_dp(dp->distpoint, crl->idp->distpoint))
			{
			if (idp_check_crlissuer(dp, crl, pimatch))
				return 1;
			}
		}
	return 0;
	}