#include <assert.h>
#include <string.h>
+#include <openssl/err.h>
#include <openssl/objects.h>
#include <openssl/stack.h>
#include <openssl/x509v3.h>
#include "x509_internal.h"
#include "x509_local.h"
+/* XXX move to proper place */
+#define X509_R_INVALID_POLICY_EXTENSION 201
// This file computes the X.509 policy tree, as described in RFC 5280, section
// 6.1. It differs in that:
// certificatePolicies may not be empty. See RFC 5280, section 4.2.1.4.
// TODO(https://crbug.com/boringssl/443): Move this check into the parser.
if (sk_POLICYINFO_num(policies) == 0) {
- OPENSSL_PUT_ERROR(X509, X509_R_INVALID_POLICY_EXTENSION);
+ X509error(X509_R_INVALID_POLICY_EXTENSION);
goto err;
}
if (i > 0 && OBJ_cmp(sk_POLICYINFO_value(policies, i - 1)->policyid,
policy->policyid) == 0) {
// Per RFC 5280, section 4.2.1.4, |policies| may not have duplicates.
- OPENSSL_PUT_ERROR(X509, X509_R_INVALID_POLICY_EXTENSION);
+ X509error(X509_R_INVALID_POLICY_EXTENSION);
goto err;
}
}
// PolicyMappings may not be empty. See RFC 5280, section 4.2.1.5.
// TODO(https://crbug.com/boringssl/443): Move this check into the parser.
if (sk_POLICY_MAPPING_num(mappings) == 0) {
- OPENSSL_PUT_ERROR(X509, X509_R_INVALID_POLICY_EXTENSION);
+ X509error(X509_R_INVALID_POLICY_EXTENSION);
goto err;
}
// TODO(https://crbug.com/boringssl/443): Move this check into the parser.
if (skip_certs->type & V_ASN1_NEG) {
- OPENSSL_PUT_ERROR(X509, X509_R_INVALID_POLICY_EXTENSION);
+ X509error(X509_R_INVALID_POLICY_EXTENSION);
return 0;
}
constraints->inhibitPolicyMapping == NULL) {
// Per RFC 5280, section 4.2.1.11, at least one of the fields must be
// present.
- OPENSSL_PUT_ERROR(X509, X509_R_INVALID_POLICY_EXTENSION);
+ X509error(X509_R_INVALID_POLICY_EXTENSION);
POLICY_CONSTRAINTS_free(constraints);
return 0;
}