Skip to content

Commit 81f2bb2

Browse files
committed
Fixed remvoal of files
1 parent 444253f commit 81f2bb2

26 files changed

Lines changed: 13564 additions & 0 deletions

test/wh_test_cert.c

Lines changed: 672 additions & 0 deletions
Large diffs are not rendered by default.

test/wh_test_cert.h

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright (C) 2025 wolfSSL Inc.
3+
*
4+
* This file is part of wolfHSM.
5+
*
6+
* wolfHSM is free software; you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License as published by
8+
* the Free Software Foundation; either version 3 of the License, or
9+
* (at your option) any later version.
10+
*
11+
* wolfHSM is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+
* GNU General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU General Public License
17+
* along with wolfHSM. If not, see <http://www.gnu.org/licenses/>.
18+
*/
19+
/*
20+
* test/wh_test_cert.h
21+
*/
22+
23+
#ifndef WOLFHSM_WH_TEST_CERT_H_
24+
#define WOLFHSM_WH_TEST_CERT_H_
25+
26+
#include "wolfhsm/wh_server.h"
27+
#include "wolfhsm/wh_client.h"
28+
29+
/* Run certificate configuration tests */
30+
int whTest_CertRamSim(void);
31+
int whTest_CertServerCfg(whServerConfig* serverCfg);
32+
int whTest_CertClient(whClientContext* client);
33+
#if defined(WOLFHSM_CFG_DMA)
34+
int whTest_CertClientDma_ClientServerTestInternal(whClientContext* client);
35+
#endif
36+
37+
#if defined(WOLFHSM_CFG_CERTIFICATE_MANAGER_ACERT)
38+
int whTest_CertClientAcert(whClientContext* client);
39+
#if defined(WOLFHSM_CFG_DMA)
40+
int whTest_CertClientAcertDma_ClientServerTestInternal(whClientContext* client);
41+
#endif /* WOLFHSM_CFG_DMA */
42+
#endif /* WOLFHSM_CFG_CERTIFICATE_MANAGER_ACERT */
43+
44+
#endif /* !WOLFHSM_WH_TEST_CERT_H_ */

test/wh_test_cert_data.h

Lines changed: 1533 additions & 0 deletions
Large diffs are not rendered by default.

