Revise regress for ascii/text to ASN.1 object conversion rewrite.
authorjsing <jsing@openbsd.org>
Sat, 19 Mar 2022 17:37:10 +0000 (17:37 +0000)
committerjsing <jsing@openbsd.org>
Sat, 19 Mar 2022 17:37:10 +0000 (17:37 +0000)
regress/lib/libcrypto/asn1/asn1object.c

index ccaad4e..4427225 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: asn1object.c,v 1.5 2022/03/19 16:23:17 jsing Exp $ */
+/* $OpenBSD: asn1object.c,v 1.6 2022/03/19 17:37:10 jsing Exp $ */
 /*
  * Copyright (c) 2017, 2021, 2022 Joel Sing <jsing@openbsd.org>
  *
@@ -118,18 +118,6 @@ struct asn1_object_test asn1_object_tests[] = {
                },
                .der_len = 5,
        },
-       {
-               .oid = "2.5 4.10",
-               .txt = "organizationName",
-               .content = {
-                       0x55, 0x04, 0x0a,
-               },
-               .content_len = 3,
-               .der = {
-                       0x06, 0x03, 0x55, 0x04, 0x0a,
-               },
-               .der_len = 5,
-       },
        {
                .oid = "2.5.0.0",
                .txt = "2.5.0.0",
@@ -170,63 +158,23 @@ struct asn1_object_test asn1_object_tests[] = {
        },
        {
                .oid = "2.00005.0000000000004.10",
-               .content = {
-                       0x55, 0x04, 0x0a,
-               },
-               .content_len = 3,
-               .der = {
-                       0x06, 0x03, 0x55, 0x04, 0x0a,
-               },
-               .der_len = 5,
-               .want_error = 0, /* XXX */
+               .want_error = ASN1_R_INVALID_NUMBER,
        },
        {
                .oid = "2..5.4.10",
-               .content = {
-                       0x50, 0x05, 0x04, 0x0a,
-               },
-               .content_len = 4,
-               .der = {
-                       0x06, 0x04, 0x50, 0x05, 0x04, 0x0a,
-               },
-               .der_len = 6,
-               .want_error = 0, /* XXX */
+               .want_error = ASN1_R_INVALID_NUMBER,
        },
        {
                .oid = "2.5..4.10",
-               .content = {
-                       0x55, 0x00, 0x04, 0x0a,
-               },
-               .content_len = 4,
-               .der = {
-                       0x06, 0x04, 0x55, 0x00, 0x04, 0x0a,
-               },
-               .der_len = 6,
-               .want_error = 0, /* XXX */
+               .want_error = ASN1_R_INVALID_NUMBER,
        },
        {
                .oid = "2.5.4..10",
-               .content = {
-                       0x55, 0x04, 0x00, 0x0a,
-               },
-               .content_len = 4,
-               .der = {
-                       0x06, 0x04, 0x55, 0x04, 0x00, 0x0a,
-               },
-               .der_len = 6,
-               .want_error = 0, /* XXX */
+               .want_error = ASN1_R_INVALID_NUMBER,
        },
        {
                .oid = "2.5.4.10.",
-               .content = {
-                       0x55, 0x04, 0x0a,
-               },
-               .content_len = 3,
-               .der = {
-                       0x06, 0x03, 0x55, 0x04, 0x0a,
-               },
-               .der_len = 5,
-               .want_error = 0, /* XXX */
+               .want_error = ASN1_R_INVALID_NUMBER,
        },
        {
                .oid = "3.5.4.10",
@@ -244,6 +192,10 @@ struct asn1_object_test asn1_object_tests[] = {
                .oid = "2",
                .want_error = ASN1_R_MISSING_SECOND_NUMBER,
        },
+       {
+               .oid = "2.5 4.10",
+               .want_error = ASN1_R_INVALID_SEPARATOR,
+       },
        {
                .oid = "2,5,4,10",
                .want_error = ASN1_R_INVALID_SEPARATOR,