Add a few more testcases for X509v3_asid_subset()
authortb <tb@openbsd.org>
Thu, 12 May 2022 10:12:18 +0000 (10:12 +0000)
committertb <tb@openbsd.org>
Thu, 12 May 2022 10:12:18 +0000 (10:12 +0000)
regress/lib/libcrypto/x509/rfc3779/rfc3779.c

index d9b3007..c6d268b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: rfc3779.c,v 1.6 2022/01/07 22:46:05 tb Exp $ */
+/*     $OpenBSD: rfc3779.c,v 1.7 2022/05/12 10:12:18 tb Exp $ */
 /*
  * Copyright (c) 2021 Theo Buehler <tb@openbsd.org>
  *
@@ -1539,6 +1539,149 @@ const struct ASIdentifiers_subset_test ASIdentifiers_subset_data[] = {
                .is_subset = 1,
                .is_subset_if_canonized = 1,
        },
+#if 0
+       {
+               .description = "only asnums",
+               .delegationsA = {
+                       {
+                               .type = V3_ASID_ASNUM,
+                               .inherit = 0,
+                               .min = "2",
+                               .max = "4",
+                       },
+                       {
+                               .type = V3_ASID_END,
+                       },
+               },
+               .delegationsB = {
+                       {
+                               .type = V3_ASID_ASNUM,
+                               .inherit = 0,
+                               .min = "1",
+                               .max = "5",
+                       },
+                       {
+                               .type = V3_ASID_END,
+                       },
+               },
+               .is_subset = 1,
+               .is_subset_if_canonized = 1,
+       },
+       {
+               .description = "only rdis",
+               .delegationsA = {
+                       {
+                               .type = V3_ASID_RDI,
+                               .inherit = 0,
+                               .min = "2",
+                               .max = NULL,
+                       },
+                       {
+                               .type = V3_ASID_END,
+                       },
+               },
+               .delegationsB = {
+                       {
+                               .type = V3_ASID_RDI,
+                               .inherit = 0,
+                               .min = "1",
+                               .max = "5",
+                       },
+                       {
+                               .type = V3_ASID_END,
+                       },
+               },
+               .is_subset = 1,
+               .is_subset_if_canonized = 1,
+       },
+       {
+               .description = "child only has asnums, parent only has rdis",
+               .delegationsA = {
+                       {
+                               .type = V3_ASID_ASNUM,
+                               .inherit = 0,
+                               .min = "2",
+                               .max = "4",
+                       },
+                       {
+                               .type = V3_ASID_END,
+                       },
+               },
+               .delegationsB = {
+                       {
+                               .type = V3_ASID_RDI,
+                               .inherit = 0,
+                               .min = "1",
+                               .max = "5",
+                       },
+                       {
+                               .type = V3_ASID_END,
+                       },
+               },
+               .is_subset = 0,
+               .is_subset_if_canonized = 0,
+       },
+       {
+               .description = "child only has rdis, parent only has asnums",
+               .delegationsA = {
+                       {
+                               .type = V3_ASID_RDI,
+                               .inherit = 0,
+                               .min = "2",
+                               .max = "4",
+                       },
+                       {
+                               .type = V3_ASID_END,
+                       },
+               },
+               .delegationsB = {
+                       {
+                               .type = V3_ASID_ASNUM,
+                               .inherit = 0,
+                               .min = "1",
+                               .max = "5",
+                       },
+                       {
+                               .type = V3_ASID_END,
+                       },
+               },
+               .is_subset = 0,
+               .is_subset_if_canonized = 0,
+       },
+       {
+               .description = "child only has rdis, parent has both",
+               .delegationsA = {
+                       {
+                               .type = V3_ASID_RDI,
+                               .inherit = 0,
+                               .min = "2",
+                               .max = "4",
+                       },
+                       {
+                               .type = V3_ASID_END,
+                       },
+               },
+               .delegationsB = {
+                       {
+                               .type = V3_ASID_ASNUM,
+                               .inherit = 0,
+                               .min = "1",
+                               .max = "5",
+                       },
+                       {
+                               .type = V3_ASID_RDI,
+                               .inherit = 0,
+                               .min = "1",
+                               .max = "5",
+                       },
+                       {
+                               .type = V3_ASID_END,
+                       },
+               },
+               .is_subset = 1,
+               .is_subset_if_canonized = 1,
+       },
+#endif
        {
                .description = "subset relation only after canonization",
                .delegationsA = {