test/wh_test_cert_data_acert.h

Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
#ifndef TEST_ACERTS_H
2+
#define TEST_ACERTS_H
3+
4+
/**
5+
* Test certificates for attribute certificate testing
6+
* Auto-generated by the generate_certs.sh script
7+
*/
8+
9+
/* CA Certificate */
10+
unsigned char caCert_der[] = {
11+
0x30, 0x82, 0x01, 0x92, 0x30, 0x82, 0x01, 0x38, 0xa0, 0x03, 0x02, 0x01,
12+
0x02, 0x02, 0x08, 0x2c, 0x2d, 0x1c, 0x67, 0xcd, 0x45, 0xdd, 0xd3, 0x30,
13+
0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30,
14+
0x2d, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
15+
0x43, 0x48, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13,
16+
0x04, 0x54, 0x65, 0x73, 0x74, 0x31, 0x0f, 0x30, 0x0d, 0x06, 0x03, 0x55,
17+
0x04, 0x03, 0x13, 0x06, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, 0x30, 0x1e,
18+
0x17, 0x0d, 0x32, 0x35, 0x30, 0x34, 0x30, 0x34, 0x31, 0x39, 0x35, 0x37,
19+
0x32, 0x35, 0x5a, 0x17, 0x0d, 0x33, 0x35, 0x30, 0x34, 0x30, 0x32, 0x31,
20+
0x39, 0x35, 0x37, 0x32, 0x35, 0x5a, 0x30, 0x2d, 0x31, 0x0b, 0x30, 0x09,
21+
0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x48, 0x31, 0x0d, 0x30,
22+
0x0b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x04, 0x54, 0x65, 0x73, 0x74,
23+
0x31, 0x0f, 0x30, 0x0d, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x06, 0x52,
24+
0x6f, 0x6f, 0x74, 0x43, 0x41, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a,
25+
0x86, 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce,
26+
0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x18, 0x90, 0x7a, 0xb7,
27+
0xc8, 0x81, 0xe1, 0x15, 0x4a, 0xff, 0xc9, 0x31, 0xdc, 0xd9, 0xba, 0x1d,
28+
0x71, 0x6f, 0x6e, 0xc0, 0xfa, 0x19, 0xed, 0x01, 0xea, 0x33, 0x75, 0x20,
29+
0x1e, 0x1e, 0xfe, 0x74, 0x79, 0x76, 0x5a, 0x71, 0x72, 0x73, 0x08, 0x51,
30+
0xab, 0x0a, 0x6d, 0xf3, 0x8d, 0xbc, 0x2c, 0xa3, 0x78, 0xbe, 0x40, 0x92,
31+
0x63, 0xbb, 0x67, 0xbe, 0x4e, 0x4e, 0x71, 0xa1, 0x3c, 0xa0, 0xca, 0xd2,
32+
0xa3, 0x42, 0x30, 0x40, 0x30, 0x0f, 0x06, 0x03, 0x55, 0x1d, 0x13, 0x01,
33+
0x01, 0xff, 0x04, 0x05, 0x30, 0x03, 0x01, 0x01, 0xff, 0x30, 0x0e, 0x06,
34+
0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x01,
35+
0x06, 0x30, 0x1d, 0x06, 0x03, 0x55, 0x1d, 0x0e, 0x04, 0x16, 0x04, 0x14,
36+
0x4a, 0x06, 0x19, 0xf0, 0x62, 0x5f, 0x70, 0x5b, 0xb1, 0x39, 0x87, 0x3a,
37+
0x7b, 0xca, 0xa0, 0x2d, 0xb2, 0xfe, 0xc9, 0xf4, 0x30, 0x0a, 0x06, 0x08,
38+
0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x03, 0x48, 0x00, 0x30,
39+
0x45, 0x02, 0x20, 0x57, 0x43, 0x09, 0x55, 0xd6, 0x7c, 0xdd, 0x8d, 0x83,
40+
0xbf, 0xf4, 0xb1, 0x0e, 0x20, 0xb4, 0xed, 0x71, 0x88, 0x68, 0xed, 0x54,
41+
0x7f, 0x90, 0x6a, 0x78, 0xcf, 0xb0, 0x53, 0x89, 0x61, 0x82, 0x5f, 0x02,
42+
0x21, 0x00, 0xdb, 0xcc, 0x73, 0x74, 0xc0, 0x15, 0x53, 0xbc, 0x15, 0xe4,
43+
0x5b, 0x16, 0x59, 0x15, 0x1b, 0xe1, 0xa6, 0x9b, 0x78, 0x89, 0x2a, 0xe1,
44+
0x75, 0x71, 0xbe, 0x71, 0x60, 0x80, 0xab, 0xb1, 0x36, 0x4a
45+
};
46+
unsigned int caCert_der_len = 406;
47+
48+
/* CA Public Key */
49+
unsigned char caPub_der[] = {
50+
0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
51+
0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03,
52+
0x42, 0x00, 0x04, 0x18, 0x90, 0x7a, 0xb7, 0xc8, 0x81, 0xe1, 0x15, 0x4a,
53+
0xff, 0xc9, 0x31, 0xdc, 0xd9, 0xba, 0x1d, 0x71, 0x6f, 0x6e, 0xc0, 0xfa,
54+
0x19, 0xed, 0x01, 0xea, 0x33, 0x75, 0x20, 0x1e, 0x1e, 0xfe, 0x74, 0x79,
55+
0x76, 0x5a, 0x71, 0x72, 0x73, 0x08, 0x51, 0xab, 0x0a, 0x6d, 0xf3, 0x8d,
56+
0xbc, 0x2c, 0xa3, 0x78, 0xbe, 0x40, 0x92, 0x63, 0xbb, 0x67, 0xbe, 0x4e,
57+
0x4e, 0x71, 0xa1, 0x3c, 0xa0, 0xca, 0xd2
58+
};
59+
unsigned int caPub_der_len = 91;
60+
61+
/* Dummy Identity Certificate */
62+
unsigned char dummyCert_der[] = {
63+
0x30, 0x82, 0x01, 0x71, 0x30, 0x82, 0x01, 0x18, 0xa0, 0x03, 0x02, 0x01,
64+
0x02, 0x02, 0x08, 0x24, 0xc1, 0x6d, 0x92, 0x3d, 0xe9, 0xc1, 0xe2, 0x30,
65+
0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x30,
66+
0x2d, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02,
67+
0x43, 0x48, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13,
68+
0x04, 0x54, 0x65, 0x73, 0x74, 0x31, 0x0f, 0x30, 0x0d, 0x06, 0x03, 0x55,
69+
0x04, 0x03, 0x13, 0x06, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, 0x30, 0x1e,
70+
0x17, 0x0d, 0x32, 0x35, 0x30, 0x34, 0x30, 0x34, 0x31, 0x39, 0x35, 0x37,
71+
0x32, 0x35, 0x5a, 0x17, 0x0d, 0x32, 0x36, 0x30, 0x34, 0x30, 0x34, 0x31,
72+
0x39, 0x35, 0x37, 0x32, 0x35, 0x5a, 0x30, 0x2c, 0x31, 0x0b, 0x30, 0x09,
73+
0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x48, 0x31, 0x0d, 0x30,
74+
0x0b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x04, 0x54, 0x65, 0x73, 0x74,
75+
0x31, 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x05, 0x44,
76+
0x75, 0x6d, 0x6d, 0x79, 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86,
77+
0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d,
78+
0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04, 0x23, 0xab, 0x39, 0x7a, 0x9b,
79+
0x7a, 0xb2, 0xf6, 0xd1, 0x51, 0x1d, 0x59, 0xda, 0xb3, 0x05, 0x21, 0xd6,
80+
0x8e, 0xeb, 0xbf, 0x16, 0x18, 0x29, 0x54, 0xa9, 0xb1, 0xbc, 0x48, 0xc7,
81+
0x35, 0x81, 0x87, 0x09, 0x81, 0x50, 0x01, 0x54, 0x51, 0xa3, 0x25, 0xee,
82+
0x1e, 0xa1, 0xb5, 0xcd, 0x28, 0xbc, 0x48, 0x79, 0xb7, 0x5c, 0x30, 0x2e,
83+
0x41, 0x25, 0x88, 0x21, 0xfe, 0xc6, 0x54, 0xbf, 0xc2, 0x43, 0x9d, 0xa3,
84+
0x23, 0x30, 0x21, 0x30, 0x1f, 0x06, 0x03, 0x55, 0x1d, 0x23, 0x04, 0x18,
85+
0x30, 0x16, 0x80, 0x14, 0x4a, 0x06, 0x19, 0xf0, 0x62, 0x5f, 0x70, 0x5b,
86+
0xb1, 0x39, 0x87, 0x3a, 0x7b, 0xca, 0xa0, 0x2d, 0xb2, 0xfe, 0xc9, 0xf4,
87+
0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02,
88+
0x03, 0x47, 0x00, 0x30, 0x44, 0x02, 0x20, 0x65, 0x49, 0xc1, 0x7e, 0x0c,
89+
0x88, 0x19, 0xad, 0x53, 0x7e, 0x3a, 0x1a, 0xfd, 0xcf, 0x64, 0x08, 0x84,
90+
0x07, 0xe4, 0x44, 0x79, 0x95, 0x76, 0xfd, 0x8a, 0x34, 0xcf, 0x0f, 0xcb,
91+
0x04, 0x20, 0x0e, 0x02, 0x20, 0x33, 0x14, 0x70, 0x6c, 0x18, 0xd2, 0x6d,
92+
0x1f, 0xa8, 0x54, 0xe0, 0x18, 0x73, 0xfa, 0xa6, 0x1d, 0x49, 0x0f, 0xdf,
93+
0xf6, 0x94, 0x35, 0x0e, 0x44, 0xab, 0xa9, 0xa6, 0xcf, 0x6c, 0xe6, 0x68,
94+
0x02
95+
};
96+
unsigned int dummyCert_der_len = 373;
97+
98+
/* Dummy Identity Public Key */
99+
unsigned char dummyPub_der[] = {
100+
0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
101+
0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03,
102+
0x42, 0x00, 0x04, 0x23, 0xab, 0x39, 0x7a, 0x9b, 0x7a, 0xb2, 0xf6, 0xd1,
103+
0x51, 0x1d, 0x59, 0xda, 0xb3, 0x05, 0x21, 0xd6, 0x8e, 0xeb, 0xbf, 0x16,
104+
0x18, 0x29, 0x54, 0xa9, 0xb1, 0xbc, 0x48, 0xc7, 0x35, 0x81, 0x87, 0x09,
105+
0x81, 0x50, 0x01, 0x54, 0x51, 0xa3, 0x25, 0xee, 0x1e, 0xa1, 0xb5, 0xcd,
106+
0x28, 0xbc, 0x48, 0x79, 0xb7, 0x5c, 0x30, 0x2e, 0x41, 0x25, 0x88, 0x21,
107+
0xfe, 0xc6, 0x54, 0xbf, 0xc2, 0x43, 0x9d
108+
};
109+
unsigned int dummyPub_der_len = 91;
110+
111+
/* Attribute Certificate */
112+
unsigned char attrCert_der[] = {
113+
0x30, 0x82, 0x01, 0xc9, 0x30, 0x82, 0x01, 0x70, 0x02, 0x01, 0x01, 0x30,
114+
0x71, 0xa0, 0x3d, 0x30, 0x31, 0xa4, 0x2f, 0x30, 0x2d, 0x31, 0x0b, 0x30,
115+
0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x48, 0x31, 0x0d,
116+
0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x04, 0x54, 0x65, 0x73,
117+
0x74, 0x31, 0x0f, 0x30, 0x0d, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13, 0x06,
118+
0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, 0x02, 0x08, 0x24, 0xc1, 0x6d, 0x92,
119+
0x3d, 0xe9, 0xc1, 0xe2, 0xa1, 0x30, 0xa4, 0x2e, 0x30, 0x2c, 0x31, 0x0b,
120+
0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x48, 0x31,
121+
0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x04, 0x54, 0x65,
122+
0x73, 0x74, 0x31, 0x0e, 0x30, 0x0c, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13,
123+
0x05, 0x44, 0x75, 0x6d, 0x6d, 0x79, 0xa0, 0x33, 0x30, 0x31, 0xa4, 0x2f,
124+
0x30, 0x2d, 0x31, 0x0b, 0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13,
125+
0x02, 0x43, 0x48, 0x31, 0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x0a,
126+
0x13, 0x04, 0x54, 0x65, 0x73, 0x74, 0x31, 0x0f, 0x30, 0x0d, 0x06, 0x03,
127+
0x55, 0x04, 0x03, 0x13, 0x06, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, 0x30,
128+
0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x04, 0x03, 0x02, 0x02,
129+
0x08, 0x79, 0x8c, 0x10, 0x0f, 0x56, 0xf7, 0x92, 0x01, 0x30, 0x22, 0x18,
130+
0x0f, 0x32, 0x30, 0x32, 0x35, 0x30, 0x34, 0x30, 0x34, 0x31, 0x39, 0x35,
131+
0x37, 0x32, 0x35, 0x5a, 0x18, 0x0f, 0x32, 0x30, 0x32, 0x35, 0x30, 0x34,
132+
0x30, 0x36, 0x31, 0x39, 0x35, 0x37, 0x32, 0x35, 0x5a, 0x30, 0x1e, 0x30,
133+
0x1c, 0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x0a, 0x04, 0x31,
134+
0x10, 0x30, 0x0e, 0x30, 0x0c, 0x0c, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x2d,
135+
0x67, 0x72, 0x6f, 0x75, 0x70, 0x30, 0x69, 0x30, 0x5c, 0x06, 0x03, 0x55,
136+
0x1d, 0x23, 0x04, 0x55, 0x30, 0x53, 0x80, 0x14, 0x4a, 0x06, 0x19, 0xf0,
137+
0x62, 0x5f, 0x70, 0x5b, 0xb1, 0x39, 0x87, 0x3a, 0x7b, 0xca, 0xa0, 0x2d,
138+
0xb2, 0xfe, 0xc9, 0xf4, 0xa1, 0x31, 0xa4, 0x2f, 0x30, 0x2d, 0x31, 0x0b,
139+
0x30, 0x09, 0x06, 0x03, 0x55, 0x04, 0x06, 0x13, 0x02, 0x43, 0x48, 0x31,
140+
0x0d, 0x30, 0x0b, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x04, 0x54, 0x65,
141+
0x73, 0x74, 0x31, 0x0f, 0x30, 0x0d, 0x06, 0x03, 0x55, 0x04, 0x03, 0x13,
142+
0x06, 0x52, 0x6f, 0x6f, 0x74, 0x43, 0x41, 0x82, 0x08, 0x2c, 0x2d, 0x1c,
143+
0x67, 0xcd, 0x45, 0xdd, 0xd3, 0x30, 0x09, 0x06, 0x03, 0x55, 0x1d, 0x38,
144+
0x04, 0x02, 0x05, 0x00, 0x30, 0x0a, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce,
145+
0x3d, 0x04, 0x03, 0x02, 0x03, 0x47, 0x00, 0x30, 0x44, 0x02, 0x20, 0x34,
146+
0x41, 0x8b, 0x5b, 0x60, 0x60, 0xa6, 0xd9, 0x9c, 0xc5, 0x2d, 0x06, 0xc9,
147+
0x63, 0xd5, 0x93, 0xff, 0xa5, 0xea, 0xc6, 0x5c, 0x00, 0x47, 0xa7, 0x38,
148+
0xf5, 0xa5, 0xee, 0xfb, 0xb3, 0xd8, 0x90, 0x02, 0x20, 0x1c, 0xff, 0x57,
149+
0xea, 0x73, 0x09, 0xf8, 0x77, 0x10, 0x01, 0xc4, 0x2b, 0xc4, 0x73, 0x39,
150+
0xe4, 0x99, 0xda, 0xef, 0x39, 0x00, 0x63, 0xb5, 0x06, 0x75, 0xee, 0xa8,
151+
0xd2, 0xe3, 0xf2, 0xb5, 0xf1
152+
};
153+
unsigned int attrCert_der_len = 461;
154+
155+
#endif /* TEST_ACERTS_H */

0 commit comments

Comments
 (0)