Esempio n. 1
0
/*
 * compare two ocsp locations for equality
 */
static bool
same_ocsp_location(const ocsp_location_t *a, const ocsp_location_t *b)
{
    return ((a->authKeyID.ptr != NULL)
		? same_keyid(a->authKeyID, b->authKeyID)
		: (same_dn(a->issuer, b->issuer)
		    && same_serial(a->authKeySerialNumber, b->authKeySerialNumber)))
	    && same_chunk(a->uri, b->uri);
}
err_t
scep_parse_response(chunk_t response, chunk_t transID, contentInfo_t *data
, scep_attributes_t *attrs, x509cert_t *signer_cert)
{
    chunk_t attributes;

    if (!pkcs7_parse_signedData(response, data, NULL, &attributes, signer_cert))
    {
	return "error parsing the scep response";
    }
    if (!parse_attributes(attributes, attrs))
    {
	return "error parsing the scep response attributes";
    }
    if (!same_chunk(transID, attrs->transID))
    {
	return "transaction ID of scep response does not match";
    }
    return NULL;
}