-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathu_security_credential_test_data.h
More file actions
150 lines (119 loc) · 5 KB
/
Copy pathu_security_credential_test_data.h
File metadata and controls
150 lines (119 loc) · 5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/*
* Copyright 2020 u-blox Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef _U_SECURITY_CREDENTIAL_TEST_DATA_H_
#define _U_SECURITY_CREDENTIAL_TEST_DATA_H_
/* No #includes allowed here */
/** @file
* @brief Test data for the u-blox security credential API testing.
*/
#ifdef __cplusplus
extern "C" {
#endif
/* ----------------------------------------------------------------
* COMPILE-TIME MACROS
* -------------------------------------------------------------- */
/** The subject ("Common Name") field of gSecurityCredentialTestCertX509.
*/
#define U_SECURITY_CREDENTIAL_TEST_X509_SUBJECT "ubxlib client"
/** The UTC expiration date of gSecurityCredentialTestCertX509.
*/
#define U_SECURITY_CREDENTIAL_TEST_X509_EXPIRATION_UTC 1770657548
/** The passphrase for the security keys.
*/
//lint -esym(755, U_SECURITY_CREDENTIAL_TEST_PASSPHRASE) Suppress
// macro not referenced.
#define U_SECURITY_CREDENTIAL_TEST_PASSPHRASE "ubxlib"
/* ----------------------------------------------------------------
* TYPES
* -------------------------------------------------------------- */
#ifdef U_SECURITY_CREDENTIAL_TEST_FORMATS
// Type used to form a table of all possible formats/encodings of
// credentials, used to explore what works on a given module.
typedef struct {
//lint -e768 Suppress not referenced (it won't be if logging is off)
const char *pDescription;
uSecurityCredentialType_t type;
const size_t size;
const char *pPassword;
const uint8_t contents[1024];
} uSecurityCredentialFormatTest_t;
#endif
/* ----------------------------------------------------------------
* VARIABLES: 1024-BIT KEY
* -------------------------------------------------------------- */
/** A test PKCS1-encoded PEM-format encrypted private key.
*/
extern const uint8_t gUSecurityCredentialTestKey1024Pkcs1Pem[];
/** Number of items in the gUSecurityCredentialTestKey1024Pkcs1Pem
* array, has to be done in this file and externed or GCC complains
* about asking for the size of a partially defined type.
*/
extern const size_t gUSecurityCredentialTestKey1024Pkcs1PemSize;
/** An unencrypted version of gUSecurityCredentialTestKey1024Pkcs1Pem.
*/
extern const uint8_t gUSecurityCredentialTestKey1024Pkcs1PemNoPass[];
/** Number of items in the gUSecurityCredentialTestKey1024Pkcs1PemNoPass
* array, has to be done in this file and externed or GCC complains
* about asking for the size of a partially defined type.
*/
extern const size_t gUSecurityCredentialTestKey1024Pkcs1PemNoPassSize;
/** An PKCS8-encoded, encrypted, version of
* gUSecurityCredentialTestKey1024Pkcs1Pem.
*/
extern const uint8_t gUSecurityCredentialTestKey1024Pkcs8Pem[];
/** Number of items in the gUSecurityCredentialTestKey1024Pkcs8Pem
* array, has to be done in this file and externed or GCC complains
* about asking for the size of a partially defined type.
*/
extern const size_t gUSecurityCredentialTestKey1024Pkcs8PemSize;
/* ----------------------------------------------------------------
* VARIABLES: CERTIFICATES
* -------------------------------------------------------------- */
/** A test root/CA X.509 certificate.
*/
extern const uint8_t gUSecurityCredentialTestRootCaX509Pem[];
/** Number of items in the gUSecurityCredentialTestRootCaX509Pem array,
* has to be done in this file and externed or GCC complains about
* asking for the size of a partially defined type.
*/
extern const size_t gUSecurityCredentialTestRootCaX509PemSize;
/** A test client X.509 certificate.
*/
extern const uint8_t gUSecurityCredentialTestClientX509Pem[];
/** Number of items in the gUSecurityCredentialTestClientX509Pem array,
* has to be done in this file and externed or GCC complains about
* asking for the size of a partially defined type.
*/
extern const size_t gUSecurityCredentialTestClientX509PemSize;
#ifdef U_SECURITY_CREDENTIAL_TEST_FORMATS
/* ----------------------------------------------------------------
* VARIABLES: FORMAT TEST DATA
* -------------------------------------------------------------- */
/** A table of all possible formats/encodings of credentials, used
* to explore what is supported by a given module.
*/
extern const uSecurityCredentialFormatTest_t gUSecurityCredentialTestFormat[];
/** Number of items in the gUSecurityCredentialTestFormat array,
* has to be done in this file and externed or GCC complains about
* asking for the size of a partially defined type.
*/
extern const size_t gUSecurityCredentialTestFormatSize;
#endif
#ifdef __cplusplus
}
#endif
#endif // _U_SECURITY_CREDENTIAL_TEST_DATA_H_
// End of file