DIST_POINT* DistributionPoint::getDistPoint()
{
	DIST_POINT *ret;
	bool anyReasons;
	int i;
	ret = DIST_POINT_new();
	if (this->distributionPointName.getType() != DistributionPointName::UNDEFINED)
	{
		ret->distpoint = this->distributionPointName.getDistPointName();
	}
	anyReasons = false;
	i = 0;
	while (!anyReasons && i<7)
	{
		if (this->reasons[i])
		{
			anyReasons = true;
		}
		i++;
	}
	if (anyReasons)
	{
		ret->reasons = ASN1_BIT_STRING_new();
		for (i=0;i<7;i++)
		{
			ASN1_BIT_STRING_set_bit(ret->reasons, i, this->reasons[i]?1:0);
		}
	}
	if (this->crlIssuer.getNumberOfEntries() > 0)
	{
		ret->CRLissuer = this->crlIssuer.getInternalGeneralNames();
	}
	return ret;
}
Beispiel #2
0
	}
	if (first)
		BIO_puts(out, "<EMPTY>\n");
	else
		BIO_puts(out, "\n");
	return 1;
}

static DIST_POINT *
crldp_from_section(X509V3_CTX *ctx, STACK_OF(CONF_VALUE) *nval)
{
	int i;
	CONF_VALUE *cnf;
	DIST_POINT *point = NULL;

	point = DIST_POINT_new();
	if (!point)
		goto err;
	for (i = 0; i < sk_CONF_VALUE_num(nval); i++) {
		int ret;
		cnf = sk_CONF_VALUE_value(nval, i);
		ret = set_dist_point_name(&point->distpoint, ctx, cnf);
		if (ret > 0)
			continue;
		if (ret < 0)
			goto err;
		if (!strcmp(cnf->name, "reasons")) {
			if (!set_reasons(&point->reasons, cnf->value))
				goto err;
		}
		else if (!strcmp(cnf->name, "CRLissuer")) {