1 /* Automatically generated code; do not modify directly. */
9 const unsigned char *ip
;
13 t0_parse7E_unsigned(const unsigned char **p
)
22 x
= (x
<< 7) | (uint32_t)(y
& 0x7F);
30 t0_parse7E_signed(const unsigned char **p
)
35 neg
= ((**p
) >> 6) & 1;
41 x
= (x
<< 7) | (uint32_t)(y
& 0x7F);
44 return -(int32_t)~x
- 1;
52 #define T0_VBYTE(x, n) (unsigned char)((((uint32_t)(x) >> (n)) & 0x7F) | 0x80)
53 #define T0_FBYTE(x, n) (unsigned char)(((uint32_t)(x) >> (n)) & 0x7F)
54 #define T0_SBYTE(x) (unsigned char)((((uint32_t)(x) >> 28) + 0xF8) ^ 0xF8)
55 #define T0_INT1(x) T0_FBYTE(x, 0)
56 #define T0_INT2(x) T0_VBYTE(x, 7), T0_FBYTE(x, 0)
57 #define T0_INT3(x) T0_VBYTE(x, 14), T0_VBYTE(x, 7), T0_FBYTE(x, 0)
58 #define T0_INT4(x) T0_VBYTE(x, 21), T0_VBYTE(x, 14), T0_VBYTE(x, 7), T0_FBYTE(x, 0)
59 #define T0_INT5(x) T0_SBYTE(x), T0_VBYTE(x, 21), T0_VBYTE(x, 14), T0_VBYTE(x, 7), T0_FBYTE(x, 0)
61 static const uint8_t t0_datablock
[];
64 void br_ssl_hs_client_init_main(void *t0ctx
);
66 void br_ssl_hs_client_run(void *t0ctx
);
76 * This macro evaluates to a pointer to the current engine context.
78 #define ENG ((br_ssl_engine_context *)((unsigned char *)t0ctx - offsetof(br_ssl_engine_context, cpu)))
85 * This macro evaluates to a pointer to the client context, under that
86 * specific name. It must be noted that since the engine context is the
87 * first field of the br_ssl_client_context structure ('eng'), then
88 * pointers values of both types are interchangeable, modulo an
89 * appropriate cast. This also means that "adresses" computed as offsets
90 * within the structure work for both kinds of context.
92 #define CTX ((br_ssl_client_context *)ENG)
95 * Generate the pre-master secret for RSA key exchange, and encrypt it
96 * with the server's public key. Returned value is either the encrypted
97 * data length (in bytes), or -x on error, with 'x' being an error code.
99 * This code assumes that the public key has been already verified (it
100 * was properly obtained by the X.509 engine, and it has the right type,
101 * i.e. it is of type RSA and suitable for encryption).
104 make_pms_rsa(br_ssl_client_context
*ctx
, int prf_id
)
106 const br_x509_class
**xc
;
107 const br_x509_pkey
*pk
;
108 const unsigned char *n
;
112 xc
= ctx
->eng
.x509ctx
;
113 pk
= (*xc
)->get_pkey(xc
, NULL
);
116 * Compute actual RSA key length, in case there are leading zeros.
119 nlen
= pk
->key
.rsa
.nlen
;
120 while (nlen
> 0 && *n
== 0) {
126 * We need at least 59 bytes (48 bytes for pre-master secret, and
127 * 11 bytes for the PKCS#1 type 2 padding). Note that the X.509
128 * minimal engine normally blocks RSA keys shorter than 128 bytes,
129 * so this is mostly for public keys provided explicitly by the
133 return -BR_ERR_X509_WEAK_PUBLIC_KEY
;
135 if (nlen
> sizeof ctx
->eng
.pad
) {
136 return -BR_ERR_LIMIT_EXCEEDED
;
142 pms
= ctx
->eng
.pad
+ nlen
- 48;
143 br_enc16be(pms
, ctx
->eng
.version_max
);
144 br_hmac_drbg_generate(&ctx
->eng
.rng
, pms
+ 2, 46);
145 br_ssl_engine_compute_master(&ctx
->eng
, prf_id
, pms
, 48);
148 * Apply PKCS#1 type 2 padding.
150 ctx
->eng
.pad
[0] = 0x00;
151 ctx
->eng
.pad
[1] = 0x02;
152 ctx
->eng
.pad
[nlen
- 49] = 0x00;
153 br_hmac_drbg_generate(&ctx
->eng
.rng
, ctx
->eng
.pad
+ 2, nlen
- 51);
154 for (u
= 2; u
< nlen
- 49; u
++) {
155 while (ctx
->eng
.pad
[u
] == 0) {
156 br_hmac_drbg_generate(&ctx
->eng
.rng
,
157 &ctx
->eng
.pad
[u
], 1);
162 * Compute RSA encryption.
164 if (!ctx
->irsapub(ctx
->eng
.pad
, nlen
, &pk
->key
.rsa
)) {
165 return -BR_ERR_LIMIT_EXCEEDED
;
171 * OID for hash functions in RSA signatures.
173 static const unsigned char HASH_OID_SHA1
[] = {
174 0x05, 0x2B, 0x0E, 0x03, 0x02, 0x1A
177 static const unsigned char HASH_OID_SHA224
[] = {
178 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04
181 static const unsigned char HASH_OID_SHA256
[] = {
182 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01
185 static const unsigned char HASH_OID_SHA384
[] = {
186 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02
189 static const unsigned char HASH_OID_SHA512
[] = {
190 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03
193 static const unsigned char *HASH_OID
[] = {
202 * Check the RSA signature on the ServerKeyExchange message.
204 * hash hash function ID (2 to 6), or 0 for MD5+SHA-1 (with RSA only)
205 * use_rsa non-zero for RSA signature, zero for ECDSA
206 * sig_len signature length (in bytes); signature value is in the pad
208 * Returned value is 0 on success, or an error code.
211 verify_SKE_sig(br_ssl_client_context
*ctx
,
212 int hash
, int use_rsa
, size_t sig_len
)
214 const br_x509_class
**xc
;
215 const br_x509_pkey
*pk
;
216 br_multihash_context mhc
;
217 unsigned char hv
[64], head
[4];
220 xc
= ctx
->eng
.x509ctx
;
221 pk
= (*xc
)->get_pkey(xc
, NULL
);
222 br_multihash_zero(&mhc
);
223 br_multihash_copyimpl(&mhc
, &ctx
->eng
.mhash
);
224 br_multihash_init(&mhc
);
225 br_multihash_update(&mhc
,
226 ctx
->eng
.client_random
, sizeof ctx
->eng
.client_random
);
227 br_multihash_update(&mhc
,
228 ctx
->eng
.server_random
, sizeof ctx
->eng
.server_random
);
231 head
[2] = ctx
->eng
.ecdhe_curve
;
232 head
[3] = ctx
->eng
.ecdhe_point_len
;
233 br_multihash_update(&mhc
, head
, sizeof head
);
234 br_multihash_update(&mhc
,
235 ctx
->eng
.ecdhe_point
, ctx
->eng
.ecdhe_point_len
);
237 hv_len
= br_multihash_out(&mhc
, hash
, hv
);
239 return BR_ERR_INVALID_ALGORITHM
;
242 if (!br_multihash_out(&mhc
, br_md5_ID
, hv
)
243 || !br_multihash_out(&mhc
, br_sha1_ID
, hv
+ 16))
245 return BR_ERR_INVALID_ALGORITHM
;
250 unsigned char tmp
[64];
251 const unsigned char *hash_oid
;
254 hash_oid
= HASH_OID
[hash
- 2];
258 if (!ctx
->eng
.irsavrfy(ctx
->eng
.pad
, sig_len
,
259 hash_oid
, hv_len
, &pk
->key
.rsa
, tmp
)
260 || memcmp(tmp
, hv
, hv_len
) != 0)
262 return BR_ERR_BAD_SIGNATURE
;
265 if (!ctx
->eng
.iecdsa(ctx
->eng
.iec
, hv
, hv_len
, &pk
->key
.ec
,
266 ctx
->eng
.pad
, sig_len
))
268 return BR_ERR_BAD_SIGNATURE
;
275 * Perform client-side ECDH (or ECDHE). The point that should be sent to
276 * the server is written in the pad; returned value is either the point
277 * length (in bytes), or -x on error, with 'x' being an error code.
279 * The point _from_ the server is taken from ecdhe_point[] if 'ecdhe'
280 * is non-zero, or from the X.509 engine context if 'ecdhe' is zero
284 make_pms_ecdh(br_ssl_client_context
*ctx
, unsigned ecdhe
, int prf_id
)
287 unsigned char key
[66], point
[133];
288 const unsigned char *generator
, *order
, *point_src
;
289 size_t glen
, olen
, point_len
;
293 curve
= ctx
->eng
.ecdhe_curve
;
294 point_src
= ctx
->eng
.ecdhe_point
;
295 point_len
= ctx
->eng
.ecdhe_point_len
;
297 const br_x509_class
**xc
;
298 const br_x509_pkey
*pk
;
300 xc
= ctx
->eng
.x509ctx
;
301 pk
= (*xc
)->get_pkey(xc
, NULL
);
302 curve
= pk
->key
.ec
.curve
;
303 point_src
= pk
->key
.ec
.q
;
304 point_len
= pk
->key
.ec
.qlen
;
306 if ((ctx
->eng
.iec
->supported_curves
& ((uint32_t)1 << curve
)) == 0) {
307 return -BR_ERR_INVALID_ALGORITHM
;
311 * We need to generate our key, as a non-zero random value which
312 * is lower than the curve order, in a "large enough" range. We
313 * force top bit to 0 and bottom bit to 1, which guarantees that
314 * the value is in the proper range.
316 order
= ctx
->eng
.iec
->order(curve
, &olen
);
318 while (mask
>= order
[0]) {
321 br_hmac_drbg_generate(&ctx
->eng
.rng
, key
, olen
);
323 key
[olen
- 1] |= 0x01;
326 * Compute the common ECDH point, whose X coordinate is the
329 generator
= ctx
->eng
.iec
->generator(curve
, &glen
);
330 if (glen
!= point_len
) {
331 return -BR_ERR_INVALID_ALGORITHM
;
334 memcpy(point
, point_src
, glen
);
335 if (!ctx
->eng
.iec
->mul(point
, glen
, key
, olen
, curve
)) {
336 return -BR_ERR_INVALID_ALGORITHM
;
340 * The pre-master secret is the X coordinate.
342 br_ssl_engine_compute_master(&ctx
->eng
, prf_id
, point
+ 1, glen
>> 1);
344 memcpy(point
, generator
, glen
);
345 if (!ctx
->eng
.iec
->mul(point
, glen
, key
, olen
, curve
)) {
346 return -BR_ERR_INVALID_ALGORITHM
;
348 memcpy(ctx
->eng
.pad
, point
, glen
);
353 * Perform full static ECDH. This occurs only in the context of client
354 * authentication with certificates: the server uses an EC public key,
355 * the cipher suite is of type ECDH (not ECDHE), the server requested a
356 * client certificate and accepts static ECDH, the client has a
357 * certificate with an EC public key in the same curve, and accepts
358 * static ECDH as well.
360 * Returned value is 0 on success, -1 on error.
363 make_pms_static_ecdh(br_ssl_client_context
*ctx
, int prf_id
)
365 unsigned char point
[133];
367 const br_x509_class
**xc
;
368 const br_x509_pkey
*pk
;
370 xc
= ctx
->eng
.x509ctx
;
371 pk
= (*xc
)->get_pkey(xc
, NULL
);
372 point_len
= pk
->key
.ec
.qlen
;
373 if (point_len
> sizeof point
) {
376 memcpy(point
, pk
->key
.ec
.q
, point_len
);
377 if (!(*ctx
->client_auth_vtable
)->do_keyx(
378 ctx
->client_auth_vtable
, point
, point_len
))
382 br_ssl_engine_compute_master(&ctx
->eng
,
383 prf_id
, point
+ 1, point_len
>> 1);
388 * Compute the client-side signature. This is invoked only when a
389 * signature-based client authentication was selected. The computed
390 * signature is in the pad; its length (in bytes) is returned. On
391 * error, 0 is returned.
394 make_client_sign(br_ssl_client_context
*ctx
)
399 * Compute hash of handshake messages so far. This "cannot" fail
400 * because the list of supported hash functions provided to the
401 * client certificate handler was trimmed to include only the
402 * hash functions that the multi-hasher supports.
405 hv_len
= br_multihash_out(&ctx
->eng
.mhash
,
406 ctx
->hash_id
, ctx
->eng
.pad
);
408 br_multihash_out(&ctx
->eng
.mhash
,
409 br_md5_ID
, ctx
->eng
.pad
);
410 br_multihash_out(&ctx
->eng
.mhash
,
411 br_sha1_ID
, ctx
->eng
.pad
+ 16);
414 return (*ctx
->client_auth_vtable
)->do_sign(
415 ctx
->client_auth_vtable
, ctx
->hash_id
, hv_len
,
416 ctx
->eng
.pad
, sizeof ctx
->eng
.pad
);
421 static const uint8_t t0_datablock
[] = {
422 0x00, 0x00, 0x0A, 0x00, 0x24, 0x00, 0x2F, 0x01, 0x24, 0x00, 0x35, 0x02,
423 0x24, 0x00, 0x3C, 0x01, 0x44, 0x00, 0x3D, 0x02, 0x44, 0x00, 0x9C, 0x03,
424 0x04, 0x00, 0x9D, 0x04, 0x05, 0xC0, 0x03, 0x40, 0x24, 0xC0, 0x04, 0x41,
425 0x24, 0xC0, 0x05, 0x42, 0x24, 0xC0, 0x08, 0x20, 0x24, 0xC0, 0x09, 0x21,
426 0x24, 0xC0, 0x0A, 0x22, 0x24, 0xC0, 0x0D, 0x30, 0x24, 0xC0, 0x0E, 0x31,
427 0x24, 0xC0, 0x0F, 0x32, 0x24, 0xC0, 0x12, 0x10, 0x24, 0xC0, 0x13, 0x11,
428 0x24, 0xC0, 0x14, 0x12, 0x24, 0xC0, 0x23, 0x21, 0x44, 0xC0, 0x24, 0x22,
429 0x55, 0xC0, 0x25, 0x41, 0x44, 0xC0, 0x26, 0x42, 0x55, 0xC0, 0x27, 0x11,
430 0x44, 0xC0, 0x28, 0x12, 0x55, 0xC0, 0x29, 0x31, 0x44, 0xC0, 0x2A, 0x32,
431 0x55, 0xC0, 0x2B, 0x23, 0x04, 0xC0, 0x2C, 0x24, 0x05, 0xC0, 0x2D, 0x43,
432 0x04, 0xC0, 0x2E, 0x44, 0x05, 0xC0, 0x2F, 0x13, 0x04, 0xC0, 0x30, 0x14,
433 0x05, 0xC0, 0x31, 0x33, 0x04, 0xC0, 0x32, 0x34, 0x05, 0xCC, 0xA8, 0x15,
434 0x04, 0xCC, 0xA9, 0x25, 0x04, 0x00, 0x00
437 static const uint8_t t0_codeblock
[] = {
438 0x00, 0x01, 0x00, 0x0A, 0x00, 0x00, 0x01, 0x00, 0x0D, 0x00, 0x00, 0x01,
439 0x00, 0x0E, 0x00, 0x00, 0x01, 0x00, 0x0F, 0x00, 0x00, 0x01, 0x01, 0x08,
440 0x00, 0x00, 0x01, 0x01, 0x09, 0x00, 0x00, 0x01, 0x02, 0x08, 0x00, 0x00,
441 0x01, 0x02, 0x09, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x01,
442 T0_INT1(BR_ERR_BAD_CCS
), 0x00, 0x00, 0x01,
443 T0_INT1(BR_ERR_BAD_CIPHER_SUITE
), 0x00, 0x00, 0x01,
444 T0_INT1(BR_ERR_BAD_COMPRESSION
), 0x00, 0x00, 0x01,
445 T0_INT1(BR_ERR_BAD_FINISHED
), 0x00, 0x00, 0x01,
446 T0_INT1(BR_ERR_BAD_FRAGLEN
), 0x00, 0x00, 0x01,
447 T0_INT1(BR_ERR_BAD_HANDSHAKE
), 0x00, 0x00, 0x01,
448 T0_INT1(BR_ERR_BAD_HELLO_DONE
), 0x00, 0x00, 0x01,
449 T0_INT1(BR_ERR_BAD_PARAM
), 0x00, 0x00, 0x01,
450 T0_INT1(BR_ERR_BAD_SECRENEG
), 0x00, 0x00, 0x01,
451 T0_INT1(BR_ERR_BAD_SNI
), 0x00, 0x00, 0x01, T0_INT1(BR_ERR_BAD_VERSION
),
452 0x00, 0x00, 0x01, T0_INT1(BR_ERR_EXTRA_EXTENSION
), 0x00, 0x00, 0x01,
453 T0_INT1(BR_ERR_INVALID_ALGORITHM
), 0x00, 0x00, 0x01,
454 T0_INT1(BR_ERR_LIMIT_EXCEEDED
), 0x00, 0x00, 0x01, T0_INT1(BR_ERR_OK
),
455 0x00, 0x00, 0x01, T0_INT1(BR_ERR_OVERSIZED_ID
), 0x00, 0x00, 0x01,
456 T0_INT1(BR_ERR_RESUME_MISMATCH
), 0x00, 0x00, 0x01,
457 T0_INT1(BR_ERR_UNEXPECTED
), 0x00, 0x00, 0x01,
458 T0_INT1(BR_ERR_UNSUPPORTED_VERSION
), 0x00, 0x00, 0x01,
459 T0_INT1(BR_ERR_WRONG_KEY_USAGE
), 0x00, 0x00, 0x01,
460 T0_INT2(offsetof(br_ssl_engine_context
, action
)), 0x00, 0x00, 0x01,
461 T0_INT2(offsetof(br_ssl_engine_context
, alert
)), 0x00, 0x00, 0x01,
462 T0_INT2(offsetof(br_ssl_engine_context
, application_data
)), 0x00, 0x00,
463 0x01, T0_INT2(offsetof(br_ssl_client_context
, auth_type
)), 0x00, 0x00,
465 T0_INT2(offsetof(br_ssl_engine_context
, session
) + offsetof(br_ssl_session_parameters
, cipher_suite
)),
467 T0_INT2(offsetof(br_ssl_engine_context
, client_random
)), 0x00, 0x00,
468 0x01, T0_INT2(offsetof(br_ssl_engine_context
, close_received
)), 0x00,
469 0x00, 0x01, T0_INT2(offsetof(br_ssl_engine_context
, ecdhe_curve
)),
471 T0_INT2(offsetof(br_ssl_engine_context
, ecdhe_point
)), 0x00, 0x00,
472 0x01, T0_INT2(offsetof(br_ssl_engine_context
, ecdhe_point_len
)), 0x00,
473 0x00, 0x01, T0_INT2(offsetof(br_ssl_engine_context
, flags
)), 0x00,
474 0x00, 0x01, T0_INT2(offsetof(br_ssl_client_context
, hash_id
)), 0x00,
475 0x00, 0x01, T0_INT2(offsetof(br_ssl_client_context
, hashes
)), 0x00,
476 0x00, 0x01, T0_INT2(offsetof(br_ssl_engine_context
, log_max_frag_len
)),
478 T0_INT2(offsetof(br_ssl_client_context
, min_clienthello_len
)), 0x00,
479 0x00, 0x01, T0_INT2(offsetof(br_ssl_engine_context
, pad
)), 0x00, 0x00,
480 0x01, T0_INT2(offsetof(br_ssl_engine_context
, record_type_in
)), 0x00,
481 0x00, 0x01, T0_INT2(offsetof(br_ssl_engine_context
, record_type_out
)),
482 0x00, 0x00, 0x01, T0_INT2(offsetof(br_ssl_engine_context
, reneg
)),
484 T0_INT2(offsetof(br_ssl_engine_context
, saved_finished
)), 0x00, 0x00,
485 0x01, T0_INT2(offsetof(br_ssl_engine_context
, server_name
)), 0x00,
486 0x00, 0x01, T0_INT2(offsetof(br_ssl_engine_context
, server_random
)),
488 T0_INT2(offsetof(br_ssl_engine_context
, session
) + offsetof(br_ssl_session_parameters
, session_id
)),
490 T0_INT2(offsetof(br_ssl_engine_context
, session
) + offsetof(br_ssl_session_parameters
, session_id_len
)),
492 T0_INT2(offsetof(br_ssl_engine_context
, shutdown_recv
)), 0x00, 0x00,
493 0x01, T0_INT2(offsetof(br_ssl_engine_context
, suites_buf
)), 0x00, 0x00,
494 0x01, T0_INT2(offsetof(br_ssl_engine_context
, suites_num
)), 0x00, 0x00,
496 T0_INT2(offsetof(br_ssl_engine_context
, session
) + offsetof(br_ssl_session_parameters
, version
)),
497 0x00, 0x00, 0x01, T0_INT2(offsetof(br_ssl_engine_context
, version_in
)),
499 T0_INT2(offsetof(br_ssl_engine_context
, version_max
)), 0x00, 0x00,
500 0x01, T0_INT2(offsetof(br_ssl_engine_context
, version_min
)), 0x00,
501 0x00, 0x01, T0_INT2(offsetof(br_ssl_engine_context
, version_out
)),
502 0x00, 0x00, 0x09, 0x25, 0x50, 0x06, 0x02, 0x60, 0x26, 0x00, 0x00, 0x06,
503 0x08, 0x2A, 0x0E, 0x05, 0x02, 0x69, 0x26, 0x04, 0x01, 0x3A, 0x00, 0x00,
504 0x01, 0x01, 0x00, 0x01, 0x03, 0x00, 0x8F, 0x25, 0x56, 0x41, 0x93, 0x25,
505 0x05, 0x04, 0x58, 0x01, 0x00, 0x00, 0x02, 0x00, 0x0E, 0x06, 0x02, 0x93,
506 0x00, 0x56, 0x04, 0x6B, 0x00, 0x06, 0x02, 0x60, 0x26, 0x00, 0x00, 0x25,
507 0x80, 0x41, 0x05, 0x03, 0x01, 0x0C, 0x08, 0x41, 0x71, 0x2A, 0xA1, 0x1C,
508 0x7C, 0x01, 0x0C, 0x2F, 0x00, 0x00, 0x25, 0x1E, 0x01, 0x08, 0x0B, 0x41,
509 0x54, 0x1E, 0x08, 0x00, 0x01, 0x03, 0x00, 0x01, 0x00, 0x6F, 0x3B, 0x27,
510 0x1A, 0x34, 0x06, 0x07, 0x02, 0x00, 0xC3, 0x03, 0x00, 0x04, 0x75, 0x01,
511 0x00, 0xBA, 0x02, 0x00, 0x25, 0x1A, 0x17, 0x06, 0x02, 0x67, 0x26, 0xC3,
512 0x04, 0x76, 0x01, 0x01, 0x00, 0x6F, 0x3B, 0x01, 0x16, 0x7E, 0x3B, 0x32,
513 0xC9, 0x27, 0xA9, 0x06, 0x09, 0x01, 0x7F, 0xA4, 0x01, 0x7F, 0xC6, 0x04,
514 0x80, 0x53, 0xA6, 0x71, 0x2A, 0x97, 0x01, T0_INT1(BR_KEYTYPE_SIGN
),
515 0x17, 0x06, 0x01, 0xAA, 0xAD, 0x25, 0x01, 0x0D, 0x0E, 0x06, 0x07, 0x24,
516 0xAC, 0xAD, 0x01, 0x7F, 0x04, 0x02, 0x01, 0x00, 0x03, 0x00, 0x01, 0x0E,
517 0x0E, 0x05, 0x02, 0x6A, 0x26, 0x06, 0x02, 0x5F, 0x26, 0x31, 0x06, 0x02,
518 0x6A, 0x26, 0x02, 0x00, 0x06, 0x1C, 0xC7, 0x78, 0x2C, 0x01, 0x81, 0x7F,
519 0x0E, 0x06, 0x0D, 0x24, 0x01, 0x10, 0xD2, 0x01, 0x00, 0xD1, 0x71, 0x2A,
520 0xA1, 0x23, 0x04, 0x04, 0xCA, 0x06, 0x01, 0xC8, 0x04, 0x01, 0xCA, 0x01,
521 0x7F, 0xC6, 0x01, 0x7F, 0xA4, 0x01, 0x01, 0x6F, 0x3B, 0x01, 0x17, 0x7E,
522 0x3B, 0x00, 0x00, 0x36, 0x36, 0x00, 0x00, 0x90, 0x01, 0x0C, 0x11, 0x01,
523 0x00, 0x36, 0x0E, 0x06, 0x05, 0x24, 0x01,
524 T0_INT1(BR_KEYTYPE_RSA
| BR_KEYTYPE_KEYX
), 0x04, 0x30, 0x01, 0x01,
525 0x36, 0x0E, 0x06, 0x05, 0x24, 0x01,
526 T0_INT1(BR_KEYTYPE_RSA
| BR_KEYTYPE_SIGN
), 0x04, 0x25, 0x01, 0x02,
527 0x36, 0x0E, 0x06, 0x05, 0x24, 0x01,
528 T0_INT1(BR_KEYTYPE_EC
| BR_KEYTYPE_SIGN
), 0x04, 0x1A, 0x01, 0x03,
529 0x36, 0x0E, 0x06, 0x05, 0x24, 0x01,
530 T0_INT1(BR_KEYTYPE_EC
| BR_KEYTYPE_KEYX
), 0x04, 0x0F, 0x01, 0x04,
531 0x36, 0x0E, 0x06, 0x05, 0x24, 0x01,
532 T0_INT1(BR_KEYTYPE_EC
| BR_KEYTYPE_KEYX
), 0x04, 0x04, 0x01, 0x00,
533 0x41, 0x24, 0x00, 0x00, 0x7A, 0x2C, 0x01, 0x0E, 0x0E, 0x06, 0x04, 0x01,
534 0x00, 0x04, 0x02, 0x01, 0x05, 0x00, 0x00, 0x3D, 0x06, 0x04, 0x01, 0x06,
535 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x7F, 0x2C, 0x25, 0x06, 0x08, 0x01,
536 0x01, 0x09, 0x01, 0x11, 0x07, 0x04, 0x03, 0x24, 0x01, 0x05, 0x00, 0x01,
537 0x3E, 0x03, 0x00, 0x24, 0x01, 0x00, 0x40, 0x06, 0x03, 0x02, 0x00, 0x08,
538 0x3F, 0x06, 0x03, 0x02, 0x00, 0x08, 0x25, 0x06, 0x06, 0x01, 0x01, 0x0B,
539 0x01, 0x06, 0x08, 0x00, 0x00, 0x81, 0x3C, 0x25, 0x06, 0x03, 0x01, 0x09,
540 0x08, 0x00, 0x01, 0x3D, 0x25, 0x06, 0x1E, 0x01, 0x00, 0x03, 0x00, 0x25,
541 0x06, 0x0E, 0x25, 0x01, 0x01, 0x17, 0x02, 0x00, 0x08, 0x03, 0x00, 0x01,
542 0x01, 0x11, 0x04, 0x6F, 0x24, 0x02, 0x00, 0x01, 0x01, 0x0B, 0x01, 0x06,
543 0x08, 0x00, 0x00, 0x77, 0x2B, 0x41, 0x11, 0x01, 0x01, 0x17, 0x33, 0x00,
544 0x00, 0x95, 0xC2, 0x25, 0x01, 0x07, 0x17, 0x01, 0x00, 0x36, 0x0E, 0x06,
545 0x09, 0x24, 0x01, 0x10, 0x17, 0x06, 0x01, 0x95, 0x04, 0x2D, 0x01, 0x01,
546 0x36, 0x0E, 0x06, 0x24, 0x24, 0x24, 0x01, 0x00, 0x6F, 0x3B, 0xA8, 0x7F,
547 0x2C, 0x01, 0x01, 0x0E, 0x01, 0x01, 0x9E, 0x35, 0x06, 0x0F, 0x27, 0x1A,
548 0x34, 0x06, 0x04, 0xC2, 0x24, 0x04, 0x78, 0x01, 0x80, 0x64, 0xBA, 0x04,
549 0x01, 0x95, 0x04, 0x03, 0x6A, 0x26, 0x24, 0x04, 0xFF, 0x3C, 0x01, 0x25,
550 0x03, 0x00, 0x09, 0x25, 0x50, 0x06, 0x02, 0x60, 0x26, 0x02, 0x00, 0x00,
551 0x00, 0x90, 0x01, 0x0F, 0x17, 0x00, 0x00, 0x6E, 0x2C, 0x01, 0x00, 0x36,
552 0x0E, 0x06, 0x10, 0x24, 0x25, 0x01, 0x01, 0x0D, 0x06, 0x03, 0x24, 0x01,
553 0x02, 0x6E, 0x3B, 0x01, 0x00, 0x04, 0x22, 0x01, 0x01, 0x36, 0x0E, 0x06,
554 0x15, 0x24, 0x01, 0x00, 0x6E, 0x3B, 0x25, 0x01, 0x80, 0x64, 0x0E, 0x06,
555 0x05, 0x01, 0x82, 0x00, 0x08, 0x26, 0x52, 0x00, 0x04, 0x07, 0x24, 0x01,
556 0x82, 0x00, 0x08, 0x26, 0x24, 0x00, 0x00, 0x01, 0x00, 0x2D, 0x06, 0x05,
557 0x38, 0xA2, 0x35, 0x04, 0x78, 0x25, 0x06, 0x04, 0x01, 0x01, 0x85, 0x3B,
558 0x00, 0x00, 0x2D, 0x06, 0x0B, 0x7D, 0x2C, 0x01, 0x14, 0x0D, 0x06, 0x02,
559 0x6A, 0x26, 0x04, 0x11, 0xC2, 0x01, 0x07, 0x17, 0x25, 0x01, 0x02, 0x0D,
560 0x06, 0x06, 0x06, 0x02, 0x6A, 0x26, 0x04, 0x70, 0x24, 0xB7, 0x01, 0x01,
561 0x0D, 0x31, 0x35, 0x06, 0x02, 0x59, 0x26, 0x25, 0x01, 0x01, 0xBD, 0x34,
562 0xA7, 0x00, 0x01, 0xAD, 0x01, 0x0B, 0x0E, 0x05, 0x02, 0x6A, 0x26, 0x25,
563 0x01, 0x03, 0x0E, 0x06, 0x08, 0xB5, 0x06, 0x02, 0x60, 0x26, 0x41, 0x24,
564 0x00, 0x41, 0x4F, 0xB5, 0xA0, 0x25, 0x06, 0x23, 0xB5, 0xA0, 0x25, 0x4E,
565 0x25, 0x06, 0x18, 0x25, 0x01, 0x82, 0x00, 0x0F, 0x06, 0x05, 0x01, 0x82,
566 0x00, 0x04, 0x01, 0x25, 0x03, 0x00, 0x7C, 0x02, 0x00, 0xAB, 0x02, 0x00,
567 0x4B, 0x04, 0x65, 0x91, 0x4C, 0x04, 0x5A, 0x91, 0x91, 0x4D, 0x25, 0x06,
568 0x02, 0x33, 0x00, 0x24, 0x29, 0x00, 0x00, 0x71, 0x2A, 0x97, 0x01, 0x7F,
569 0xA5, 0x25, 0x50, 0x06, 0x02, 0x33, 0x26, 0x25, 0x05, 0x02, 0x6A, 0x26,
570 0x36, 0x17, 0x0D, 0x06, 0x02, 0x6C, 0x26, 0x39, 0x00, 0x00, 0x92, 0xAD,
571 0x01, 0x14, 0x0D, 0x06, 0x02, 0x6A, 0x26, 0x7C, 0x01, 0x0C, 0x08, 0x01,
572 0x0C, 0xAB, 0x91, 0x7C, 0x25, 0x01, 0x0C, 0x08, 0x01, 0x0C, 0x2E, 0x05,
573 0x02, 0x5C, 0x26, 0x00, 0x00, 0xAE, 0x06, 0x02, 0x6A, 0x26, 0x06, 0x02,
574 0x5E, 0x26, 0x00, 0x09, 0xAD, 0x01, 0x02, 0x0E, 0x05, 0x02, 0x6A, 0x26,
575 0xB4, 0x03, 0x00, 0x02, 0x00, 0x8B, 0x2A, 0x0A, 0x02, 0x00, 0x8A, 0x2A,
576 0x0F, 0x35, 0x06, 0x02, 0x6B, 0x26, 0x02, 0x00, 0x89, 0x2A, 0x0D, 0x06,
577 0x02, 0x63, 0x26, 0x02, 0x00, 0x8C, 0x3A, 0x82, 0x01, 0x20, 0xAB, 0x01,
578 0x00, 0x03, 0x01, 0xB6, 0x03, 0x02, 0x02, 0x02, 0x01, 0x20, 0x0F, 0x06,
579 0x02, 0x68, 0x26, 0x7C, 0x02, 0x02, 0xAB, 0x02, 0x02, 0x84, 0x2C, 0x0E,
580 0x02, 0x02, 0x01, 0x00, 0x0F, 0x17, 0x06, 0x0B, 0x83, 0x7C, 0x02, 0x02,
581 0x2E, 0x06, 0x04, 0x01, 0x7F, 0x03, 0x01, 0x83, 0x7C, 0x02, 0x02, 0x2F,
582 0x02, 0x02, 0x84, 0x3B, 0x02, 0x00, 0x88, 0x02, 0x01, 0x8E, 0xB4, 0x25,
583 0xB8, 0x50, 0x06, 0x02, 0x5A, 0x26, 0x71, 0x02, 0x01, 0x8E, 0xB6, 0x06,
584 0x02, 0x5B, 0x26, 0x25, 0x06, 0x81, 0x2D, 0xB4, 0xA0, 0x9C, 0x03, 0x03,
585 0x9A, 0x03, 0x04, 0x98, 0x03, 0x05, 0x9B, 0x03, 0x06, 0x9D, 0x03, 0x07,
586 0x99, 0x03, 0x08, 0x25, 0x06, 0x81, 0x03, 0xB4, 0x01, 0x00, 0x36, 0x0E,
587 0x06, 0x0F, 0x24, 0x02, 0x03, 0x05, 0x02, 0x64, 0x26, 0x01, 0x00, 0x03,
588 0x03, 0xB3, 0x04, 0x80, 0x6A, 0x01, 0x01, 0x36, 0x0E, 0x06, 0x0F, 0x24,
589 0x02, 0x05, 0x05, 0x02, 0x64, 0x26, 0x01, 0x00, 0x03, 0x05, 0xB1, 0x04,
590 0x80, 0x55, 0x01, 0x83, 0xFE, 0x01, 0x36, 0x0E, 0x06, 0x0E, 0x24, 0x02,
591 0x04, 0x05, 0x02, 0x64, 0x26, 0x01, 0x00, 0x03, 0x04, 0xB2, 0x04, 0x3F,
592 0x01, 0x0D, 0x36, 0x0E, 0x06, 0x0E, 0x24, 0x02, 0x06, 0x05, 0x02, 0x64,
593 0x26, 0x01, 0x00, 0x03, 0x06, 0xAF, 0x04, 0x2B, 0x01, 0x0A, 0x36, 0x0E,
594 0x06, 0x0E, 0x24, 0x02, 0x07, 0x05, 0x02, 0x64, 0x26, 0x01, 0x00, 0x03,
595 0x07, 0xAF, 0x04, 0x17, 0x01, 0x0B, 0x36, 0x0E, 0x06, 0x0E, 0x24, 0x02,
596 0x08, 0x05, 0x02, 0x64, 0x26, 0x01, 0x00, 0x03, 0x08, 0xAF, 0x04, 0x03,
597 0x64, 0x26, 0x24, 0x04, 0xFE, 0x79, 0x02, 0x04, 0x06, 0x0D, 0x02, 0x04,
598 0x01, 0x05, 0x0F, 0x06, 0x02, 0x61, 0x26, 0x01, 0x01, 0x7F, 0x3B, 0x91,
599 0x91, 0x02, 0x01, 0x00, 0x04, 0xAD, 0x01, 0x0C, 0x0E, 0x05, 0x02, 0x6A,
600 0x26, 0xB6, 0x01, 0x03, 0x0E, 0x05, 0x02, 0x65, 0x26, 0xB4, 0x25, 0x74,
601 0x3B, 0x25, 0x01, 0x20, 0x10, 0x06, 0x02, 0x65, 0x26, 0x3D, 0x41, 0x11,
602 0x01, 0x01, 0x17, 0x05, 0x02, 0x65, 0x26, 0xB6, 0x25, 0x01, 0x81, 0x05,
603 0x0F, 0x06, 0x02, 0x65, 0x26, 0x25, 0x76, 0x3B, 0x75, 0x41, 0xAB, 0x88,
604 0x2A, 0x01, 0x86, 0x03, 0x10, 0x03, 0x00, 0x71, 0x2A, 0xC0, 0x03, 0x01,
605 0x01, 0x02, 0x03, 0x02, 0x02, 0x00, 0x06, 0x21, 0xB6, 0x25, 0x25, 0x01,
606 0x02, 0x0A, 0x41, 0x01, 0x06, 0x0F, 0x35, 0x06, 0x02, 0x65, 0x26, 0x03,
607 0x02, 0xB6, 0x02, 0x01, 0x01, 0x01, 0x0B, 0x01, 0x03, 0x08, 0x0E, 0x05,
608 0x02, 0x65, 0x26, 0x04, 0x08, 0x02, 0x01, 0x06, 0x04, 0x01, 0x00, 0x03,
609 0x02, 0xB4, 0x25, 0x03, 0x03, 0x25, 0x01, 0x84, 0x00, 0x0F, 0x06, 0x02,
610 0x66, 0x26, 0x7C, 0x41, 0xAB, 0x02, 0x02, 0x02, 0x01, 0x02, 0x03, 0x48,
611 0x25, 0x06, 0x01, 0x26, 0x24, 0x91, 0x00, 0x02, 0x03, 0x00, 0x03, 0x01,
612 0x02, 0x00, 0x8D, 0x02, 0x01, 0x02, 0x00, 0x37, 0x25, 0x01, 0x00, 0x0E,
613 0x06, 0x02, 0x58, 0x00, 0xC4, 0x04, 0x74, 0x02, 0x01, 0x00, 0x03, 0x00,
614 0xB6, 0xA0, 0x25, 0x06, 0x80, 0x43, 0xB6, 0x01, 0x01, 0x36, 0x0E, 0x06,
615 0x06, 0x24, 0x01, 0x81, 0x7F, 0x04, 0x2E, 0x01, 0x80, 0x40, 0x36, 0x0E,
616 0x06, 0x07, 0x24, 0x01, 0x83, 0xFE, 0x00, 0x04, 0x20, 0x01, 0x80, 0x41,
617 0x36, 0x0E, 0x06, 0x07, 0x24, 0x01, 0x84, 0x80, 0x00, 0x04, 0x12, 0x01,
618 0x80, 0x42, 0x36, 0x0E, 0x06, 0x07, 0x24, 0x01, 0x88, 0x80, 0x00, 0x04,
619 0x04, 0x01, 0x00, 0x41, 0x24, 0x02, 0x00, 0x35, 0x03, 0x00, 0x04, 0xFF,
620 0x39, 0x91, 0x71, 0x2A, 0xBE, 0x05, 0x09, 0x02, 0x00, 0x01, 0x83, 0xFF,
621 0x7F, 0x17, 0x03, 0x00, 0x88, 0x2A, 0x01, 0x86, 0x03, 0x10, 0x06, 0x3A,
622 0xB0, 0x25, 0x79, 0x3A, 0x3E, 0x24, 0x25, 0x01, 0x08, 0x0B, 0x35, 0x01,
623 0x8C, 0x80, 0x00, 0x35, 0x17, 0x02, 0x00, 0x17, 0x02, 0x00, 0x01, 0x8C,
624 0x80, 0x00, 0x17, 0x06, 0x19, 0x25, 0x01, 0x81, 0x7F, 0x17, 0x06, 0x05,
625 0x01, 0x84, 0x80, 0x00, 0x35, 0x25, 0x01, 0x83, 0xFE, 0x00, 0x17, 0x06,
626 0x05, 0x01, 0x88, 0x80, 0x00, 0x35, 0x03, 0x00, 0x04, 0x09, 0x02, 0x00,
627 0x01, 0x8C, 0x88, 0x01, 0x17, 0x03, 0x00, 0x16, 0xB4, 0xA0, 0x25, 0x06,
628 0x23, 0xB4, 0xA0, 0x25, 0x15, 0x25, 0x06, 0x18, 0x25, 0x01, 0x82, 0x00,
629 0x0F, 0x06, 0x05, 0x01, 0x82, 0x00, 0x04, 0x01, 0x25, 0x03, 0x01, 0x7C,
630 0x02, 0x01, 0xAB, 0x02, 0x01, 0x12, 0x04, 0x65, 0x91, 0x13, 0x04, 0x5A,
631 0x91, 0x14, 0x91, 0x02, 0x00, 0x28, 0x00, 0x00, 0xAE, 0x25, 0x52, 0x06,
632 0x07, 0x24, 0x06, 0x02, 0x5E, 0x26, 0x04, 0x74, 0x00, 0x00, 0xB7, 0x01,
633 0x03, 0xB5, 0x41, 0x24, 0x41, 0x00, 0x00, 0xB4, 0xBB, 0x00, 0x03, 0x01,
634 0x00, 0x03, 0x00, 0xB4, 0xA0, 0x25, 0x06, 0x32, 0xB6, 0x03, 0x01, 0xB6,
635 0x03, 0x02, 0x02, 0x01, 0x01, 0x02, 0x10, 0x02, 0x01, 0x01, 0x06, 0x0C,
636 0x17, 0x02, 0x02, 0x01, 0x01, 0x0E, 0x02, 0x02, 0x01, 0x03, 0x0E, 0x35,
637 0x17, 0x06, 0x11, 0x02, 0x00, 0x01, 0x01, 0x02, 0x02, 0x55, 0x01, 0x02,
638 0x0B, 0x02, 0x01, 0x08, 0x0B, 0x35, 0x03, 0x00, 0x04, 0x4B, 0x91, 0x02,
639 0x00, 0x00, 0x00, 0xB4, 0x01, 0x01, 0x0E, 0x05, 0x02, 0x5D, 0x26, 0xB6,
640 0x01, 0x08, 0x08, 0x7A, 0x2C, 0x0E, 0x05, 0x02, 0x5D, 0x26, 0x00, 0x00,
641 0xB4, 0x7F, 0x2C, 0x05, 0x15, 0x01, 0x01, 0x0E, 0x05, 0x02, 0x61, 0x26,
642 0xB6, 0x01, 0x00, 0x0E, 0x05, 0x02, 0x61, 0x26, 0x01, 0x02, 0x7F, 0x3B,
643 0x04, 0x1C, 0x01, 0x19, 0x0E, 0x05, 0x02, 0x61, 0x26, 0xB6, 0x01, 0x18,
644 0x0E, 0x05, 0x02, 0x61, 0x26, 0x7C, 0x01, 0x18, 0xAB, 0x80, 0x7C, 0x01,
645 0x18, 0x2E, 0x05, 0x02, 0x61, 0x26, 0x00, 0x00, 0xB4, 0x06, 0x02, 0x62,
646 0x26, 0x00, 0x00, 0x01, 0x02, 0x8D, 0xB7, 0x01, 0x08, 0x0B, 0xB7, 0x08,
647 0x00, 0x00, 0x01, 0x03, 0x8D, 0xB7, 0x01, 0x08, 0x0B, 0xB7, 0x08, 0x01,
648 0x08, 0x0B, 0xB7, 0x08, 0x00, 0x00, 0x01, 0x01, 0x8D, 0xB7, 0x00, 0x00,
649 0x38, 0x25, 0x50, 0x05, 0x01, 0x00, 0x24, 0xC4, 0x04, 0x76, 0x02, 0x03,
650 0x00, 0x87, 0x2C, 0x03, 0x01, 0x01, 0x00, 0x25, 0x02, 0x01, 0x0A, 0x06,
651 0x10, 0x25, 0x01, 0x01, 0x0B, 0x86, 0x08, 0x2A, 0x02, 0x00, 0x0E, 0x06,
652 0x01, 0x00, 0x54, 0x04, 0x6A, 0x24, 0x01, 0x7F, 0x00, 0x00, 0x01, 0x15,
653 0x7E, 0x3B, 0x41, 0x4A, 0x24, 0x4A, 0x24, 0x27, 0x00, 0x00, 0x01, 0x01,
654 0x41, 0xB9, 0x00, 0x00, 0x41, 0x36, 0x8D, 0x41, 0x25, 0x06, 0x05, 0xB7,
655 0x24, 0x55, 0x04, 0x78, 0x24, 0x00, 0x00, 0x25, 0x01, 0x81, 0xAC, 0x00,
656 0x0E, 0x06, 0x04, 0x24, 0x01, 0x7F, 0x00, 0x90, 0x51, 0x00, 0x02, 0x03,
657 0x00, 0x71, 0x2A, 0x90, 0x03, 0x01, 0x02, 0x01, 0x01, 0x0F, 0x17, 0x02,
658 0x01, 0x01, 0x04, 0x11, 0x01, 0x0F, 0x17, 0x02, 0x01, 0x01, 0x08, 0x11,
659 0x01, 0x0F, 0x17, 0x01, 0x00, 0x36, 0x0E, 0x06, 0x10, 0x24, 0x01, 0x00,
660 0x01, 0x18, 0x02, 0x00, 0x06, 0x03, 0x44, 0x04, 0x01, 0x45, 0x04, 0x80,
661 0x56, 0x01, 0x01, 0x36, 0x0E, 0x06, 0x10, 0x24, 0x01, 0x01, 0x01, 0x10,
662 0x02, 0x00, 0x06, 0x03, 0x44, 0x04, 0x01, 0x45, 0x04, 0x80, 0x40, 0x01,
663 0x02, 0x36, 0x0E, 0x06, 0x0F, 0x24, 0x01, 0x01, 0x01, 0x20, 0x02, 0x00,
664 0x06, 0x03, 0x44, 0x04, 0x01, 0x45, 0x04, 0x2B, 0x01, 0x03, 0x36, 0x0E,
665 0x06, 0x0E, 0x24, 0x24, 0x01, 0x10, 0x02, 0x00, 0x06, 0x03, 0x42, 0x04,
666 0x01, 0x43, 0x04, 0x17, 0x01, 0x04, 0x36, 0x0E, 0x06, 0x0E, 0x24, 0x24,
667 0x01, 0x20, 0x02, 0x00, 0x06, 0x03, 0x42, 0x04, 0x01, 0x43, 0x04, 0x03,
668 0x60, 0x26, 0x24, 0x00, 0x00, 0x90, 0x01, 0x0C, 0x11, 0x01, 0x02, 0x0F,
669 0x00, 0x00, 0x90, 0x01, 0x0C, 0x11, 0x25, 0x53, 0x41, 0x01, 0x03, 0x0A,
670 0x17, 0x00, 0x00, 0x90, 0x01, 0x0C, 0x11, 0x01, 0x01, 0x0E, 0x00, 0x00,
671 0x90, 0x01, 0x0C, 0x11, 0x52, 0x00, 0x00, 0x1B, 0x01, 0x00, 0x6D, 0x2C,
672 0x25, 0x06, 0x1F, 0x01, 0x01, 0x36, 0x0E, 0x06, 0x06, 0x24, 0x01, 0x00,
673 0x94, 0x04, 0x11, 0x01, 0x02, 0x36, 0x0E, 0x06, 0x0A, 0x24, 0x6F, 0x2C,
674 0x06, 0x03, 0x01, 0x10, 0x35, 0x04, 0x01, 0x24, 0x04, 0x01, 0x24, 0x73,
675 0x2C, 0x05, 0x33, 0x2D, 0x06, 0x30, 0x7D, 0x2C, 0x01, 0x14, 0x36, 0x0E,
676 0x06, 0x06, 0x24, 0x01, 0x02, 0x35, 0x04, 0x22, 0x01, 0x15, 0x36, 0x0E,
677 0x06, 0x09, 0x24, 0xA3, 0x06, 0x03, 0x01, 0x7F, 0x94, 0x04, 0x13, 0x01,
678 0x16, 0x36, 0x0E, 0x06, 0x06, 0x24, 0x01, 0x01, 0x35, 0x04, 0x07, 0x24,
679 0x01, 0x04, 0x35, 0x01, 0x00, 0x24, 0x1A, 0x06, 0x03, 0x01, 0x08, 0x35,
680 0x00, 0x00, 0x1B, 0x25, 0x05, 0x0F, 0x2D, 0x06, 0x0C, 0x7D, 0x2C, 0x01,
681 0x15, 0x0E, 0x06, 0x04, 0x24, 0xA3, 0x04, 0x01, 0x1F, 0x00, 0x00, 0xC2,
682 0x01, 0x07, 0x17, 0x01, 0x01, 0x0F, 0x06, 0x02, 0x6A, 0x26, 0x00, 0x01,
683 0x03, 0x00, 0x27, 0x1A, 0x06, 0x05, 0x02, 0x00, 0x7E, 0x3B, 0x00, 0xC2,
684 0x24, 0x04, 0x74, 0x00, 0x01, 0x14, 0xC5, 0x01, 0x01, 0xD2, 0x27, 0x25,
685 0x01, 0x00, 0xBD, 0x01, 0x16, 0xC5, 0xCB, 0x27, 0x00, 0x00, 0x01, 0x0B,
686 0xD2, 0x46, 0x25, 0x25, 0x01, 0x03, 0x08, 0xD1, 0xD1, 0x18, 0x25, 0x50,
687 0x06, 0x02, 0x24, 0x00, 0xD1, 0x1D, 0x25, 0x06, 0x05, 0x7C, 0x41, 0xCC,
688 0x04, 0x77, 0x24, 0x04, 0x6C, 0x00, 0x20, 0x01, 0x0F, 0xD2, 0x25, 0x88,
689 0x2A, 0x01, 0x86, 0x03, 0x10, 0x06, 0x0C, 0x01, 0x04, 0x08, 0xD1, 0x78,
690 0x2C, 0xD2, 0x70, 0x2C, 0xD2, 0x04, 0x02, 0x56, 0xD1, 0x25, 0xD0, 0x7C,
691 0x41, 0xCC, 0x00, 0x02, 0x9A, 0x9C, 0x08, 0x98, 0x08, 0x9B, 0x08, 0x9D,
692 0x08, 0x99, 0x08, 0x03, 0x00, 0x01, 0x01, 0xD2, 0x01, 0x27, 0x84, 0x2C,
693 0x08, 0x87, 0x2C, 0x01, 0x01, 0x0B, 0x08, 0x02, 0x00, 0x06, 0x04, 0x56,
694 0x02, 0x00, 0x08, 0x7B, 0x2A, 0x36, 0x09, 0x25, 0x53, 0x06, 0x24, 0x02,
695 0x00, 0x05, 0x04, 0x41, 0x56, 0x41, 0x57, 0x01, 0x04, 0x09, 0x25, 0x50,
696 0x06, 0x03, 0x24, 0x01, 0x00, 0x25, 0x01, 0x04, 0x08, 0x02, 0x00, 0x08,
697 0x03, 0x00, 0x41, 0x01, 0x04, 0x08, 0x36, 0x08, 0x41, 0x04, 0x03, 0x24,
698 0x01, 0x7F, 0x03, 0x01, 0xD1, 0x8A, 0x2A, 0xD0, 0x72, 0x01, 0x04, 0x19,
699 0x72, 0x01, 0x04, 0x08, 0x01, 0x1C, 0x30, 0x72, 0x01, 0x20, 0xCC, 0x83,
700 0x84, 0x2C, 0xCE, 0x87, 0x2C, 0x25, 0x01, 0x01, 0x0B, 0xD0, 0x86, 0x41,
701 0x25, 0x06, 0x0F, 0x55, 0x36, 0x2A, 0x25, 0xBC, 0x05, 0x02, 0x5A, 0x26,
702 0xD0, 0x41, 0x56, 0x41, 0x04, 0x6E, 0x58, 0x01, 0x01, 0xD2, 0x01, 0x00,
703 0xD2, 0x02, 0x00, 0x06, 0x81, 0x22, 0x02, 0x00, 0xD0, 0x9A, 0x06, 0x0E,
704 0x01, 0x83, 0xFE, 0x01, 0xD0, 0x80, 0x9A, 0x01, 0x04, 0x09, 0x25, 0xD0,
705 0x55, 0xCE, 0x9C, 0x06, 0x16, 0x01, 0x00, 0xD0, 0x81, 0x9C, 0x01, 0x04,
706 0x09, 0x25, 0xD0, 0x01, 0x02, 0x09, 0x25, 0xD0, 0x01, 0x00, 0xD2, 0x01,
707 0x03, 0x09, 0xCD, 0x98, 0x06, 0x0C, 0x01, 0x01, 0xD0, 0x01, 0x01, 0xD0,
708 0x7A, 0x2C, 0x01, 0x08, 0x09, 0xD2, 0x9B, 0x06, 0x19, 0x01, 0x0D, 0xD0,
709 0x9B, 0x01, 0x04, 0x09, 0x25, 0xD0, 0x01, 0x02, 0x09, 0xD0, 0x3F, 0x06,
710 0x03, 0x01, 0x03, 0xCF, 0x40, 0x06, 0x03, 0x01, 0x01, 0xCF, 0x9D, 0x25,
711 0x06, 0x22, 0x01, 0x0A, 0xD0, 0x01, 0x04, 0x09, 0x25, 0xD0, 0x57, 0xD0,
712 0x3D, 0x01, 0x00, 0x25, 0x01, 0x20, 0x0A, 0x06, 0x0C, 0x96, 0x11, 0x01,
713 0x01, 0x17, 0x06, 0x02, 0x25, 0xD0, 0x54, 0x04, 0x6E, 0x58, 0x04, 0x01,
714 0x24, 0x99, 0x06, 0x0A, 0x01, 0x0B, 0xD0, 0x01, 0x02, 0xD0, 0x01, 0x82,
715 0x00, 0xD0, 0x02, 0x01, 0x50, 0x05, 0x11, 0x01, 0x15, 0xD0, 0x02, 0x01,
716 0x25, 0xD0, 0x25, 0x06, 0x06, 0x55, 0x01, 0x00, 0xD2, 0x04, 0x77, 0x24,
717 0x00, 0x00, 0x01, 0x10, 0xD2, 0x71, 0x2A, 0x25, 0xC1, 0x06, 0x0C, 0xA1,
718 0x22, 0x25, 0x56, 0xD1, 0x25, 0xD0, 0x7C, 0x41, 0xCC, 0x04, 0x0D, 0x25,
719 0xBF, 0x41, 0xA1, 0x21, 0x25, 0x54, 0xD1, 0x25, 0xD2, 0x7C, 0x41, 0xCC,
720 0x00, 0x00, 0x92, 0x01, 0x14, 0xD2, 0x01, 0x0C, 0xD1, 0x7C, 0x01, 0x0C,
721 0xCC, 0x00, 0x00, 0x49, 0x25, 0x01, 0x00, 0x0E, 0x06, 0x02, 0x58, 0x00,
722 0xC2, 0x24, 0x04, 0x73, 0x00, 0x25, 0xD0, 0xCC, 0x00, 0x00, 0x25, 0xD2,
723 0xCC, 0x00, 0x01, 0x03, 0x00, 0x3E, 0x24, 0x25, 0x01, 0x10, 0x17, 0x06,
724 0x06, 0x01, 0x04, 0xD2, 0x02, 0x00, 0xD2, 0x25, 0x01, 0x08, 0x17, 0x06,
725 0x06, 0x01, 0x03, 0xD2, 0x02, 0x00, 0xD2, 0x25, 0x01, 0x20, 0x17, 0x06,
726 0x06, 0x01, 0x05, 0xD2, 0x02, 0x00, 0xD2, 0x25, 0x01, 0x80, 0x40, 0x17,
727 0x06, 0x06, 0x01, 0x06, 0xD2, 0x02, 0x00, 0xD2, 0x01, 0x04, 0x17, 0x06,
728 0x06, 0x01, 0x02, 0xD2, 0x02, 0x00, 0xD2, 0x00, 0x00, 0x25, 0x01, 0x08,
729 0x47, 0xD2, 0xD2, 0x00, 0x00, 0x25, 0x01, 0x10, 0x47, 0xD2, 0xD0, 0x00,
730 0x00, 0x25, 0x4A, 0x06, 0x02, 0x24, 0x00, 0xC2, 0x24, 0x04, 0x76
733 static const uint16_t t0_caddr
[] = {
867 #define T0_INTERPRETED 80
869 #define T0_ENTER(ip, rp, slot) do { \
870 const unsigned char *t0_newip; \
872 t0_newip = &t0_codeblock[t0_caddr[(slot) - T0_INTERPRETED]]; \
873 t0_lnum = t0_parse7E_unsigned(&t0_newip); \
875 *((rp) ++) = (uint32_t)((ip) - &t0_codeblock[0]) + (t0_lnum << 16); \
879 #define T0_DEFENTRY(name, slot) \
883 t0_context *t0ctx = ctx; \
884 t0ctx->ip = &t0_codeblock[0]; \
885 T0_ENTER(t0ctx->ip, t0ctx->rp, slot); \
888 T0_DEFENTRY(br_ssl_hs_client_init_main
, 159)
890 #define T0_NEXT(t0ipp) (*(*(t0ipp)) ++)
893 br_ssl_hs_client_run(void *t0ctx
)
896 const unsigned char *ip
;
898 #define T0_LOCAL(x) (*(rp - 2 - (x)))
899 #define T0_POP() (*-- dp)
900 #define T0_POPi() (*(int32_t *)(-- dp))
901 #define T0_PEEK(x) (*(dp - 1 - (x)))
902 #define T0_PEEKi(x) (*(int32_t *)(dp - 1 - (x)))
903 #define T0_PUSH(v) do { *dp = (v); dp ++; } while (0)
904 #define T0_PUSHi(v) do { *(int32_t *)dp = (v); dp ++; } while (0)
905 #define T0_RPOP() (*-- rp)
906 #define T0_RPOPi() (*(int32_t *)(-- rp))
907 #define T0_RPUSH(v) do { *rp = (v); rp ++; } while (0)
908 #define T0_RPUSHi(v) do { *(int32_t *)rp = (v); rp ++; } while (0)
909 #define T0_ROLL(x) do { \
910 size_t t0len = (size_t)(x); \
911 uint32_t t0tmp = *(dp - 1 - t0len); \
912 memmove(dp - t0len - 1, dp - t0len, t0len * sizeof *dp); \
915 #define T0_SWAP() do { \
916 uint32_t t0tmp = *(dp - 2); \
917 *(dp - 2) = *(dp - 1); \
920 #define T0_ROT() do { \
921 uint32_t t0tmp = *(dp - 3); \
922 *(dp - 3) = *(dp - 2); \
923 *(dp - 2) = *(dp - 1); \
926 #define T0_NROT() do { \
927 uint32_t t0tmp = *(dp - 1); \
928 *(dp - 1) = *(dp - 2); \
929 *(dp - 2) = *(dp - 3); \
932 #define T0_PICK(x) do { \
933 uint32_t t0depth = (x); \
934 T0_PUSH(T0_PEEK(t0depth)); \
936 #define T0_CO() do { \
939 #define T0_RET() goto t0_next
941 dp
= ((t0_context
*)t0ctx
)->dp
;
942 rp
= ((t0_context
*)t0ctx
)->rp
;
943 ip
= ((t0_context
*)t0ctx
)->ip
;
950 if (t0x
< T0_INTERPRETED
) {
962 ip
= &t0_codeblock
[t0x
];
964 case 1: /* literal constant */
965 T0_PUSHi(t0_parse7E_signed(&ip
));
967 case 2: /* read local */
968 T0_PUSH(T0_LOCAL(t0_parse7E_unsigned(&ip
)));
970 case 3: /* write local */
971 T0_LOCAL(t0_parse7E_unsigned(&ip
)) = T0_POP();
974 t0off
= t0_parse7E_signed(&ip
);
977 case 5: /* jump if */
978 t0off
= t0_parse7E_signed(&ip
);
983 case 6: /* jump if not */
984 t0off
= t0_parse7E_signed(&ip
);
992 uint32_t b
= T0_POP();
993 uint32_t a
= T0_POP();
1001 uint32_t b
= T0_POP();
1002 uint32_t a
= T0_POP();
1010 uint32_t b
= T0_POP();
1011 uint32_t a
= T0_POP();
1019 int32_t b
= T0_POPi();
1020 int32_t a
= T0_POPi();
1021 T0_PUSH(-(uint32_t)(a
< b
));
1028 int c
= (int)T0_POPi();
1029 uint32_t x
= T0_POP();
1037 int32_t b
= T0_POPi();
1038 int32_t a
= T0_POPi();
1039 T0_PUSH(-(uint32_t)(a
<= b
));
1046 uint32_t b
= T0_POP();
1047 uint32_t a
= T0_POP();
1048 T0_PUSH(-(uint32_t)(a
!= b
));
1055 uint32_t b
= T0_POP();
1056 uint32_t a
= T0_POP();
1057 T0_PUSH(-(uint32_t)(a
== b
));
1064 int32_t b
= T0_POPi();
1065 int32_t a
= T0_POPi();
1066 T0_PUSH(-(uint32_t)(a
> b
));
1073 int32_t b
= T0_POPi();
1074 int32_t a
= T0_POPi();
1075 T0_PUSH(-(uint32_t)(a
>= b
));
1082 int c
= (int)T0_POPi();
1083 int32_t x
= T0_POPi();
1089 /* anchor-dn-append-name */
1094 if (CTX
->client_auth_vtable
!= NULL
) {
1095 (*CTX
->client_auth_vtable
)->append_name(
1096 CTX
->client_auth_vtable
, ENG
->pad
, len
);
1102 /* anchor-dn-end-name */
1104 if (CTX
->client_auth_vtable
!= NULL
) {
1105 (*CTX
->client_auth_vtable
)->end_name(
1106 CTX
->client_auth_vtable
);
1112 /* anchor-dn-end-name-list */
1114 if (CTX
->client_auth_vtable
!= NULL
) {
1115 (*CTX
->client_auth_vtable
)->end_name_list(
1116 CTX
->client_auth_vtable
);
1122 /* anchor-dn-start-name */
1127 if (CTX
->client_auth_vtable
!= NULL
) {
1128 (*CTX
->client_auth_vtable
)->start_name(
1129 CTX
->client_auth_vtable
, len
);
1135 /* anchor-dn-start-name-list */
1137 if (CTX
->client_auth_vtable
!= NULL
) {
1138 (*CTX
->client_auth_vtable
)->start_name_list(
1139 CTX
->client_auth_vtable
);
1147 uint32_t b
= T0_POP();
1148 uint32_t a
= T0_POP();
1156 if (ENG
->chain_len
== 0) {
1159 ENG
->cert_cur
= ENG
->chain
->data
;
1160 ENG
->cert_len
= ENG
->chain
->data_len
;
1163 T0_PUSH(ENG
->cert_len
);
1171 size_t len
= (size_t)T0_POP();
1172 void *addr
= (unsigned char *)ENG
+ (size_t)T0_POP();
1173 memset(addr
, 0, len
);
1180 T0_PUSHi(-(ENG
->hlen_out
> 0));
1190 /* compute-Finished-inner */
1192 int prf_id
= T0_POP();
1193 int from_client
= T0_POPi();
1194 unsigned char seed
[48];
1197 br_tls_prf_impl prf
= br_ssl_engine_get_PRF(ENG
, prf_id
);
1198 if (ENG
->session
.version
>= BR_TLS12
) {
1199 seed_len
= br_multihash_out(&ENG
->mhash
, prf_id
, seed
);
1201 br_multihash_out(&ENG
->mhash
, br_md5_ID
, seed
);
1202 br_multihash_out(&ENG
->mhash
, br_sha1_ID
, seed
+ 16);
1205 prf(ENG
->pad
, 12, ENG
->session
.master_secret
,
1206 sizeof ENG
->session
.master_secret
,
1207 from_client
? "client finished" : "server finished",
1213 /* copy-cert-chunk */
1217 clen
= ENG
->cert_len
;
1218 if (clen
> sizeof ENG
->pad
) {
1219 clen
= sizeof ENG
->pad
;
1221 memcpy(ENG
->pad
, ENG
->cert_cur
, clen
);
1222 ENG
->cert_cur
+= clen
;
1223 ENG
->cert_len
-= clen
;
1231 size_t addr
= T0_POP();
1232 T0_PUSH(t0_datablock
[addr
]);
1244 /* do-client-sign */
1248 sig_len
= make_client_sign(CTX
);
1250 br_ssl_engine_fail(ENG
, BR_ERR_INVALID_ALGORITHM
);
1260 unsigned prf_id
= T0_POP();
1261 unsigned ecdhe
= T0_POP();
1264 x
= make_pms_ecdh(CTX
, ecdhe
, prf_id
);
1266 br_ssl_engine_fail(ENG
, -x
);
1275 /* do-rsa-encrypt */
1279 x
= make_pms_rsa(CTX
, T0_POP());
1281 br_ssl_engine_fail(ENG
, -x
);
1290 /* do-static-ecdh */
1292 unsigned prf_id
= T0_POP();
1294 if (make_pms_static_ecdh(CTX
, prf_id
) < 0) {
1295 br_ssl_engine_fail(ENG
, BR_ERR_INVALID_ALGORITHM
);
1308 T0_PUSH(T0_PEEK(0));
1314 br_ssl_engine_fail(ENG
, (int)T0_POPi());
1322 br_ssl_engine_flush_record(ENG
);
1327 /* get-client-chain */
1329 uint32_t auth_types
;
1331 auth_types
= T0_POP();
1332 if (CTX
->client_auth_vtable
!= NULL
) {
1333 br_ssl_client_certificate ux
;
1335 (*CTX
->client_auth_vtable
)->choose(CTX
->client_auth_vtable
,
1336 CTX
, auth_types
, &ux
);
1337 CTX
->auth_type
= (unsigned char)ux
.auth_type
;
1338 CTX
->hash_id
= (unsigned char)ux
.hash_id
;
1339 ENG
->chain
= ux
.chain
;
1340 ENG
->chain_len
= ux
.chain_len
;
1349 /* get-key-type-usages */
1351 const br_x509_class
*xc
;
1352 const br_x509_pkey
*pk
;
1355 xc
= *(ENG
->x509ctx
);
1356 pk
= xc
->get_pkey(ENG
->x509ctx
, &usages
);
1360 T0_PUSH(pk
->key_type
| usages
);
1368 size_t addr
= (size_t)T0_POP();
1369 T0_PUSH(*(uint16_t *)((unsigned char *)ENG
+ addr
));
1376 size_t addr
= (size_t)T0_POP();
1377 T0_PUSH(*(uint32_t *)((unsigned char *)ENG
+ addr
));
1384 size_t addr
= (size_t)T0_POP();
1385 T0_PUSH(*((unsigned char *)ENG
+ addr
));
1392 T0_PUSHi(-(ENG
->hlen_in
!= 0));
1399 size_t len
= (size_t)T0_POP();
1400 void *addr2
= (unsigned char *)ENG
+ (size_t)T0_POP();
1401 void *addr1
= (unsigned char *)ENG
+ (size_t)T0_POP();
1402 int x
= memcmp(addr1
, addr2
, len
);
1403 T0_PUSH((uint32_t)-(x
== 0));
1410 size_t len
= (size_t)T0_POP();
1411 void *src
= (unsigned char *)ENG
+ (size_t)T0_POP();
1412 void *dst
= (unsigned char *)ENG
+ (size_t)T0_POP();
1413 memcpy(dst
, src
, len
);
1420 size_t len
= (size_t)T0_POP();
1421 void *addr
= (unsigned char *)ENG
+ (size_t)T0_POP();
1422 br_hmac_drbg_generate(&ENG
->rng
, addr
, len
);
1427 /* more-incoming-bytes? */
1429 T0_PUSHi(ENG
->hlen_in
!= 0 || !br_ssl_engine_recvrec_finished(ENG
));
1434 /* multihash-init */
1436 br_multihash_init(&ENG
->mhash
);
1443 uint32_t a
= T0_POP();
1451 uint32_t a
= T0_POP();
1459 uint32_t b
= T0_POP();
1460 uint32_t a
= T0_POP();
1467 T0_PUSH(T0_PEEK(1));
1471 /* read-chunk-native */
1473 size_t clen
= ENG
->hlen_in
;
1479 if ((size_t)len
< clen
) {
1482 memcpy((unsigned char *)ENG
+ addr
, ENG
->hbuf_in
, clen
);
1483 if (ENG
->record_type_in
== BR_SSL_HANDSHAKE
) {
1484 br_multihash_update(&ENG
->mhash
, ENG
->hbuf_in
, clen
);
1486 T0_PUSH(addr
+ (uint32_t)clen
);
1487 T0_PUSH(len
- (uint32_t)clen
);
1488 ENG
->hbuf_in
+= clen
;
1489 ENG
->hlen_in
-= clen
;
1497 if (ENG
->hlen_in
> 0) {
1500 x
= *ENG
->hbuf_in
++;
1501 if (ENG
->record_type_in
== BR_SSL_HANDSHAKE
) {
1502 br_multihash_update(&ENG
->mhash
, &x
, 1);
1513 /* set-server-curve */
1515 const br_x509_class
*xc
;
1516 const br_x509_pkey
*pk
;
1518 xc
= *(ENG
->x509ctx
);
1519 pk
= xc
->get_pkey(ENG
->x509ctx
, NULL
);
1521 (pk
->key_type
== BR_KEYTYPE_EC
) ? pk
->key
.ec
.curve
: 0;
1528 size_t addr
= (size_t)T0_POP();
1529 *(uint16_t *)((unsigned char *)ENG
+ addr
) = (uint16_t)T0_POP();
1536 size_t addr
= (size_t)T0_POP();
1537 *((unsigned char *)ENG
+ addr
) = (unsigned char)T0_POP();
1544 void *str
= (unsigned char *)ENG
+ (size_t)T0_POP();
1545 T0_PUSH((uint32_t)strlen(str
));
1550 /* supported-curves */
1552 uint32_t x
= ENG
->iec
== NULL
? 0 : ENG
->iec
->supported_curves
;
1558 /* supported-hash-functions */
1565 for (i
= br_sha1_ID
; i
<= br_sha512_ID
; i
++) {
1566 if (br_multihash_getimpl(&ENG
->mhash
, i
)) {
1577 /* supports-ecdsa? */
1579 T0_PUSHi(-(ENG
->iecdsa
!= 0));
1584 /* supports-rsa-sign? */
1586 T0_PUSHi(-(ENG
->irsavrfy
!= 0));
1596 /* switch-aesgcm-in */
1598 int is_client
, prf_id
;
1599 unsigned cipher_key_len
;
1601 cipher_key_len
= T0_POP();
1603 is_client
= T0_POP();
1604 br_ssl_engine_switch_gcm_in(ENG
, is_client
, prf_id
,
1605 ENG
->iaes_ctr
, cipher_key_len
);
1610 /* switch-aesgcm-out */
1612 int is_client
, prf_id
;
1613 unsigned cipher_key_len
;
1615 cipher_key_len
= T0_POP();
1617 is_client
= T0_POP();
1618 br_ssl_engine_switch_gcm_out(ENG
, is_client
, prf_id
,
1619 ENG
->iaes_ctr
, cipher_key_len
);
1626 int is_client
, prf_id
, mac_id
, aes
;
1627 unsigned cipher_key_len
;
1629 cipher_key_len
= T0_POP();
1633 is_client
= T0_POP();
1634 br_ssl_engine_switch_cbc_in(ENG
, is_client
, prf_id
, mac_id
,
1635 aes
? ENG
->iaes_cbcdec
: ENG
->ides_cbcdec
, cipher_key_len
);
1640 /* switch-cbc-out */
1642 int is_client
, prf_id
, mac_id
, aes
;
1643 unsigned cipher_key_len
;
1645 cipher_key_len
= T0_POP();
1649 is_client
= T0_POP();
1650 br_ssl_engine_switch_cbc_out(ENG
, is_client
, prf_id
, mac_id
,
1651 aes
? ENG
->iaes_cbcenc
: ENG
->ides_cbcenc
, cipher_key_len
);
1656 /* total-chain-length */
1662 for (u
= 0; u
< ENG
->chain_len
; u
++) {
1663 total
+= 3 + (uint32_t)ENG
->chain
[u
].data_len
;
1672 int c
= (int)T0_POPi();
1673 uint32_t x
= T0_POP();
1679 /* verify-SKE-sig */
1681 size_t sig_len
= T0_POP();
1682 int use_rsa
= T0_POPi();
1683 int hash
= T0_POPi();
1685 T0_PUSH(verify_SKE_sig(CTX
, hash
, use_rsa
, sig_len
));
1690 /* write-blob-chunk */
1692 size_t clen
= ENG
->hlen_out
;
1698 if ((size_t)len
< clen
) {
1701 memcpy(ENG
->hbuf_out
, (unsigned char *)ENG
+ addr
, clen
);
1702 if (ENG
->record_type_out
== BR_SSL_HANDSHAKE
) {
1703 br_multihash_update(&ENG
->mhash
, ENG
->hbuf_out
, clen
);
1705 T0_PUSH(addr
+ (uint32_t)clen
);
1706 T0_PUSH(len
- (uint32_t)clen
);
1707 ENG
->hbuf_out
+= clen
;
1708 ENG
->hlen_out
-= clen
;
1718 x
= (unsigned char)T0_POP();
1719 if (ENG
->hlen_out
> 0) {
1720 if (ENG
->record_type_out
== BR_SSL_HANDSHAKE
) {
1721 br_multihash_update(&ENG
->mhash
, &x
, 1);
1723 *ENG
->hbuf_out
++ = x
;
1735 const br_x509_class
*xc
;
1738 xc
= *(ENG
->x509ctx
);
1740 xc
->append(ENG
->x509ctx
, ENG
->pad
, len
);
1747 const br_x509_class
*xc
;
1749 xc
= *(ENG
->x509ctx
);
1750 xc
->end_cert(ENG
->x509ctx
);
1755 /* x509-end-chain */
1757 const br_x509_class
*xc
;
1759 xc
= *(ENG
->x509ctx
);
1760 T0_PUSH(xc
->end_chain(ENG
->x509ctx
));
1765 /* x509-start-cert */
1767 const br_x509_class
*xc
;
1769 xc
= *(ENG
->x509ctx
);
1770 xc
->start_cert(ENG
->x509ctx
, T0_POP());
1775 /* x509-start-chain */
1777 const br_x509_class
*xc
;
1781 xc
= *(ENG
->x509ctx
);
1782 xc
->start_chain(ENG
->x509ctx
, bc
? ENG
->server_name
: NULL
);
1789 T0_ENTER(ip
, rp
, t0x
);
1793 ((t0_context
*)t0ctx
)->dp
= dp
;
1794 ((t0_context
*)t0ctx
)->rp
= rp
;
1795 ((t0_context
*)t0ctx
)->ip
= ip
;