Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
ssh.c File Reference
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "util.h"
#include "openssl-compat.h"
#include <yubihsm.h>
Include dependency graph for ssh.c:

Go to the source code of this file.

Macros

#define DEFAULT_CONNECTOR_URL   "http://127.0.0.1:12345"
 

Functions

int main (void)
 

Variables

const char ssh_ca_pvtkey_file [] = "ssh_ca_pvtkey.pem"
 
const char * key_label = "label"
 
const uint8_t password [] = "password"
 
const unsigned char template_dat []
 
const char ssh_req_file [] = "ssh_req.dat"
 
const unsigned char expected_result []
 

Macro Definition Documentation

◆ DEFAULT_CONNECTOR_URL

#define DEFAULT_CONNECTOR_URL   "http://127.0.0.1:12345"

Definition at line 33 of file ssh.c.

Function Documentation

◆ main()

int main ( void )

Definition at line 160 of file ssh.c.

160 {
161 yh_connector *connector = NULL;
162 yh_session *session = NULL;
164
165 uint16_t authkey = 1;
166
167 const char *connector_url;
168
169 connector_url = getenv("DEFAULT_CONNECTOR_URL");
170 if (connector_url == NULL) {
171 connector_url = DEFAULT_CONNECTOR_URL;
172 }
173
174 yrc = yh_init();
175 assert(yrc == YHR_SUCCESS);
176
177 yrc = yh_init_connector(connector_url, &connector);
178 assert(yrc == YHR_SUCCESS);
179
180 yrc = yh_connect(connector, 0);
181 assert(yrc == YHR_SUCCESS);
182
183 yrc = yh_create_session_derived(connector, authkey, password,
184 sizeof(password), false, &session);
185 assert(yrc == YHR_SUCCESS);
186
188 assert(yrc == YHR_SUCCESS);
189
190 uint8_t session_id;
191 yrc = yh_get_session_id(session, &session_id);
192 assert(yrc == YHR_SUCCESS);
193
194 printf("Successfully established session %02d\n", session_id);
195
196 FILE *fp = fopen(ssh_ca_pvtkey_file, "rb");
197 assert(fp != NULL);
198
200 uint8_t key[2048];
201 size_t key_material_len = sizeof(key);
202 if (!read_file(fp, key, &key_material_len)) {
203 assert(false);
204 }
205 bool ret = read_private_key(key, key_material_len, &algorithm, key,
206 &key_material_len, false);
207 assert(ret == true);
208 assert(algorithm == YH_ALGO_RSA_2048);
209
211 yrc = yh_string_to_capabilities("sign-ssh-certificate", &capabilities);
212 assert(yrc == YHR_SUCCESS);
213
214 uint16_t domain_five = 0;
215 yh_string_to_domains("5", &domain_five);
216 assert(yrc == YHR_SUCCESS);
217
218 uint16_t ca_key_id =
219 5; // We use ID 5 because it is in the template's whitelist
221 if (yrc == YHR_SUCCESS) {
223 assert(yrc == YHR_SUCCESS);
224 } else {
226 }
227 yrc = yh_util_import_rsa_key(session, &ca_key_id, key_label, domain_five,
228 &capabilities, algorithm, key,
229 key + (key_material_len / 2));
230 assert(yrc == YHR_SUCCESS);
231
232 printf("Key imported with ID %04x\n", ca_key_id);
233
234 uint16_t template_id = 10;
235 yrc = yh_util_get_object_info(session, template_id, YH_TEMPLATE, NULL);
236 if (yrc == YHR_SUCCESS) {
238 assert(yrc == YHR_SUCCESS);
239 } else {
241 }
242 yrc = yh_util_import_template(session, &template_id, key_label, domain_five,
244 template_dat, sizeof(template_dat));
245 assert(yrc == YHR_SUCCESS);
246
247 printf("Template imported with ID %04x\n", template_id);
248
249 uint8_t template2[sizeof(template_dat)];
250 size_t template2_len = sizeof(template2);
251 yrc = yh_util_get_template(session, template_id, template2, &template2_len);
252 assert(yrc == YHR_SUCCESS);
253
254 assert(sizeof(template_dat) == template2_len);
255 assert(memcmp(template_dat, template2, template2_len) == 0);
256
257 uint8_t ssh_req[2048];
258 size_t ssh_req_len = sizeof(ssh_req);
259
260 fp = fopen(ssh_req_file, "rb");
261 assert(fp != NULL);
262
263 fseek(fp, 0, SEEK_END);
264 ssh_req_len = ftell(fp);
265 assert(ssh_req_len <= sizeof(ssh_req));
266 fseek(fp, 0, SEEK_SET);
267
268 size_t read = fread(ssh_req, 1, ssh_req_len, fp);
269 fclose(fp);
270 printf("actually read %zu, expected %zu\n", read, ssh_req_len);
271 assert(read == ssh_req_len);
272
273 size_t ssh_cert_len = sizeof(ssh_req) - ssh_req_len;
274 yrc =
275 yh_util_sign_ssh_certificate(session, ca_key_id, template_id,
276 YH_ALGO_RSA_PKCS1_SHA1, ssh_req, ssh_req_len,
277 ssh_req + ssh_req_len, &ssh_cert_len);
278 assert(yrc == YHR_SUCCESS);
279 assert(memcmp(expected_result, ssh_req + 4 + 256, sizeof(expected_result)) ==
280 0);
281
282 BIO *bio;
283 BIO *b64;
284
285 b64 = BIO_new(BIO_f_base64());
286 bio = BIO_new_fp(stdout, BIO_NOCLOSE);
287 bio = BIO_push(b64, bio);
288
289 fprintf(stdout, "ssh-rsa-cert-v01@openssh.com ");
290 (void) BIO_set_flags(bio, BIO_FLAGS_BASE64_NO_NL);
291 (void) BIO_write(bio, ssh_req + 4 + 256,
292 ssh_req_len + ssh_cert_len - 4 - 256);
293 (void) BIO_flush(bio);
294 fprintf(stdout, "\n");
295
296 BIO_free_all(bio);
297
299 assert(yrc == YHR_SUCCESS);
300
302 assert(yrc == YHR_SUCCESS);
303
304 yh_disconnect(connector);
305 assert(yrc == YHR_SUCCESS);
306
307 yrc = yh_exit();
308 assert(yrc == YHR_SUCCESS);
309
310 return 0;
311}
CK_SESSION_HANDLE session
LOGGING_API void printf(Category category, const char *format,...)
Definition Logging.cpp:30
const unsigned char template_dat[]
Definition ssh.c:39
const unsigned char expected_result[]
Definition ssh.c:73
#define DEFAULT_CONNECTOR_URL
Definition ssh.c:33
const char ssh_ca_pvtkey_file[]
Definition ssh.c:36
const char * key_label
Definition ssh.c:37
const char ssh_req_file[]
Definition ssh.c:71
unsigned short uint16_t
Definition stdint.h:125
unsigned char uint8_t
Definition stdint.h:124
Capabilities representation.
Definition yubihsm.h:162
bool read_file(FILE *fp, uint8_t *buf, size_t *buf_len)
Definition util.c:476
bool read_private_key(uint8_t *buf, size_t len, yh_algorithm *algo, uint8_t *bytes, size_t *bytes_len, bool internal_repr)
Definition util.c:116
uint8_t key[16]
Definition yubico_otp.c:41
yh_rc yh_destroy_session(yh_session **session)
Definition yubihsm.c:890
yh_rc yh_exit(void)
Definition yubihsm.c:3910
yh_rc yh_create_session_derived(yh_connector *connector, uint16_t authkey_id, const uint8_t *password, size_t password_len, bool recreate, yh_session **session)
Definition yubihsm.c:593
yh_rc yh_util_sign_ssh_certificate(yh_session *session, uint16_t key_id, uint16_t template_id, yh_algorithm sig_algo, const uint8_t *in, size_t in_len, uint8_t *out, size_t *out_len)
Definition yubihsm.c:2745
yh_rc yh_util_get_template(yh_session *session, uint16_t object_id, uint8_t *out, size_t *out_len)
Definition yubihsm.c:2805
yh_rc yh_init(void)
Definition yubihsm.c:3857
yh_rc yh_util_close_session(yh_session *session)
Definition yubihsm.c:1257
yh_rc yh_authenticate_session(yh_session *session)
Definition yubihsm.c:2927
yh_rc yh_util_get_object_info(yh_session *session, uint16_t id, yh_object_type type, yh_object_descriptor *object)
Definition yubihsm.c:1128
yh_rc yh_string_to_domains(const char *domains, uint16_t *result)
Definition yubihsm.c:4535
yh_rc yh_init_connector(const char *url, yh_connector **connector)
Definition yubihsm.c:4024
yh_rc yh_connect(yh_connector *connector, int timeout)
Definition yubihsm.c:4079
yh_rc yh_string_to_capabilities(const char *capability, yh_capabilities *result)
Definition yubihsm.c:4115
yh_rc yh_util_import_rsa_key(yh_session *session, uint16_t *key_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, yh_algorithm algorithm, const uint8_t *p, const uint8_t *q)
Definition yubihsm.c:1655
yh_rc yh_disconnect(yh_connector *connector)
Definition yubihsm.c:4097
yh_rc yh_util_import_template(yh_session *session, uint16_t *object_id, const char *label, uint16_t domains, const yh_capabilities *capabilities, yh_algorithm algorithm, const uint8_t *in, size_t in_len)
Definition yubihsm.c:2835
yh_rc yh_util_delete_object(yh_session *session, uint16_t id, yh_object_type type)
Definition yubihsm.c:2222
yh_rc yh_get_session_id(yh_session *session, uint8_t *sid)
Definition yubihsm.c:2915
@ YH_TEMPLATE
Definition yubihsm.h:374
@ YH_ASYMMETRIC_KEY
Asymmetric Key is the private key of an asymmetric key-pair.
Definition yubihsm.h:366
yh_algorithm
Definition yubihsm.h:390
@ YH_ALGO_RSA_PKCS1_SHA1
rsa-pkcs1-sha1
Definition yubihsm.h:392
@ YH_ALGO_RSA_2048
rsa2048
Definition yubihsm.h:408
@ YH_ALGO_TEMPLATE_SSH
template-ssh
Definition yubihsm.h:462
yh_algorithm algorithm
Definition yubihsm.h:619
yh_rc
Definition yubihsm.h:170
@ YHR_GENERIC_ERROR
Return value when encountering an unknown error.
Definition yubihsm.h:228
@ YHR_SUCCESS
Returned value when function was successful.
Definition yubihsm.h:172
@ YHR_DEVICE_OBJECT_NOT_FOUND
Return value when the object not found on the device.
Definition yubihsm.h:218
yh_capabilities capabilities
CK_RV ret
yh_rc yrc
Here is the call graph for this function:

