2 * Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
11 * Implementation of RFC 3779 section 3.2.
17 #include "internal/cryptlib.h"
18 #include <openssl/conf.h>
19 #include <openssl/asn1.h>
20 #include <openssl/asn1t.h>
21 #include <openssl/x509v3.h>
22 #include <openssl/x509.h>
23 #include "internal/x509_int.h"
24 #include <openssl/bn.h>
27 #ifndef OPENSSL_NO_RFC3779
30 * OpenSSL ASN.1 template translation of RFC 3779 3.2.3.
33 ASN1_SEQUENCE(ASRange) = {
34 ASN1_SIMPLE(ASRange, min, ASN1_INTEGER),
35 ASN1_SIMPLE(ASRange, max, ASN1_INTEGER)
36 } ASN1_SEQUENCE_END(ASRange)
38 ASN1_CHOICE(ASIdOrRange) = {
39 ASN1_SIMPLE(ASIdOrRange, u.id, ASN1_INTEGER),
40 ASN1_SIMPLE(ASIdOrRange, u.range, ASRange)
41 } ASN1_CHOICE_END(ASIdOrRange)
43 ASN1_CHOICE(ASIdentifierChoice) = {
44 ASN1_SIMPLE(ASIdentifierChoice, u.inherit, ASN1_NULL),
45 ASN1_SEQUENCE_OF(ASIdentifierChoice, u.asIdsOrRanges, ASIdOrRange)
46 } ASN1_CHOICE_END(ASIdentifierChoice)
48 ASN1_SEQUENCE(ASIdentifiers) = {
49 ASN1_EXP_OPT(ASIdentifiers, asnum, ASIdentifierChoice, 0),
50 ASN1_EXP_OPT(ASIdentifiers, rdi, ASIdentifierChoice, 1)
51 } ASN1_SEQUENCE_END(ASIdentifiers)
53 IMPLEMENT_ASN1_FUNCTIONS(ASRange)
54 IMPLEMENT_ASN1_FUNCTIONS(ASIdOrRange)
55 IMPLEMENT_ASN1_FUNCTIONS(ASIdentifierChoice)
56 IMPLEMENT_ASN1_FUNCTIONS(ASIdentifiers)
59 * i2r method for an ASIdentifierChoice.
61 static int i2r_ASIdentifierChoice(BIO *out,
62 ASIdentifierChoice *choice,
63 int indent, const char *msg)
69 BIO_printf(out, "%*s%s:\n", indent, "", msg);
70 switch (choice->type) {
71 case ASIdentifierChoice_inherit:
72 BIO_printf(out, "%*sinherit\n", indent + 2, "");
74 case ASIdentifierChoice_asIdsOrRanges:
75 for (i = 0; i < sk_ASIdOrRange_num(choice->u.asIdsOrRanges); i++) {
77 sk_ASIdOrRange_value(choice->u.asIdsOrRanges, i);
80 if ((s = i2s_ASN1_INTEGER(NULL, aor->u.id)) == NULL)
82 BIO_printf(out, "%*s%s\n", indent + 2, "", s);
85 case ASIdOrRange_range:
86 if ((s = i2s_ASN1_INTEGER(NULL, aor->u.range->min)) == NULL)
88 BIO_printf(out, "%*s%s-", indent + 2, "", s);
90 if ((s = i2s_ASN1_INTEGER(NULL, aor->u.range->max)) == NULL)
92 BIO_printf(out, "%s\n", s);
107 * i2r method for an ASIdentifier extension.
109 static int i2r_ASIdentifiers(const X509V3_EXT_METHOD *method,
110 void *ext, BIO *out, int indent)
112 ASIdentifiers *asid = ext;
113 return (i2r_ASIdentifierChoice(out, asid->asnum, indent,
114 "Autonomous System Numbers") &&
115 i2r_ASIdentifierChoice(out, asid->rdi, indent,
116 "Routing Domain Identifiers"));
120 * Sort comparison function for a sequence of ASIdOrRange elements.
122 static int ASIdOrRange_cmp(const ASIdOrRange *const *a_,
123 const ASIdOrRange *const *b_)
125 const ASIdOrRange *a = *a_, *b = *b_;
127 assert((a->type == ASIdOrRange_id && a->u.id != NULL) ||
128 (a->type == ASIdOrRange_range && a->u.range != NULL &&
129 a->u.range->min != NULL && a->u.range->max != NULL));
131 assert((b->type == ASIdOrRange_id && b->u.id != NULL) ||
132 (b->type == ASIdOrRange_range && b->u.range != NULL &&
133 b->u.range->min != NULL && b->u.range->max != NULL));
135 if (a->type == ASIdOrRange_id && b->type == ASIdOrRange_id)
136 return ASN1_INTEGER_cmp(a->u.id, b->u.id);
138 if (a->type == ASIdOrRange_range && b->type == ASIdOrRange_range) {
139 int r = ASN1_INTEGER_cmp(a->u.range->min, b->u.range->min);
140 return r != 0 ? r : ASN1_INTEGER_cmp(a->u.range->max,
144 if (a->type == ASIdOrRange_id)
145 return ASN1_INTEGER_cmp(a->u.id, b->u.range->min);
147 return ASN1_INTEGER_cmp(a->u.range->min, b->u.id);
151 * Add an inherit element.
153 int X509v3_asid_add_inherit(ASIdentifiers *asid, int which)
155 ASIdentifierChoice **choice;
160 choice = &asid->asnum;
168 if (*choice == NULL) {
169 if ((*choice = ASIdentifierChoice_new()) == NULL)
171 if (((*choice)->u.inherit = ASN1_NULL_new()) == NULL)
173 (*choice)->type = ASIdentifierChoice_inherit;
175 return (*choice)->type == ASIdentifierChoice_inherit;
179 * Add an ID or range to an ASIdentifierChoice.
181 int X509v3_asid_add_id_or_range(ASIdentifiers *asid,
182 int which, ASN1_INTEGER *min, ASN1_INTEGER *max)
184 ASIdentifierChoice **choice;
190 choice = &asid->asnum;
198 if (*choice != NULL && (*choice)->type == ASIdentifierChoice_inherit)
200 if (*choice == NULL) {
201 if ((*choice = ASIdentifierChoice_new()) == NULL)
203 (*choice)->u.asIdsOrRanges = sk_ASIdOrRange_new(ASIdOrRange_cmp);
204 if ((*choice)->u.asIdsOrRanges == NULL)
206 (*choice)->type = ASIdentifierChoice_asIdsOrRanges;
208 if ((aor = ASIdOrRange_new()) == NULL)
211 aor->type = ASIdOrRange_id;
214 aor->type = ASIdOrRange_range;
215 if ((aor->u.range = ASRange_new()) == NULL)
217 ASN1_INTEGER_free(aor->u.range->min);
218 aor->u.range->min = min;
219 ASN1_INTEGER_free(aor->u.range->max);
220 aor->u.range->max = max;
222 if (!(sk_ASIdOrRange_push((*choice)->u.asIdsOrRanges, aor)))
227 ASIdOrRange_free(aor);
232 * Extract min and max values from an ASIdOrRange.
234 static int extract_min_max(ASIdOrRange *aor,
235 ASN1_INTEGER **min, ASN1_INTEGER **max)
237 if (!ossl_assert(aor != NULL))
244 case ASIdOrRange_range:
245 *min = aor->u.range->min;
246 *max = aor->u.range->max;
254 * Check whether an ASIdentifierChoice is in canonical form.
256 static int ASIdentifierChoice_is_canonical(ASIdentifierChoice *choice)
258 ASN1_INTEGER *a_max_plus_one = NULL;
263 * Empty element or inheritance is canonical.
265 if (choice == NULL || choice->type == ASIdentifierChoice_inherit)
269 * If not a list, or if empty list, it's broken.
271 if (choice->type != ASIdentifierChoice_asIdsOrRanges ||
272 sk_ASIdOrRange_num(choice->u.asIdsOrRanges) == 0)
276 * It's a list, check it.
278 for (i = 0; i < sk_ASIdOrRange_num(choice->u.asIdsOrRanges) - 1; i++) {
279 ASIdOrRange *a = sk_ASIdOrRange_value(choice->u.asIdsOrRanges, i);
280 ASIdOrRange *b = sk_ASIdOrRange_value(choice->u.asIdsOrRanges, i + 1);
281 ASN1_INTEGER *a_min = NULL, *a_max = NULL, *b_min = NULL, *b_max =
284 if (!extract_min_max(a, &a_min, &a_max)
285 || !extract_min_max(b, &b_min, &b_max))
289 * Punt misordered list, overlapping start, or inverted range.
291 if (ASN1_INTEGER_cmp(a_min, b_min) >= 0 ||
292 ASN1_INTEGER_cmp(a_min, a_max) > 0 ||
293 ASN1_INTEGER_cmp(b_min, b_max) > 0)
297 * Calculate a_max + 1 to check for adjacency.
299 if ((bn == NULL && (bn = BN_new()) == NULL) ||
300 ASN1_INTEGER_to_BN(a_max, bn) == NULL ||
301 !BN_add_word(bn, 1) ||
303 BN_to_ASN1_INTEGER(bn, a_max_plus_one)) == NULL) {
304 X509V3err(X509V3_F_ASIDENTIFIERCHOICE_IS_CANONICAL,
305 ERR_R_MALLOC_FAILURE);
310 * Punt if adjacent or overlapping.
312 if (ASN1_INTEGER_cmp(a_max_plus_one, b_min) >= 0)
317 * Check for inverted range.
319 i = sk_ASIdOrRange_num(choice->u.asIdsOrRanges) - 1;
321 ASIdOrRange *a = sk_ASIdOrRange_value(choice->u.asIdsOrRanges, i);
322 ASN1_INTEGER *a_min, *a_max;
323 if (a != NULL && a->type == ASIdOrRange_range) {
324 if (!extract_min_max(a, &a_min, &a_max)
325 || ASN1_INTEGER_cmp(a_min, a_max) > 0)
333 ASN1_INTEGER_free(a_max_plus_one);
339 * Check whether an ASIdentifier extension is in canonical form.
341 int X509v3_asid_is_canonical(ASIdentifiers *asid)
343 return (asid == NULL ||
344 (ASIdentifierChoice_is_canonical(asid->asnum) &&
345 ASIdentifierChoice_is_canonical(asid->rdi)));
349 * Whack an ASIdentifierChoice into canonical form.
351 static int ASIdentifierChoice_canonize(ASIdentifierChoice *choice)
353 ASN1_INTEGER *a_max_plus_one = NULL;
358 * Nothing to do for empty element or inheritance.
360 if (choice == NULL || choice->type == ASIdentifierChoice_inherit)
364 * If not a list, or if empty list, it's broken.
366 if (choice->type != ASIdentifierChoice_asIdsOrRanges ||
367 sk_ASIdOrRange_num(choice->u.asIdsOrRanges) == 0) {
368 X509V3err(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE,
369 X509V3_R_EXTENSION_VALUE_ERROR);
374 * We have a non-empty list. Sort it.
376 sk_ASIdOrRange_sort(choice->u.asIdsOrRanges);
379 * Now check for errors and suboptimal encoding, rejecting the
380 * former and fixing the latter.
382 for (i = 0; i < sk_ASIdOrRange_num(choice->u.asIdsOrRanges) - 1; i++) {
383 ASIdOrRange *a = sk_ASIdOrRange_value(choice->u.asIdsOrRanges, i);
384 ASIdOrRange *b = sk_ASIdOrRange_value(choice->u.asIdsOrRanges, i + 1);
385 ASN1_INTEGER *a_min = NULL, *a_max = NULL, *b_min = NULL, *b_max =
388 if (!extract_min_max(a, &a_min, &a_max)
389 || !extract_min_max(b, &b_min, &b_max))
393 * Make sure we're properly sorted (paranoia).
395 if (!ossl_assert(ASN1_INTEGER_cmp(a_min, b_min) <= 0))
399 * Punt inverted ranges.
401 if (ASN1_INTEGER_cmp(a_min, a_max) > 0 ||
402 ASN1_INTEGER_cmp(b_min, b_max) > 0)
406 * Check for overlaps.
408 if (ASN1_INTEGER_cmp(a_max, b_min) >= 0) {
409 X509V3err(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE,
410 X509V3_R_EXTENSION_VALUE_ERROR);
415 * Calculate a_max + 1 to check for adjacency.
417 if ((bn == NULL && (bn = BN_new()) == NULL) ||
418 ASN1_INTEGER_to_BN(a_max, bn) == NULL ||
419 !BN_add_word(bn, 1) ||
421 BN_to_ASN1_INTEGER(bn, a_max_plus_one)) == NULL) {
422 X509V3err(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE,
423 ERR_R_MALLOC_FAILURE);
428 * If a and b are adjacent, merge them.
430 if (ASN1_INTEGER_cmp(a_max_plus_one, b_min) == 0) {
434 if ((r = OPENSSL_malloc(sizeof(*r))) == NULL) {
435 X509V3err(X509V3_F_ASIDENTIFIERCHOICE_CANONIZE,
436 ERR_R_MALLOC_FAILURE);
441 a->type = ASIdOrRange_range;
444 case ASIdOrRange_range:
445 ASN1_INTEGER_free(a->u.range->max);
446 a->u.range->max = b_max;
453 case ASIdOrRange_range:
454 b->u.range->max = NULL;
458 (void)sk_ASIdOrRange_delete(choice->u.asIdsOrRanges, i + 1);
465 * Check for final inverted range.
467 i = sk_ASIdOrRange_num(choice->u.asIdsOrRanges) - 1;
469 ASIdOrRange *a = sk_ASIdOrRange_value(choice->u.asIdsOrRanges, i);
470 ASN1_INTEGER *a_min, *a_max;
471 if (a != NULL && a->type == ASIdOrRange_range) {
472 if (!extract_min_max(a, &a_min, &a_max)
473 || ASN1_INTEGER_cmp(a_min, a_max) > 0)
479 if (!ossl_assert(ASIdentifierChoice_is_canonical(choice)))
485 ASN1_INTEGER_free(a_max_plus_one);
491 * Whack an ASIdentifier extension into canonical form.
493 int X509v3_asid_canonize(ASIdentifiers *asid)
495 return (asid == NULL ||
496 (ASIdentifierChoice_canonize(asid->asnum) &&
497 ASIdentifierChoice_canonize(asid->rdi)));
501 * v2i method for an ASIdentifier extension.
503 static void *v2i_ASIdentifiers(const struct v3_ext_method *method,
504 struct v3_ext_ctx *ctx,
505 STACK_OF(CONF_VALUE) *values)
507 ASN1_INTEGER *min = NULL, *max = NULL;
508 ASIdentifiers *asid = NULL;
511 if ((asid = ASIdentifiers_new()) == NULL) {
512 X509V3err(X509V3_F_V2I_ASIDENTIFIERS, ERR_R_MALLOC_FAILURE);
516 for (i = 0; i < sk_CONF_VALUE_num(values); i++) {
517 CONF_VALUE *val = sk_CONF_VALUE_value(values, i);
518 int i1 = 0, i2 = 0, i3 = 0, is_range = 0, which = 0;
521 * Figure out whether this is an AS or an RDI.
523 if (!name_cmp(val->name, "AS")) {
524 which = V3_ASID_ASNUM;
525 } else if (!name_cmp(val->name, "RDI")) {
528 X509V3err(X509V3_F_V2I_ASIDENTIFIERS,
529 X509V3_R_EXTENSION_NAME_ERROR);
530 X509V3_conf_err(val);
535 * Handle inheritance.
537 if (strcmp(val->value, "inherit") == 0) {
538 if (X509v3_asid_add_inherit(asid, which))
540 X509V3err(X509V3_F_V2I_ASIDENTIFIERS,
541 X509V3_R_INVALID_INHERITANCE);
542 X509V3_conf_err(val);
547 * Number, range, or mistake, pick it apart and figure out which.
549 i1 = strspn(val->value, "0123456789");
550 if (val->value[i1] == '\0') {
554 i2 = i1 + strspn(val->value + i1, " \t");
555 if (val->value[i2] != '-') {
556 X509V3err(X509V3_F_V2I_ASIDENTIFIERS,
557 X509V3_R_INVALID_ASNUMBER);
558 X509V3_conf_err(val);
562 i2 = i2 + strspn(val->value + i2, " \t");
563 i3 = i2 + strspn(val->value + i2, "0123456789");
564 if (val->value[i3] != '\0') {
565 X509V3err(X509V3_F_V2I_ASIDENTIFIERS,
566 X509V3_R_INVALID_ASRANGE);
567 X509V3_conf_err(val);
573 * Syntax is ok, read and add it.
576 if (!X509V3_get_value_int(val, &min)) {
577 X509V3err(X509V3_F_V2I_ASIDENTIFIERS, ERR_R_MALLOC_FAILURE);
581 char *s = OPENSSL_strdup(val->value);
583 X509V3err(X509V3_F_V2I_ASIDENTIFIERS, ERR_R_MALLOC_FAILURE);
587 min = s2i_ASN1_INTEGER(NULL, s);
588 max = s2i_ASN1_INTEGER(NULL, s + i2);
590 if (min == NULL || max == NULL) {
591 X509V3err(X509V3_F_V2I_ASIDENTIFIERS, ERR_R_MALLOC_FAILURE);
594 if (ASN1_INTEGER_cmp(min, max) > 0) {
595 X509V3err(X509V3_F_V2I_ASIDENTIFIERS,
596 X509V3_R_EXTENSION_VALUE_ERROR);
600 if (!X509v3_asid_add_id_or_range(asid, which, min, max)) {
601 X509V3err(X509V3_F_V2I_ASIDENTIFIERS, ERR_R_MALLOC_FAILURE);
608 * Canonize the result, then we're done.
610 if (!X509v3_asid_canonize(asid))
615 ASIdentifiers_free(asid);
616 ASN1_INTEGER_free(min);
617 ASN1_INTEGER_free(max);
624 const X509V3_EXT_METHOD v3_asid = {
625 NID_sbgp_autonomousSysNum, /* nid */
627 ASN1_ITEM_ref(ASIdentifiers), /* template */
628 0, 0, 0, 0, /* old functions, ignored */
632 v2i_ASIdentifiers, /* v2i */
633 i2r_ASIdentifiers, /* i2r */
635 NULL /* extension-specific data */
639 * Figure out whether extension uses inheritance.
641 int X509v3_asid_inherits(ASIdentifiers *asid)
643 return (asid != NULL &&
644 ((asid->asnum != NULL &&
645 asid->asnum->type == ASIdentifierChoice_inherit) ||
646 (asid->rdi != NULL &&
647 asid->rdi->type == ASIdentifierChoice_inherit)));
651 * Figure out whether parent contains child.
653 static int asid_contains(ASIdOrRanges *parent, ASIdOrRanges *child)
655 ASN1_INTEGER *p_min = NULL, *p_max = NULL, *c_min = NULL, *c_max = NULL;
658 if (child == NULL || parent == child)
664 for (c = 0; c < sk_ASIdOrRange_num(child); c++) {
665 if (!extract_min_max(sk_ASIdOrRange_value(child, c), &c_min, &c_max))
668 if (p >= sk_ASIdOrRange_num(parent))
670 if (!extract_min_max(sk_ASIdOrRange_value(parent, p), &p_min,
673 if (ASN1_INTEGER_cmp(p_max, c_max) < 0)
675 if (ASN1_INTEGER_cmp(p_min, c_min) > 0)
685 * Test whether a is a subset of b.
687 int X509v3_asid_subset(ASIdentifiers *a, ASIdentifiers *b)
692 !X509v3_asid_inherits(a) &&
693 !X509v3_asid_inherits(b) &&
694 asid_contains(b->asnum->u.asIdsOrRanges,
695 a->asnum->u.asIdsOrRanges) &&
696 asid_contains(b->rdi->u.asIdsOrRanges,
697 a->rdi->u.asIdsOrRanges)));
701 * Validation error handling via callback.
703 #define validation_err(_err_) \
706 ctx->error = _err_; \
707 ctx->error_depth = i; \
708 ctx->current_cert = x; \
709 ret = ctx->verify_cb(0, ctx); \
718 * Core code for RFC 3779 3.3 path validation.
720 static int asid_validate_path_internal(X509_STORE_CTX *ctx,
721 STACK_OF(X509) *chain,
724 ASIdOrRanges *child_as = NULL, *child_rdi = NULL;
725 int i, ret = 1, inherit_as = 0, inherit_rdi = 0;
728 if (!ossl_assert(chain != NULL && sk_X509_num(chain) > 0)
729 || !ossl_assert(ctx != NULL || ext != NULL)
730 || !ossl_assert(ctx == NULL || ctx->verify_cb != NULL)) {
732 ctx->error = X509_V_ERR_UNSPECIFIED;
738 * Figure out where to start. If we don't have an extension to
739 * check, we're done. Otherwise, check canonical form and
740 * set up for walking up the chain.
747 x = sk_X509_value(chain, i);
748 if ((ext = x->rfc3779_asid) == NULL)
751 if (!X509v3_asid_is_canonical(ext))
752 validation_err(X509_V_ERR_INVALID_EXTENSION);
753 if (ext->asnum != NULL) {
754 switch (ext->asnum->type) {
755 case ASIdentifierChoice_inherit:
758 case ASIdentifierChoice_asIdsOrRanges:
759 child_as = ext->asnum->u.asIdsOrRanges;
763 if (ext->rdi != NULL) {
764 switch (ext->rdi->type) {
765 case ASIdentifierChoice_inherit:
768 case ASIdentifierChoice_asIdsOrRanges:
769 child_rdi = ext->rdi->u.asIdsOrRanges;
775 * Now walk up the chain. Extensions must be in canonical form, no
776 * cert may list resources that its parent doesn't list.
778 for (i++; i < sk_X509_num(chain); i++) {
779 x = sk_X509_value(chain, i);
780 if (!ossl_assert(x != NULL)) {
782 ctx->error = X509_V_ERR_UNSPECIFIED;
785 if (x->rfc3779_asid == NULL) {
786 if (child_as != NULL || child_rdi != NULL)
787 validation_err(X509_V_ERR_UNNESTED_RESOURCE);
790 if (!X509v3_asid_is_canonical(x->rfc3779_asid))
791 validation_err(X509_V_ERR_INVALID_EXTENSION);
792 if (x->rfc3779_asid->asnum == NULL && child_as != NULL) {
793 validation_err(X509_V_ERR_UNNESTED_RESOURCE);
797 if (x->rfc3779_asid->asnum != NULL &&
798 x->rfc3779_asid->asnum->type ==
799 ASIdentifierChoice_asIdsOrRanges) {
801 || asid_contains(x->rfc3779_asid->asnum->u.asIdsOrRanges,
803 child_as = x->rfc3779_asid->asnum->u.asIdsOrRanges;
806 validation_err(X509_V_ERR_UNNESTED_RESOURCE);
809 if (x->rfc3779_asid->rdi == NULL && child_rdi != NULL) {
810 validation_err(X509_V_ERR_UNNESTED_RESOURCE);
814 if (x->rfc3779_asid->rdi != NULL &&
815 x->rfc3779_asid->rdi->type == ASIdentifierChoice_asIdsOrRanges) {
817 asid_contains(x->rfc3779_asid->rdi->u.asIdsOrRanges,
819 child_rdi = x->rfc3779_asid->rdi->u.asIdsOrRanges;
822 validation_err(X509_V_ERR_UNNESTED_RESOURCE);
828 * Trust anchor can't inherit.
830 if (!ossl_assert(x != NULL)) {
832 ctx->error = X509_V_ERR_UNSPECIFIED;
835 if (x->rfc3779_asid != NULL) {
836 if (x->rfc3779_asid->asnum != NULL &&
837 x->rfc3779_asid->asnum->type == ASIdentifierChoice_inherit)
838 validation_err(X509_V_ERR_UNNESTED_RESOURCE);
839 if (x->rfc3779_asid->rdi != NULL &&
840 x->rfc3779_asid->rdi->type == ASIdentifierChoice_inherit)
841 validation_err(X509_V_ERR_UNNESTED_RESOURCE);
848 #undef validation_err
851 * RFC 3779 3.3 path validation -- called from X509_verify_cert().
853 int X509v3_asid_validate_path(X509_STORE_CTX *ctx)
855 if (ctx->chain == NULL
856 || sk_X509_num(ctx->chain) == 0
857 || ctx->verify_cb == NULL) {
858 ctx->error = X509_V_ERR_UNSPECIFIED;
861 return asid_validate_path_internal(ctx, ctx->chain, NULL);
865 * RFC 3779 3.3 path validation of an extension.
866 * Test whether chain covers extension.
868 int X509v3_asid_validate_resource_set(STACK_OF(X509) *chain,
869 ASIdentifiers *ext, int allow_inheritance)
873 if (chain == NULL || sk_X509_num(chain) == 0)
875 if (!allow_inheritance && X509v3_asid_inherits(ext))
877 return asid_validate_path_internal(NULL, chain, ext);
880 #endif /* OPENSSL_NO_RFC3779 */