• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef CF_TEST_DATA_H
17 #define CF_TEST_DATA_H
18 
19 #include "cf_type.h"
20 
21 namespace CertframeworkTestData {
22 /* Cert object test data */
23 static const uint8_t g_certData01[] = { /* Der format with subjectUID and issuerUID */
24     0x30, 0x82, 0x03, 0x4c, 0x30, 0x82, 0x02, 0x34, 0xa0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x06, 0x20,
25     0x06, 0x05, 0x16, 0x70, 0x02, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01,
26     0x01, 0x05, 0x05, 0x00, 0x30, 0x3b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
27     0x02, 0x52, 0x4f, 0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x63, 0x65,
28     0x72, 0x74, 0x53, 0x49, 0x47, 0x4e, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13,
29     0x10, 0x63, 0x65, 0x72, 0x74, 0x53, 0x49, 0x47, 0x4e, 0x20, 0x52, 0x4f, 0x4f, 0x54, 0x20, 0x43,
30     0x41, 0x30, 0x1e, 0x17, 0x0d, 0x30, 0x36, 0x30, 0x37, 0x30, 0x34, 0x31, 0x37, 0x32, 0x30, 0x30,
31     0x34, 0x5a, 0x17, 0x0d, 0x33, 0x31, 0x30, 0x37, 0x30, 0x34, 0x31, 0x37, 0x32, 0x30, 0x30, 0x34,
32     0x5a, 0x30, 0x3b, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x52, 0x4f,
33     0x31, 0x11, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x08, 0x63, 0x65, 0x72, 0x74, 0x53,
34     0x49, 0x47, 0x4e, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x0b, 0x13, 0x10, 0x63, 0x65,
35     0x72, 0x74, 0x53, 0x49, 0x47, 0x4e, 0x20, 0x52, 0x4f, 0x4f, 0x54, 0x20, 0x43, 0x41, 0x30, 0x82,
36     0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05,
37     0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xb7,
38     0x33, 0xb9, 0x7e, 0xc8, 0x25, 0x4a, 0x8e, 0xb5, 0xdb, 0xb4, 0x28, 0x1b, 0xaa, 0x57, 0x90, 0xe8,
39     0xd1, 0x22, 0xd3, 0x64, 0xba, 0xd3, 0x93, 0xe8, 0xd4, 0xac, 0x86, 0x61, 0x40, 0x6a, 0x60, 0x57,
40     0x68, 0x54, 0x84, 0x4d, 0xbc, 0x6a, 0x54, 0x02, 0x05, 0xff, 0xdf, 0x9b, 0x9a, 0x2a, 0xae, 0x5d,
41     0x07, 0x8f, 0x4a, 0xc3, 0x28, 0x7f, 0xef, 0xfb, 0x2b, 0xfa, 0x79, 0xf1, 0xc7, 0xad, 0xf0, 0x10,
42     0x53, 0x24, 0x90, 0x8b, 0x66, 0xc9, 0xa8, 0x88, 0xab, 0xaf, 0x5a, 0xa3, 0x00, 0xe9, 0xbe, 0xba,
43     0x46, 0xee, 0x5b, 0x73, 0x7b, 0x2c, 0x17, 0x82, 0x81, 0x5e, 0x62, 0x2c, 0xa1, 0x02, 0x65, 0xb3,
44     0xbd, 0xc5, 0x2b, 0x00, 0x7e, 0xc4, 0xfc, 0x03, 0x33, 0x57, 0x0d, 0xed, 0xe2, 0xfa, 0xce, 0x5d,
45     0x45, 0xd6, 0x38, 0xcd, 0x35, 0xb6, 0xb2, 0xc1, 0xd0, 0x9c, 0x81, 0x4a, 0xaa, 0xe4, 0xb2, 0x01,
46     0x5c, 0x1d, 0x8f, 0x5f, 0x99, 0xc4, 0xb1, 0xad, 0xdb, 0x88, 0x21, 0xeb, 0x90, 0x08, 0x82, 0x80,
47     0xf3, 0x30, 0xa3, 0x43, 0xe6, 0x90, 0x82, 0xae, 0x55, 0x28, 0x49, 0xed, 0x5b, 0xd7, 0xa9, 0x10,
48     0x38, 0x0e, 0xfe, 0x8f, 0x4c, 0x5b, 0x9b, 0x46, 0xea, 0x41, 0xf5, 0xb0, 0x08, 0x74, 0xc3, 0xd0,
49     0x88, 0x33, 0xb6, 0x7c, 0xd7, 0x74, 0xdf, 0xdc, 0x84, 0xd1, 0x43, 0x0e, 0x75, 0x39, 0xa1, 0x25,
50     0x40, 0x28, 0xea, 0x78, 0xcb, 0x0e, 0x2c, 0x2e, 0x39, 0x9d, 0x8c, 0x8b, 0x6e, 0x16, 0x1c, 0x2f,
51     0x26, 0x82, 0x10, 0xe2, 0xe3, 0x65, 0x94, 0x0a, 0x04, 0xc0, 0x5e, 0xf7, 0x5d, 0x5b, 0xf8, 0x10,
52     0xe2, 0xd0, 0xba, 0x7a, 0x4b, 0xfb, 0xde, 0x37, 0x00, 0x00, 0x1a, 0x5b, 0x28, 0xe3, 0xd2, 0x9c,
53     0x73, 0x3e, 0x32, 0x87, 0x98, 0xa1, 0xc9, 0x51, 0x2f, 0xd7, 0xde, 0xac, 0x33, 0xb3, 0x4f, 0x02,
54     0x03, 0x01, 0x00, 0x01, 0xa1, 0x08, 0x03, 0x06, 0x01, 0x01, 0x00, 0x4D, 0x57, 0x12, 0xa2, 0x08,
55     0x03, 0x06, 0x01, 0x02, 0x03, 0x4D, 0x57, 0x12, 0xa3, 0x42, 0x30, 0x40, 0x30, 0x0f, 0x06, 0x03,
56     0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0e, 0x06,
57     0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01, 0xc6, 0x30, 0x1d, 0x06,
58     0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xe0, 0x8c, 0x9b, 0xdb, 0x25, 0x49, 0xb3, 0xf1,
59     0x7c, 0x86, 0xd6, 0xb2, 0x42, 0x87, 0x0b, 0xd0, 0x6b, 0xa0, 0xd9, 0xe4, 0x30, 0x0d, 0x06, 0x09,
60     0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x05, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00,
61     0x3e, 0xd2, 0x1c, 0x89, 0x2e, 0x35, 0xfc, 0xf8, 0x75, 0xdd, 0xe6, 0x7f, 0x65, 0x88, 0xf4, 0x72,
62     0x4c, 0xc9, 0x2c, 0xd7, 0x32, 0x4e, 0xf3, 0xdd, 0x19, 0x79, 0x47, 0xbd, 0x8e, 0x3b, 0x5b, 0x93,
63     0x0f, 0x50, 0x49, 0x24, 0x13, 0x6b, 0x14, 0x06, 0x72, 0xef, 0x09, 0xd3, 0xa1, 0xa1, 0xe3, 0x40,
64     0x84, 0xc9, 0xe7, 0x18, 0x32, 0x74, 0x3c, 0x48, 0x6e, 0x0f, 0x9f, 0x4b, 0xd4, 0xf7, 0x1e, 0xd3,
65     0x93, 0x86, 0x64, 0x54, 0x97, 0x63, 0x72, 0x50, 0xd5, 0x55, 0xcf, 0xfa, 0x20, 0x93, 0x02, 0xa2,
66     0x9b, 0xc3, 0x23, 0x93, 0x4e, 0x16, 0x55, 0x76, 0xa0, 0x70, 0x79, 0x6d, 0xcd, 0x21, 0x1f, 0xcf,
67     0x2f, 0x2d, 0xbc, 0x19, 0xe3, 0x88, 0x31, 0xf8, 0x59, 0x1a, 0x81, 0x09, 0xc8, 0x97, 0xa6, 0x74,
68     0xc7, 0x60, 0xc4, 0x5b, 0xcc, 0x57, 0x8e, 0xb2, 0x75, 0xfd, 0x1b, 0x02, 0x09, 0xdb, 0x59, 0x6f,
69     0x72, 0x93, 0x69, 0xf7, 0x31, 0x41, 0xd6, 0x88, 0x38, 0xbf, 0x87, 0xb2, 0xbd, 0x16, 0x79, 0xf9,
70     0xaa, 0xe4, 0xbe, 0x88, 0x25, 0xdd, 0x61, 0x27, 0x23, 0x1c, 0xb5, 0x31, 0x07, 0x04, 0x36, 0xb4,
71     0x1a, 0x90, 0xbd, 0xa0, 0x74, 0x71, 0x50, 0x89, 0x6d, 0xbc, 0x14, 0xe3, 0x0f, 0x86, 0xae, 0xf1,
72     0xab, 0x3e, 0xc7, 0xa0, 0x09, 0xcc, 0xa3, 0x48, 0xd1, 0xe0, 0xdb, 0x64, 0xe7, 0x92, 0xb5, 0xcf,
73     0xaf, 0x72, 0x43, 0x70, 0x8b, 0xf9, 0xc3, 0x84, 0x3c, 0x13, 0xaa, 0x7e, 0x92, 0x9b, 0x57, 0x53,
74     0x93, 0xfa, 0x70, 0xc2, 0x91, 0x0e, 0x31, 0xf9, 0x9b, 0x67, 0x5d, 0xe9, 0x96, 0x38, 0x5e, 0x5f,
75     0xb3, 0x73, 0x4e, 0x88, 0x15, 0x67, 0xde, 0x9e, 0x76, 0x10, 0x62, 0x20, 0xbe, 0x55, 0x69, 0x95,
76     0x43, 0x00, 0x39, 0x4d, 0xf6, 0xee, 0xb0, 0x5a, 0x4e, 0x49, 0x44, 0x54, 0x58, 0x5f, 0x42, 0x83
77 };
78 
79 static const uint8_t g_certData01TBS[] = { /* Der format */
80     0x30, 0x82, 0x02, 0x30, 0xA0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x06, 0x20, 0x06, 0x05, 0x16, 0x70,
81     0x02, 0x30, 0x0D, 0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x05, 0x05, 0x00,
82     0x30, 0x3B, 0x31, 0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x52, 0x4F, 0x31,
83     0x11, 0x30, 0x0F, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x13, 0x08, 0x63, 0x65, 0x72, 0x74, 0x53, 0x49,
84     0x47, 0x4E, 0x31, 0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x13, 0x10, 0x63, 0x65, 0x72,
85     0x74, 0x53, 0x49, 0x47, 0x4E, 0x20, 0x52, 0x4F, 0x4F, 0x54, 0x20, 0x43, 0x41, 0x30, 0x1E, 0x17,
86     0x0D, 0x30, 0x36, 0x30, 0x37, 0x30, 0x34, 0x31, 0x37, 0x32, 0x30, 0x30, 0x34, 0x5A, 0x17, 0x0D,
87     0x33, 0x31, 0x30, 0x37, 0x30, 0x34, 0x31, 0x37, 0x32, 0x30, 0x30, 0x34, 0x5A, 0x30, 0x3B, 0x31,
88     0x0B, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x52, 0x4F, 0x31, 0x11, 0x30, 0x0F,
89     0x06, 0x03, 0x55, 0x04, 0x0A, 0x13, 0x08, 0x63, 0x65, 0x72, 0x74, 0x53, 0x49, 0x47, 0x4E, 0x31,
90     0x19, 0x30, 0x17, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x13, 0x10, 0x63, 0x65, 0x72, 0x74, 0x53, 0x49,
91     0x47, 0x4E, 0x20, 0x52, 0x4F, 0x4F, 0x54, 0x20, 0x43, 0x41, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0D,
92     0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01,
93     0x0F, 0x00, 0x30, 0x82, 0x01, 0x0A, 0x02, 0x82, 0x01, 0x01, 0x00, 0xB7, 0x33, 0xB9, 0x7E, 0xC8,
94     0x25, 0x4A, 0x8E, 0xB5, 0xDB, 0xB4, 0x28, 0x1B, 0xAA, 0x57, 0x90, 0xE8, 0xD1, 0x22, 0xD3, 0x64,
95     0xBA, 0xD3, 0x93, 0xE8, 0xD4, 0xAC, 0x86, 0x61, 0x40, 0x6A, 0x60, 0x57, 0x68, 0x54, 0x84, 0x4D,
96     0xBC, 0x6A, 0x54, 0x02, 0x05, 0xFF, 0xDF, 0x9B, 0x9A, 0x2A, 0xAE, 0x5D, 0x07, 0x8F, 0x4A, 0xC3,
97     0x28, 0x7F, 0xEF, 0xFB, 0x2B, 0xFA, 0x79, 0xF1, 0xC7, 0xAD, 0xF0, 0x10, 0x53, 0x24, 0x90, 0x8B,
98     0x66, 0xC9, 0xA8, 0x88, 0xAB, 0xAF, 0x5A, 0xA3, 0x00, 0xE9, 0xBE, 0xBA, 0x46, 0xEE, 0x5B, 0x73,
99     0x7B, 0x2C, 0x17, 0x82, 0x81, 0x5E, 0x62, 0x2C, 0xA1, 0x02, 0x65, 0xB3, 0xBD, 0xC5, 0x2B, 0x00,
100     0x7E, 0xC4, 0xFC, 0x03, 0x33, 0x57, 0x0D, 0xED, 0xE2, 0xFA, 0xCE, 0x5D, 0x45, 0xD6, 0x38, 0xCD,
101     0x35, 0xB6, 0xB2, 0xC1, 0xD0, 0x9C, 0x81, 0x4A, 0xAA, 0xE4, 0xB2, 0x01, 0x5C, 0x1D, 0x8F, 0x5F,
102     0x99, 0xC4, 0xB1, 0xAD, 0xDB, 0x88, 0x21, 0xEB, 0x90, 0x08, 0x82, 0x80, 0xF3, 0x30, 0xA3, 0x43,
103     0xE6, 0x90, 0x82, 0xAE, 0x55, 0x28, 0x49, 0xED, 0x5B, 0xD7, 0xA9, 0x10, 0x38, 0x0E, 0xFE, 0x8F,
104     0x4C, 0x5B, 0x9B, 0x46, 0xEA, 0x41, 0xF5, 0xB0, 0x08, 0x74, 0xC3, 0xD0, 0x88, 0x33, 0xB6, 0x7C,
105     0xD7, 0x74, 0xDF, 0xDC, 0x84, 0xD1, 0x43, 0x0E, 0x75, 0x39, 0xA1, 0x25, 0x40, 0x28, 0xEA, 0x78,
106     0xCB, 0x0E, 0x2C, 0x2E, 0x39, 0x9D, 0x8C, 0x8B, 0x6E, 0x16, 0x1C, 0x2F, 0x26, 0x82, 0x10, 0xE2,
107     0xE3, 0x65, 0x94, 0x0A, 0x04, 0xC0, 0x5E, 0xF7, 0x5D, 0x5B, 0xF8, 0x10, 0xE2, 0xD0, 0xBA, 0x7A,
108     0x4B, 0xFB, 0xDE, 0x37, 0x00, 0x00, 0x1A, 0x5B, 0x28, 0xE3, 0xD2, 0x9C, 0x73, 0x3E, 0x32, 0x87,
109     0x98, 0xA1, 0xC9, 0x51, 0x2F, 0xD7, 0xDE, 0xAC, 0x33, 0xB3, 0x4F, 0x02, 0x03, 0x01, 0x00, 0x01,
110     0x81, 0x06, 0x01, 0x01, 0x00, 0x4D, 0x57, 0x12, 0x82, 0x06, 0x01, 0x02, 0x03, 0x4D, 0x57, 0x12,
111     0xA3, 0x42, 0x30, 0x40, 0x30, 0x0F, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x01, 0x01, 0xFF, 0x04, 0x05,
112     0x30, 0x03, 0x01, 0x01, 0xFF, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x1D, 0x0F, 0x01, 0x01, 0xFF, 0x04,
113     0x04, 0x03, 0x02, 0x01, 0xC6, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x0E, 0x04, 0x16, 0x04, 0x14,
114     0xE0, 0x8C, 0x9B, 0xDB, 0x25, 0x49, 0xB3, 0xF1, 0x7C, 0x86, 0xD6, 0xB2, 0x42, 0x87, 0x0B, 0xD0,
115     0x6B, 0xA0, 0xD9, 0xE4
116 };
117 
118 static const uint8_t g_certData01IssuerUID[] = { /* Der format */
119     0x03, 0x06, 0x01, 0x01, 0x00, 0x4D, 0x57, 0x12
120 };
121 
122 static const uint8_t g_certData01SubjectUID[] = { /* Der format */
123     0x03, 0x06, 0x01, 0x02, 0x03, 0x4D, 0x57, 0x12
124 };
125 
126 static const uint8_t g_certData01PubKey[] = {
127     0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01,
128     0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30, 0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01,
129     0x00, 0xb7, 0x33, 0xb9, 0x7e, 0xc8, 0x25, 0x4a, 0x8e, 0xb5, 0xdb, 0xb4, 0x28, 0x1b, 0xaa, 0x57,
130     0x90, 0xe8, 0xd1, 0x22, 0xd3, 0x64, 0xba, 0xd3, 0x93, 0xe8, 0xd4, 0xac, 0x86, 0x61, 0x40, 0x6a,
131     0x60, 0x57, 0x68, 0x54, 0x84, 0x4d, 0xbc, 0x6a, 0x54, 0x02, 0x05, 0xff, 0xdf, 0x9b, 0x9a, 0x2a,
132     0xae, 0x5d, 0x07, 0x8f, 0x4a, 0xc3, 0x28, 0x7f, 0xef, 0xfb, 0x2b, 0xfa, 0x79, 0xf1, 0xc7, 0xad,
133     0xf0, 0x10, 0x53, 0x24, 0x90, 0x8b, 0x66, 0xc9, 0xa8, 0x88, 0xab, 0xaf, 0x5a, 0xa3, 0x00, 0xe9,
134     0xbe, 0xba, 0x46, 0xee, 0x5b, 0x73, 0x7b, 0x2c, 0x17, 0x82, 0x81, 0x5e, 0x62, 0x2c, 0xa1, 0x02,
135     0x65, 0xb3, 0xbd, 0xc5, 0x2b, 0x00, 0x7e, 0xc4, 0xfc, 0x03, 0x33, 0x57, 0x0d, 0xed, 0xe2, 0xfa,
136     0xce, 0x5d, 0x45, 0xd6, 0x38, 0xcd, 0x35, 0xb6, 0xb2, 0xc1, 0xd0, 0x9c, 0x81, 0x4a, 0xaa, 0xe4,
137     0xb2, 0x01, 0x5c, 0x1d, 0x8f, 0x5f, 0x99, 0xc4, 0xb1, 0xad, 0xdb, 0x88, 0x21, 0xeb, 0x90, 0x08,
138     0x82, 0x80, 0xf3, 0x30, 0xa3, 0x43, 0xe6, 0x90, 0x82, 0xae, 0x55, 0x28, 0x49, 0xed, 0x5b, 0xd7,
139     0xa9, 0x10, 0x38, 0x0e, 0xfe, 0x8f, 0x4c, 0x5b, 0x9b, 0x46, 0xea, 0x41, 0xf5, 0xb0, 0x08, 0x74,
140     0xc3, 0xd0, 0x88, 0x33, 0xb6, 0x7c, 0xd7, 0x74, 0xdf, 0xdc, 0x84, 0xd1, 0x43, 0x0e, 0x75, 0x39,
141     0xa1, 0x25, 0x40, 0x28, 0xea, 0x78, 0xcb, 0x0e, 0x2c, 0x2e, 0x39, 0x9d, 0x8c, 0x8b, 0x6e, 0x16,
142     0x1c, 0x2f, 0x26, 0x82, 0x10, 0xe2, 0xe3, 0x65, 0x94, 0x0a, 0x04, 0xc0, 0x5e, 0xf7, 0x5d, 0x5b,
143     0xf8, 0x10, 0xe2, 0xd0, 0xba, 0x7a, 0x4b, 0xfb, 0xde, 0x37, 0x00, 0x00, 0x1a, 0x5b, 0x28, 0xe3,
144     0xd2, 0x9c, 0x73, 0x3e, 0x32, 0x87, 0x98, 0xa1, 0xc9, 0x51, 0x2f, 0xd7, 0xde, 0xac, 0x33, 0xb3,
145     0x4f, 0x02, 0x03, 0x01, 0x00, 0x01,
146 };
147 
148 static char g_certData02[] = /* Pem format without subjectUID and issuerUID */
149 "-----BEGIN CERTIFICATE-----\r\n"
150 "MIID/jCCAuagAwIBAgIBATANBgkqhkiG9w0BAQsFADCBjDELMAkGA1UEBhMCQ04x\r\n"
151 "ETAPBgNVBAgMCHNoYW5naGFpMQ8wDQYDVQQHDAZodWF3ZWkxFTATBgNVBAoMDHd3\r\n"
152 "dy50ZXN0LmNvbTENMAsGA1UECwwEdGVzdDEVMBMGA1UEAwwMd3d3LnRlc3QuY29t\r\n"
153 "MRwwGgYJKoZIhvcNAQkBFg10ZXN0QHRlc3QuY29tMB4XDTIyMDgyOTA2NTUwM1oX\r\n"
154 "DTIzMDgyOTA2NTUwM1owezELMAkGA1UEBhMCQ04xETAPBgNVBAgMCHNoYW5naGFp\r\n"
155 "MRUwEwYDVQQKDAx3d3cudGVzdC5jb20xDTALBgNVBAsMBHRlc3QxFTATBgNVBAMM\r\n"
156 "DHd3dy50ZXN0LmNvbTEcMBoGCSqGSIb3DQEJARYNdGVzdEB0ZXN0LmNvbTCCASIw\r\n"
157 "DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJmY9T4SzXXwKvfMvnvMWY7TqUJK\r\n"
158 "jnWf2Puv0YUQ2fdvyoKQ2LQXdtzoUL53j587oI+IXelOr7dg020zPyun0cmZHZ4y\r\n"
159 "l/qAcrWbDjZeEGcbbb5UtQtn1WOEnv8pkXluO355mbZQUKK9L3gFWseXJKGbIXw0\r\n"
160 "NRpaJZzqvPor4m3a5pmJKPHOlivUdYfLaKSkNj3DlaFzCWKV82k5ee6gzVyETtG+\r\n"
161 "XN+vq8qLybT+fIFsLNMmAHzRxlqz3NiH7yh+1/p/Knvf8bkkRVR2btH51RyX2RSu\r\n"
162 "DjPM0/VRL8fxDSDeWBq+Gvn/E6AbOVMmkx63tcyWHhklCSaZtyz7kq39TQMCAwEA\r\n"
163 "AaN7MHkwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0\r\n"
164 "ZWQgQ2VydGlmaWNhdGUwHQYDVR0OBBYEFFiFDysfADQCzRZCOSPupQxFicwzMB8G\r\n"
165 "A1UdIwQYMBaAFNYQRQiPsG8HefOTsmsVhaVjY7IPMA0GCSqGSIb3DQEBCwUAA4IB\r\n"
166 "AQAeppxf6sKQJxJQXKPTT3xHKaskidNwDBbOSIvnVvWXicZXDs+1sF6tUaRgvPxL\r\n"
167 "OL58+P2Jy0tfSwj2WhqQRGe9MvQ5iFHcdelZc0ciW6EQ0VDHIaDAQc2nQzej/79w\r\n"
168 "UE7BJJV3b9n1be2iCsuodKO14pOkMb84WcIxng+8SD+MiFqV5BPO1QyKGdO1PE1b\r\n"
169 "+evjyTpFSTgZf2Mw3fGtu5hfEXyHw1lnsFY2MlSwiRlAym/gm4aXy+4H6LyXKd56\r\n"
170 "UYQ6fituD0ziaw3RI6liyIe7aENHCkZf6bAvMRhk4QiU4xu6emwX8Qt1bT7RthP0\r\n"
171 "1Vsro0IOeXT9WAcqEtQUegsi\r\n"
172 "-----END CERTIFICATE-----\r\n";
173 
174 static const uint8_t g_certData02Extension[] = { /* Der format */
175     0x30, 0x79, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x2C, 0x06,
176     0x09, 0x60, 0x86, 0x48, 0x01, 0x86, 0xF8, 0x42, 0x01, 0x0D, 0x04, 0x1F, 0x16, 0x1D, 0x4F, 0x70,
177     0x65, 0x6E, 0x53, 0x53, 0x4C, 0x20, 0x47, 0x65, 0x6E, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20,
178     0x43, 0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x30, 0x1D, 0x06, 0x03, 0x55,
179     0x1D, 0x0E, 0x04, 0x16, 0x04, 0x14, 0x58, 0x85, 0x0F, 0x2B, 0x1F, 0x00, 0x34, 0x02, 0xCD, 0x16,
180     0x42, 0x39, 0x23, 0xEE, 0xA5, 0x0C, 0x45, 0x89, 0xCC, 0x33, 0x30, 0x1F, 0x06, 0x03, 0x55, 0x1D,
181     0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xD6, 0x10, 0x45, 0x08, 0x8F, 0xB0, 0x6F, 0x07, 0x79,
182     0xF3, 0x93, 0xB2, 0x6B, 0x15, 0x85, 0xA5, 0x63, 0x63, 0xB2, 0x0F
183 };
184 
185 static const uint8_t g_certData02TBS[] = { /* Der format */
186     0x30, 0x82, 0x02, 0xE6, 0xA0, 0x03, 0x02, 0x01, 0x02, 0x02, 0x01, 0x01, 0x30, 0x0D, 0x06, 0x09,
187     0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x0B, 0x05, 0x00, 0x30, 0x81, 0x8C, 0x31, 0x0B,
188     0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4E, 0x31, 0x11, 0x30, 0x0F, 0x06,
189     0x03, 0x55, 0x04, 0x08, 0x0C, 0x08, 0x73, 0x68, 0x61, 0x6E, 0x67, 0x68, 0x61, 0x69, 0x31, 0x0F,
190     0x30, 0x0D, 0x06, 0x03, 0x55, 0x04, 0x07, 0x0C, 0x06, 0x68, 0x75, 0x61, 0x77, 0x65, 0x69, 0x31,
191     0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0C, 0x77, 0x77, 0x77, 0x2E, 0x74, 0x65,
192     0x73, 0x74, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x0D, 0x30, 0x0B, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C,
193     0x04, 0x74, 0x65, 0x73, 0x74, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0C,
194     0x77, 0x77, 0x77, 0x2E, 0x74, 0x65, 0x73, 0x74, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1C, 0x30, 0x1A,
195     0x06, 0x09, 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x0D, 0x74, 0x65, 0x73,
196     0x74, 0x40, 0x74, 0x65, 0x73, 0x74, 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x1E, 0x17, 0x0D, 0x32, 0x32,
197     0x30, 0x38, 0x32, 0x39, 0x30, 0x36, 0x35, 0x35, 0x30, 0x33, 0x5A, 0x17, 0x0D, 0x32, 0x33, 0x30,
198     0x38, 0x32, 0x39, 0x30, 0x36, 0x35, 0x35, 0x30, 0x33, 0x5A, 0x30, 0x7B, 0x31, 0x0B, 0x30, 0x09,
199     0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x4E, 0x31, 0x11, 0x30, 0x0F, 0x06, 0x03, 0x55,
200     0x04, 0x08, 0x0C, 0x08, 0x73, 0x68, 0x61, 0x6E, 0x67, 0x68, 0x61, 0x69, 0x31, 0x15, 0x30, 0x13,
201     0x06, 0x03, 0x55, 0x04, 0x0A, 0x0C, 0x0C, 0x77, 0x77, 0x77, 0x2E, 0x74, 0x65, 0x73, 0x74, 0x2E,
202     0x63, 0x6F, 0x6D, 0x31, 0x0D, 0x30, 0x0B, 0x06, 0x03, 0x55, 0x04, 0x0B, 0x0C, 0x04, 0x74, 0x65,
203     0x73, 0x74, 0x31, 0x15, 0x30, 0x13, 0x06, 0x03, 0x55, 0x04, 0x03, 0x0C, 0x0C, 0x77, 0x77, 0x77,
204     0x2E, 0x74, 0x65, 0x73, 0x74, 0x2E, 0x63, 0x6F, 0x6D, 0x31, 0x1C, 0x30, 0x1A, 0x06, 0x09, 0x2A,
205     0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x09, 0x01, 0x16, 0x0D, 0x74, 0x65, 0x73, 0x74, 0x40, 0x74,
206     0x65, 0x73, 0x74, 0x2E, 0x63, 0x6F, 0x6D, 0x30, 0x82, 0x01, 0x22, 0x30, 0x0D, 0x06, 0x09, 0x2A,
207     0x86, 0x48, 0x86, 0xF7, 0x0D, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0F, 0x00, 0x30,
208     0x82, 0x01, 0x0A, 0x02, 0x82, 0x01, 0x01, 0x00, 0x99, 0x98, 0xF5, 0x3E, 0x12, 0xCD, 0x75, 0xF0,
209     0x2A, 0xF7, 0xCC, 0xBE, 0x7B, 0xCC, 0x59, 0x8E, 0xD3, 0xA9, 0x42, 0x4A, 0x8E, 0x75, 0x9F, 0xD8,
210     0xFB, 0xAF, 0xD1, 0x85, 0x10, 0xD9, 0xF7, 0x6F, 0xCA, 0x82, 0x90, 0xD8, 0xB4, 0x17, 0x76, 0xDC,
211     0xE8, 0x50, 0xBE, 0x77, 0x8F, 0x9F, 0x3B, 0xA0, 0x8F, 0x88, 0x5D, 0xE9, 0x4E, 0xAF, 0xB7, 0x60,
212     0xD3, 0x6D, 0x33, 0x3F, 0x2B, 0xA7, 0xD1, 0xC9, 0x99, 0x1D, 0x9E, 0x32, 0x97, 0xFA, 0x80, 0x72,
213     0xB5, 0x9B, 0x0E, 0x36, 0x5E, 0x10, 0x67, 0x1B, 0x6D, 0xBE, 0x54, 0xB5, 0x0B, 0x67, 0xD5, 0x63,
214     0x84, 0x9E, 0xFF, 0x29, 0x91, 0x79, 0x6E, 0x3B, 0x7E, 0x79, 0x99, 0xB6, 0x50, 0x50, 0xA2, 0xBD,
215     0x2F, 0x78, 0x05, 0x5A, 0xC7, 0x97, 0x24, 0xA1, 0x9B, 0x21, 0x7C, 0x34, 0x35, 0x1A, 0x5A, 0x25,
216     0x9C, 0xEA, 0xBC, 0xFA, 0x2B, 0xE2, 0x6D, 0xDA, 0xE6, 0x99, 0x89, 0x28, 0xF1, 0xCE, 0x96, 0x2B,
217     0xD4, 0x75, 0x87, 0xCB, 0x68, 0xA4, 0xA4, 0x36, 0x3D, 0xC3, 0x95, 0xA1, 0x73, 0x09, 0x62, 0x95,
218     0xF3, 0x69, 0x39, 0x79, 0xEE, 0xA0, 0xCD, 0x5C, 0x84, 0x4E, 0xD1, 0xBE, 0x5C, 0xDF, 0xAF, 0xAB,
219     0xCA, 0x8B, 0xC9, 0xB4, 0xFE, 0x7C, 0x81, 0x6C, 0x2C, 0xD3, 0x26, 0x00, 0x7C, 0xD1, 0xC6, 0x5A,
220     0xB3, 0xDC, 0xD8, 0x87, 0xEF, 0x28, 0x7E, 0xD7, 0xFA, 0x7F, 0x2A, 0x7B, 0xDF, 0xF1, 0xB9, 0x24,
221     0x45, 0x54, 0x76, 0x6E, 0xD1, 0xF9, 0xD5, 0x1C, 0x97, 0xD9, 0x14, 0xAE, 0x0E, 0x33, 0xCC, 0xD3,
222     0xF5, 0x51, 0x2F, 0xC7, 0xF1, 0x0D, 0x20, 0xDE, 0x58, 0x1A, 0xBE, 0x1A, 0xF9, 0xFF, 0x13, 0xA0,
223     0x1B, 0x39, 0x53, 0x26, 0x93, 0x1E, 0xB7, 0xB5, 0xCC, 0x96, 0x1E, 0x19, 0x25, 0x09, 0x26, 0x99,
224     0xB7, 0x2C, 0xFB, 0x92, 0xAD, 0xFD, 0x4D, 0x03, 0x02, 0x03, 0x01, 0x00, 0x01, 0xA3, 0x7B, 0x30,
225     0x79, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x04, 0x02, 0x30, 0x00, 0x30, 0x2C, 0x06, 0x09,
226     0x60, 0x86, 0x48, 0x01, 0x86, 0xF8, 0x42, 0x01, 0x0D, 0x04, 0x1F, 0x16, 0x1D, 0x4F, 0x70, 0x65,
227     0x6E, 0x53, 0x53, 0x4C, 0x20, 0x47, 0x65, 0x6E, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x20, 0x43,
228     0x65, 0x72, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x65, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D,
229     0x0E, 0x04, 0x16, 0x04, 0x14, 0x58, 0x85, 0x0F, 0x2B, 0x1F, 0x00, 0x34, 0x02, 0xCD, 0x16, 0x42,
230     0x39, 0x23, 0xEE, 0xA5, 0x0C, 0x45, 0x89, 0xCC, 0x33, 0x30, 0x1F, 0x06, 0x03, 0x55, 0x1D, 0x23,
231     0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0xD6, 0x10, 0x45, 0x08, 0x8F, 0xB0, 0x6F, 0x07, 0x79, 0xF3,
232     0x93, 0xB2, 0x6B, 0x15, 0x85, 0xA5, 0x63, 0x63, 0xB2, 0x0F
233 };
234 
235 static const uint8_t g_certData03[] = {  /* invalid data */
236     0x56, 0x0c, 0xc8, 0x9a, 0x37, 0x8d, 0xf7, 0xf1, 0x36, 0x60, 0x4b, 0x26, 0x2c, 0x82, 0x9e, 0xd0,
237     0x75, 0x89, 0x8d, 0x51, 0xe4, 0xc3, 0x37, 0xd2, 0x8a, 0x88, 0x4d, 0x79, 0x1e, 0xb7, 0x12, 0xdd,
238     0x43, 0x78, 0x4a, 0x80
239 };
240 
241 /* Extension object test data */
242 static const uint8_t g_extensionData01[] = { /* the data gain from g_certData01 */
243     0x30, 0x40, 0x30, 0x0F, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x01, 0x01, 0xFF, 0x04, 0x05, 0x30, 0x03,
244     0x01, 0x01, 0xFF, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x1D, 0x0F, 0x01, 0x01, 0xFF, 0x04, 0x04, 0x03,
245     0x02, 0x01, 0xC6, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x0E, 0x04, 0x16, 0x04, 0x14, 0xE0, 0x8C,
246     0x9B, 0xDB, 0x25, 0x49, 0xB3, 0xF1, 0x7C, 0x86, 0xD6, 0xB2, 0x42, 0x87, 0x0B, 0xD0, 0x6B, 0xA0,
247     0xD9, 0xE4
248 };
249 
250 static const uint8_t g_extensionEntry01[] = { /* the data gain from g_extensionData01 */
251     0x30, 0x0F, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x01, 0x01, 0xFF, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01,
252     0xFF
253 };
254 static const uint8_t g_extensionEntryCritical01[] = { /* the data gain from g_extensionData01 */
255     0x01
256 };
257 static const uint8_t g_extensionEntryValue01[] = { /* the data gain from g_extensionData01 */
258     0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xFF
259 };
260 
261 static const uint8_t g_extensionData02[] = { /* Der format */
262     0x30, 0x81, 0x86, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30,
263     0x03, 0x01, 0x01, 0xff, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04, 0x03, 0x02, 0x01,
264     0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xa6, 0x91, 0x42, 0xfd,
265     0x13, 0x61, 0x4a, 0x23, 0x9e, 0x08, 0xa4, 0x29, 0xe5, 0xd8, 0x13, 0x04, 0x23, 0xee, 0x41, 0x25,
266     0x30, 0x47, 0x06, 0x03, 0x55, 0x1d, 0x1e, 0x04, 0x40, 0x30, 0x3e, 0xa0, 0x3c, 0x30, 0x05, 0x82,
267     0x03, 0x2e, 0x67, 0x72, 0x30, 0x05, 0x82, 0x03, 0x2e, 0x65, 0x75, 0x30, 0x06, 0x82, 0x04, 0x2e,
268     0x65, 0x64, 0x75, 0x30, 0x06, 0x82, 0x04, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x05, 0x81, 0x03, 0x2e,
269     0x67, 0x72, 0x30, 0x05, 0x81, 0x03, 0x2e, 0x65, 0x75, 0x30, 0x06, 0x81, 0x04, 0x2e, 0x65, 0x64,
270     0x75, 0x30, 0x06, 0x81, 0x04, 0x2e, 0x6f, 0x72, 0x67
271 };
272 
273 static const uint8_t g_extDataNoKeyUsage[] = { /* ext data not has keyusage */
274     0x30, 0x81, 0x79, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x05, 0x30,
275     0x03, 0x01, 0x01, 0xff, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0xa6,
276     0x91, 0x42, 0xfd, 0x13, 0x61, 0x4a, 0x23, 0x9e, 0x08, 0xa4, 0x29, 0xe5, 0xd8, 0x13, 0x04, 0x23,
277     0xee, 0x41, 0x25, 0x30, 0x47, 0x06, 0x03, 0x55, 0x1d, 0x1e, 0x04, 0x40, 0x30, 0x3e, 0xa0, 0x3c,
278     0x30, 0x05, 0x82, 0x03, 0x2e, 0x67, 0x72, 0x30, 0x05, 0x82, 0x03, 0x2e, 0x65, 0x75, 0x30, 0x06,
279     0x82, 0x04, 0x2e, 0x65, 0x64, 0x75, 0x30, 0x06, 0x82, 0x04, 0x2e, 0x6f, 0x72, 0x67, 0x30, 0x05,
280     0x81, 0x03, 0x2e, 0x67, 0x72, 0x30, 0x05, 0x81, 0x03, 0x2e, 0x65, 0x75, 0x30, 0x06, 0x81, 0x04,
281     0x2e, 0x65, 0x64, 0x75, 0x30, 0x06, 0x81, 0x04, 0x2e, 0x6f, 0x72, 0x67,
282 };
283 
284 static const uint8_t g_extensionData03[] = { /* Der format */
285     0x30, 0x81, 0xc6, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14, 0x8c, 0xa3,
286     0x3b, 0x42, 0x63, 0x01, 0xb3, 0x4d, 0x51, 0xf6, 0xe4, 0x2d, 0xb5, 0x83, 0x7f, 0x18, 0x39, 0x2f,
287     0xb7, 0xb5, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18, 0x30, 0x16, 0x80, 0x14, 0x8c,
288     0xa3, 0x3b, 0x42, 0x63, 0x01, 0xb3, 0x4d, 0x51, 0xf6, 0xe4, 0x2d, 0xb5, 0x83, 0x7f, 0x18, 0x39,
289     0x2f, 0xb7, 0xb5, 0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30,
290     0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x02, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x1d, 0x0f, 0x04, 0x04,
291     0x03, 0x02, 0x01, 0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x16, 0x30, 0x14, 0x06,
292     0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05,
293     0x07, 0x03, 0x02, 0x30, 0x21, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x1a, 0x30, 0x18, 0x81, 0x16,
294     0x63, 0x61, 0x40, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x66, 0x72, 0x61, 0x6d, 0x65, 0x77, 0x6f,
295     0x72, 0x6b, 0x2e, 0x63, 0x6f, 0x6d, 0x30, 0x21, 0x06, 0x03, 0x55, 0x1d, 0x12, 0x04, 0x1a, 0x30,
296     0x18, 0x81, 0x16, 0x63, 0x61, 0x40, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x66, 0x72, 0x61, 0x6d,
297     0x65, 0x77, 0x6f, 0x72, 0x6b, 0x2e, 0x63, 0x6f, 0x6d
298 };
299 
300 /* g_extensionData03
301     X509v3 extensions:
302         X509v3 Subject Key Identifier: (oid: 2.5.29.14)
303             8C:A3:3B:42:63:01:B3:4D:51:F6:E4:2D:B5:83:7F:18:39:2F:B7:B5
304         X509v3 Authority Key Identifier: (oid: 2.5.29.35)
305             keyid:8C:A3:3B:42:63:01:B3:4D:51:F6:E4:2D:B5:83:7F:18:39:2F:B7:B5
306 
307         X509v3 Basic Constraints: critical (oid: 2.5.29.19)
308             CA:TRUE, pathlen:2
309         X509v3 Key Usage: (oid: 2.5.29.15)
310             Certificate Sign, CRL Sign
311         X509v3 Extended Key Usage: (oid: 2.5.29.37)
312             TLS Web Server Authentication, TLS Web Client Authentication
313         X509v3 Subject Alternative Name: (oid: 2.5.29.17)
314             email:ca@cryptoframework.com
315         X509v3 Issuer Alternative Name: (oid: 2.5.29.18)
316             email:ca@cryptoframework.com
317 */
318 
319 static char oid01[] = "2.5.29.14";
320 static char oid02[] = "2.5.29.35";
321 static char oid03[] = "2.5.29.19";
322 static char oid04[] = "2.5.29.15";
323 static char oid05[] = "2.5.29.37";
324 static char oid06[] = "2.5.29.17";
325 static char oid07[] = "2.5.29.18";
326 
327 static const CfBlob g_allOidArray[] = {
328     { strlen(oid01), reinterpret_cast<uint8_t *>(oid01) },
329     { strlen(oid02), reinterpret_cast<uint8_t *>(oid02) },
330     { strlen(oid03), reinterpret_cast<uint8_t *>(oid03) },
331     { strlen(oid04), reinterpret_cast<uint8_t *>(oid04) },
332     { strlen(oid05), reinterpret_cast<uint8_t *>(oid05) },
333     { strlen(oid06), reinterpret_cast<uint8_t *>(oid06) },
334     { strlen(oid07), reinterpret_cast<uint8_t *>(oid07) },
335 };
336 
337 static const CfBlob g_critOidArray[] = {
338     { strlen(oid03), reinterpret_cast<uint8_t *>(oid03) },
339 };
340 
341 static const CfBlob g_uncritOidArray[] = {
342     { strlen(oid01), reinterpret_cast<uint8_t *>(oid01) },
343     { strlen(oid02), reinterpret_cast<uint8_t *>(oid02) },
344     { strlen(oid04), reinterpret_cast<uint8_t *>(oid04) },
345     { strlen(oid05), reinterpret_cast<uint8_t *>(oid05) },
346     { strlen(oid06), reinterpret_cast<uint8_t *>(oid06) },
347     { strlen(oid07), reinterpret_cast<uint8_t *>(oid07) },
348 };
349 
350 static const CfBlobArray g_expectAllOidArray = {
351     .data = const_cast<CfBlob *>(g_allOidArray),
352     .count = sizeof(g_allOidArray) / sizeof(CfBlob)
353 };
354 
355 static const CfBlobArray g_expectCritOidArray = {
356     .data = const_cast<CfBlob *>(g_critOidArray),
357     .count =sizeof(g_critOidArray) / sizeof(CfBlob)
358 };
359 
360 static const CfBlobArray g_expectUncritOidArray = {
361     const_cast<CfBlob *>(g_uncritOidArray),
362     sizeof(g_uncritOidArray) / sizeof(CfBlob)
363 };
364 
365 static const CfBlob g_extensionEntryBlob01 = {
366     sizeof(g_extensionEntry01), const_cast<uint8_t *>(g_extensionEntry01)
367 };
368 
369 static const CfBlob g_extensionEntryCriticalBlob01 = {
370     sizeof(g_extensionEntryCritical01), const_cast<uint8_t *>(g_extensionEntryCritical01)
371 };
372 
373 static const CfBlob g_extensionEntryValueBlob01 = {
374     sizeof(g_extensionEntryValue01), const_cast<uint8_t *>(g_extensionEntryValue01)
375 };
376 
377 static const uint8_t g_extensionEntry03[] = { /* the data gain from g_extensionData03 */
378     0x30, 0x12, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x08, 0x30, 0x06, 0x01, 0x01,
379     0xff, 0x02, 0x01, 0x02,
380 };
381 static const uint8_t g_extensionEntryCritical03[] = { /* the data gain from g_extensionData03 */
382     0x01
383 };
384 static const uint8_t g_extensionEntryValue03[] = { /* the data gain from g_extensionData03 */
385     0x04, 0x08, 0x30, 0x06, 0x01, 0x01, 0xff, 0x02, 0x01, 0x02,
386 };
387 
388 static const CfBlob g_extensionEntryBlob03 = {
389     sizeof(g_extensionEntry03), const_cast<uint8_t *>(g_extensionEntry03)
390 };
391 
392 static const CfBlob g_extensionEntryCriticalBlob03 = {
393     sizeof(g_extensionEntryCritical03), const_cast<uint8_t *>(g_extensionEntryCritical03)
394 };
395 
396 static const CfBlob g_extensionEntryValueBlob03 = {
397     sizeof(g_extensionEntryValue03), const_cast<uint8_t *>(g_extensionEntryValue03)
398 };
399 
400 static const uint8_t g_extensionTaintedData[] = { /* Tainted extension data: g_extensionData01 + invalid part */
401     0x30, 0x40, 0x30, 0x0F, 0x06, 0x03, 0x55, 0x1D, 0x13, 0x01, 0x01, 0xFF, 0x04, 0x05, 0x30, 0x03,
402     0x01, 0x01, 0xFF, 0x30, 0x0E, 0x06, 0x03, 0x55, 0x1D, 0x0F, 0x01, 0x01, 0xFF, 0x04, 0x04, 0x03,
403     0x02, 0x01, 0xC6, 0x30, 0x1D, 0x06, 0x03, 0x55, 0x1D, 0x0E, 0x04, 0x16, 0x04, 0x14, 0xE0, 0x8C,
404     0x9B, 0xDB, 0x25, 0x49, 0xB3, 0xF1, 0x7C, 0x86, 0xD6, 0xB2, 0x42, 0x87, 0x0B, 0xD0, 0x6B, 0xA0,
405     0xD9, 0xE4, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66
406 };
407 }
408 
409 #endif /* CF_TEST_DATA_H */
410 
411