Variable Documentation

◆ expected_result

const unsigned char expected_result[]

Definition at line 73 of file ssh.c.

74 {0x00, 0x00, 0x00, 0x1c, 0x73, 0x73, 0x68, 0x2d, 0x72, 0x73, 0x61, 0x2d, 0x63,
75 0x65, 0x72, 0x74, 0x2d, 0x76, 0x30, 0x31, 0x40, 0x6f, 0x70, 0x65, 0x6e, 0x73,
76 0x73, 0x68, 0x2e, 0x63, 0x6f, 0x6d, 0x00, 0x00, 0x00, 0x20, 0x91, 0xe7, 0x84,
77 0x34, 0x8a, 0xbd, 0x1f, 0x52, 0x2c, 0x4f, 0xa7, 0x59, 0xfb, 0x97, 0xd2, 0x4b,
78 0x07, 0xbd, 0xad, 0x1f, 0xaf, 0x53, 0x9a, 0x50, 0x35, 0x71, 0xb0, 0x63, 0x64,
79 0xe2, 0x88, 0xcf, 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01,
80 0x01, 0x00, 0xd8, 0x2a, 0x18, 0x56, 0x40, 0x5b, 0xe5, 0xc7, 0xed, 0x94, 0x6f,
81 0x1f, 0x18, 0x87, 0x33, 0x10, 0xc6, 0xfa, 0x00, 0x1e, 0xdf, 0xf8, 0xf5, 0xaf,
82 0x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c, 0xfc, 0xe6, 0x76, 0xac,
96 0x7b, 0x10, 0x26, 0xf1, 0xb9, 0xaf, 0x53, 0x6c, 0x74, 0xbb, 0x8a, 0x24, 0xd5,
97 0x91, 0xd8, 0xc8, 0x72, 0xfb, 0x6f, 0x52, 0x58, 0x94, 0xeb, 0x8d, 0xc2, 0x12,
98 0xbc, 0xd1, 0xde, 0xfb, 0x49, 0xf3, 0x39, 0x51, 0x86, 0xd4, 0x32, 0x9f, 0x36,
99 0x1b, 0x37, 0xb7, 0x8a, 0x4f, 0x43, 0x7b, 0xd9, 0xf0, 0x26, 0x5f, 0x00, 0x00,
100 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
101 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x00, 0x00, 0x00, 0x12,
102 0x00, 0x00, 0x00, 0x05, 0x75, 0x73, 0x65, 0x72, 0x31, 0x00, 0x00, 0x00, 0x05,
103 0x75, 0x73, 0x65, 0x72, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
104 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
105 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x15, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74,
106 0x2d, 0x58, 0x31, 0x31, 0x2d, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69,
107 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x70, 0x65, 0x72,
108 0x6d, 0x69, 0x74, 0x2d, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x2d, 0x66, 0x6f, 0x72,
109 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
110 0x00, 0x16, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x2d, 0x70, 0x6f, 0x72, 0x74,
111 0x2d, 0x66, 0x6f, 0x72, 0x77, 0x61, 0x72, 0x64, 0x69, 0x6e, 0x67, 0x00, 0x00,
112 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x74, 0x2d,
113 0x70, 0x74, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x70, 0x65,
114 0x72, 0x6d, 0x69, 0x74, 0x2d, 0x75, 0x73, 0x65, 0x72, 0x2d, 0x72, 0x63, 0x00,
115 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x17, 0x00, 0x00,
116 0x00, 0x07, 0x73, 0x73, 0x68, 0x2d, 0x72, 0x73, 0x61, 0x00, 0x00, 0x00, 0x03,
117 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x00, 0xd3, 0x35, 0xad, 0x1a, 0x8a,
118 0xe2, 0x4d, 0x09, 0xaa, 0xb4, 0x29, 0x8b, 0x1e, 0xbd, 0xc9, 0x41, 0x22, 0xbe,
119 0x11, 0xd3, 0x0e, 0xab, 0x25, 0xed, 0xbc, 0x5e, 0x2f, 0xaa, 0xf2, 0x48, 0x14,
120 0x5b, 0x14, 0xee, 0xe3, 0x03, 0x9b, 0xf1, 0x52, 0x87, 0x0d, 0x61, 0x09, 0x51,
121 0x60, 0xc9, 0x9b, 0xbb, 0x3f, 0xbe, 0xfe, 0x45, 0x46, 0x88, 0x30, 0x05, 0x04,
122 0x6e, 0xd6, 0x0a, 0x17, 0x8b, 0xd8, 0xbc, 0xf3, 0xf1, 0x50, 0x50, 0xcb, 0xd5,
123 0x8c, 0x87, 0x17, 0xa5, 0x6c, 0x36, 0xfc, 0x24, 0x30, 0xd0, 0xd2, 0x99, 0x16,
124 0x72, 0x0f, 0xa9, 0x47, 0xe4, 0x3f, 0xd0, 0x15, 0xc1, 0x86, 0x66, 0xd9, 0xfa,
125 0x47, 0x3d, 0x52, 0x7c, 0x9b, 0xb2, 0x9e, 0xb4, 0xfe, 0xfd, 0x99, 0x6d, 0x33,
126 0xf3, 0x6b, 0xa1, 0xd7, 0x5a, 0x21, 0x30, 0x36, 0xdc, 0xd4, 0xa6, 0x26, 0xb2,
127 0x22, 0xfe, 0x5c, 0x26, 0xe6, 0xfa, 0xee, 0xbc, 0x54, 0x09, 0xec, 0x90, 0xf8,
128 0xfa, 0xd8, 0x91, 0xf2, 0x22, 0xce, 0xa9, 0x6b, 0x06, 0x5e, 0x55, 0x2d, 0x21,
129 0x70, 0xed, 0xd3, 0xdb, 0x10, 0xb3, 0xef, 0xc7, 0x09, 0xbc, 0xe2, 0x1d, 0x47,
130 0xa8, 0x58, 0xff, 0x13, 0x4a, 0x98, 0x4a, 0x7d, 0xce, 0x8b, 0x8c, 0xdb, 0x52,
131 0xc7, 0xaa, 0x66, 0xca, 0x70, 0xb6, 0xc1, 0x11, 0x7b, 0x2d, 0x87, 0x74, 0x0a,
132 0x6e, 0xcd, 0xab, 0x41, 0xd0, 0xfb, 0x13, 0xf1, 0xb9, 0xa0, 0x41, 0x59, 0xea,
133 0x9d, 0x29, 0x42, 0x7b, 0xff, 0x44, 0x6a, 0xb7, 0xbb, 0x26, 0xac, 0x61, 0x9c,
134 0xa9, 0x6b, 0xb7, 0x3f, 0xdc, 0xb1, 0x73, 0x18, 0x98, 0x56, 0x51, 0x60, 0x65,
135 0x20, 0x40, 0x51, 0x58, 0xc7, 0x31, 0x86, 0x82, 0x46, 0x25, 0x99, 0x28, 0xfb,
136 0x3a, 0xc0, 0x34, 0xd8, 0x9c, 0x93, 0x81, 0x13, 0xdb, 0xc5, 0xa8, 0x71, 0xe3,
137 0x4f, 0xee, 0xe6, 0x9f, 0x00, 0x00, 0x01, 0x0f, 0x00, 0x00, 0x00, 0x07, 0x73,
138 0x73, 0x68, 0x2d, 0x72, 0x73, 0x61, 0x00, 0x00, 0x01, 0x00, 0x0a, 0xcc, 0x96,
139 0xd1, 0xc3, 0xa5, 0x05, 0xfb, 0x20, 0x2f, 0x3a, 0x70, 0x89, 0x73, 0x42, 0x01,
140 0x21, 0x14, 0x44, 0xc6, 0x61, 0xbd, 0xc7, 0x5f, 0xf0, 0x8b, 0x04, 0x30, 0xa8,
141 0x81, 0x81, 0x17, 0x6e, 0x8a, 0xe5, 0x88, 0x2a, 0x4a, 0xf8, 0x58, 0x82, 0x1c,
142 0x67, 0x18, 0x26, 0x9a, 0x24, 0xb5, 0xf9, 0x1c, 0xc9, 0xe8, 0x12, 0xe2, 0x93,
143 0xdc, 0x63, 0xc1, 0x4d, 0x39, 0x37, 0x44, 0xb4, 0x06, 0x27, 0x29, 0x53, 0x3b,
144 0xa1, 0x72, 0xb1, 0xb0, 0x7f, 0xec, 0x76, 0x88, 0x68, 0x54, 0xba, 0xff, 0xe4,
145 0x29, 0x67, 0xbc, 0xae, 0x0b, 0x33, 0xc3, 0x78, 0xf8, 0x90, 0xe0, 0x33, 0xda,
146 0x1c, 0x76, 0x5a, 0x18, 0xcf, 0xdf, 0x22, 0x17, 0x7a, 0xba, 0x7d, 0x84, 0x3f,
147 0xd1, 0x4a, 0x18, 0x6d, 0x67, 0x8c, 0xa0, 0x64, 0xe9, 0x57, 0xdc, 0xb9, 0x99,
148 0x89, 0x85, 0xd6, 0x28, 0x82, 0x33, 0x3f, 0x95, 0xda, 0xfb, 0x8b, 0x92, 0x35,
149 0xd2, 0x73, 0x1f, 0xdd, 0x4a, 0x62, 0x0a, 0x67, 0xfb, 0xdc, 0x08, 0x6d, 0x4b,
150 0xe4, 0xed, 0x9f, 0x22, 0xda, 0xe0, 0x02, 0x8e, 0x8c, 0xcb, 0x33, 0xe6, 0x08,
151 0x91, 0x4d, 0x26, 0xf3, 0xc7, 0xdd, 0xad, 0x08, 0xec, 0x63, 0xf0, 0xe8, 0x09,
152 0x14, 0x78, 0xd4, 0xf3, 0xc0, 0xb7, 0xd7, 0x5c, 0x9d, 0x62, 0x00, 0x8c, 0xde,
153 0xde, 0xcd, 0x75, 0x5c, 0x9b, 0xfb, 0x85, 0xce, 0x3d, 0x58, 0xb0, 0x4a, 0xc8,
154 0xc3, 0xc5, 0x86, 0xe5, 0x3f, 0xf4, 0x86, 0x29, 0x57, 0x2e, 0x7a, 0xd4, 0x64,
155 0x29, 0xa8, 0x42, 0xba, 0xf3, 0xb4, 0x92, 0x3f, 0x77, 0xc3, 0x44, 0xaa, 0xcc,
156 0x30, 0xb8, 0x82, 0xb2, 0xcb, 0x29, 0x9c, 0xea, 0x84, 0xa5, 0x0f, 0x58, 0x59,
157 0x3d, 0x43, 0xe3, 0xc4, 0xdd, 0x18, 0xdf, 0xe4, 0x82, 0x45, 0x22, 0xea, 0xa7,
158 0xe2, 0x26, 0xc8, 0x41, 0xfb, 0x37};

