Skip to content

Commit 6584569

Browse files
committed
add another OID testcase for root-node 3
1 parent 4ffdb91 commit 6584569

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/der_test.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ static void der_set_test(void)
676676
static void _der_oid_test(void)
677677
{
678678
static const unsigned char oid_x690_8_19_5_example[] = { 0x06, 0x03, 0x88, 0x37, 0x03 };
679-
unsigned long len;
679+
unsigned long len, oid[3];
680680
unsigned char buf[64];
681681

682682
ltc_asn1_list *decoded_list, static_list[1];
@@ -691,6 +691,14 @@ static void _der_oid_test(void)
691691

692692
DO(do_compare_testvector(buf, len, oid_x690_8_19_5_example, sizeof(oid_x690_8_19_5_example), "OID X6.90 Ch. 8.19.5 Example", 0));
693693

694+
oid[0] = 3;
695+
oid[1] = 4;
696+
oid[2] = 5;
697+
698+
len = sizeof(buf);
699+
SHOULD_FAIL(der_encode_object_identifier(oid, 3, buf, &len));
700+
len = sizeof(buf);
701+
SHOULD_FAIL(der_length_object_identifier(oid, 3, &len));
694702
}
695703

696704
static void der_flexi_test(void)

0 commit comments

Comments
 (0)