asn1oct: add a couple more tests
authortb <tb@openbsd.org>
Fri, 12 May 2023 10:43:28 +0000 (10:43 +0000)
committertb <tb@openbsd.org>
Fri, 12 May 2023 10:43:28 +0000 (10:43 +0000)
regress/lib/libcrypto/asn1/asn1oct.c

index a61e6ed..fef312d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: asn1oct.c,v 1.2 2023/05/12 08:56:05 tb Exp $ */
+/*     $OpenBSD: asn1oct.c,v 1.3 2023/05/12 10:43:28 tb Exp $ */
 
 /*
  * Copyright (c) 2023 Theo Buehler <tb@openbsd.org>
@@ -155,6 +155,11 @@ static const struct s2i_asn1_octet_string_test {
                .in = "",
                .want = "",
        },
+       {
+               .desc = "only colons",
+               .in = ":::::::",
+               .want = "",
+       },
        {
                .desc = "a 0 octet",
                .in = "00",
@@ -205,6 +210,10 @@ static const struct s2i_asn1_octet_string_test {
                .desc = "non-hex digit",
                .in = "g00d",
        },
+       {
+               .desc = "non-hex digits",
+               .in = "d0gged",
+       },
        {
                .desc = "trailing non-hex digit",
                .in = "d00der",