◆ key_label

const char* key_label = "label"

Definition at line 37 of file ssh.c.

◆ password

const uint8_t password[] = "password"

Definition at line 38 of file ssh.c.

◆ ssh_ca_pvtkey_file

const char ssh_ca_pvtkey_file[] = "ssh_ca_pvtkey.pem"

Definition at line 36 of file ssh.c.

◆ ssh_req_file

const char ssh_req_file[] = "ssh_req.dat"

Definition at line 71 of file ssh.c.

◆ template_dat

const unsigned char template_dat[]

Definition at line 39 of file ssh.c.

39 {
40 // Timestamp key algorithm RSA2048
41 0x01, 0x00, 0x01, 0x09,
42 // Timestamp public key
43 0x02, 0x01, 0x00, 0xc2, 0x55, 0x62, 0x08, 0xf5, 0xd2, 0xc2, 0x81, 0xb8, 0xa5,
44 0x16, 0xfd, 0x27, 0x25, 0xe6, 0x7e, 0x88, 0xcd, 0xc5, 0xd2, 0xcf, 0xdf, 0xd3,
45 0xea, 0x2d, 0x35, 0xdf, 0x35, 0x27, 0x93, 0x44, 0x45, 0xa6, 0x14, 0x84, 0xee,
46 0xcb, 0x02, 0xc4, 0x7b, 0x67, 0xc5, 0x94, 0x16, 0xde, 0xe4, 0xa6, 0x1f, 0x25,
47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cf, 0x12, 0xaf, 0x8e,
61 0x87, 0x9f, 0x97, 0xf1, 0x1e, 0x00, 0xac, 0xce, 0x2d, 0x12, 0xd4, 0x34, 0x0c,
62 0x40, 0x84, 0x33, 0x3a, 0x6c, 0x9f, 0x22, 0x7d, 0x6f, 0x89, 0x87, 0xfb,
63 // CA key whitelist (0x0001, 0x00ab, 0x0014, 0x0005, 0x003a)
64 0x03, 0x00, 0x0a, 0x00, 0x01, 0x00, 0xab, 0x00, 0x14, 0x00, 0x05, 0x00, 0x3a,
65 // Not before
66 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00,
67 // Not after
68 0x05, 0x00, 0x04, 0xff, 0xff, 0xff, 0xff,
69 // Principals blacklist (root, toor)
70 0x06, 0x00, 0x0a, 0x72, 0x6f, 0x6f, 0x74, 0x00, 0x74, 0x6f, 0x6f, 0x72, 0x00};