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
);
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.
203 * hash hash function ID (2 to 6), or 0 for MD5+SHA-1 (with RSA only)
204 * use_rsa non-zero for RSA signature, zero for ECDSA
205 * sig_len signature length (in bytes); signature value is in the pad
206 * Returned value is 0 on success, or an error code.
209 verify_SKE_sig(br_ssl_client_context
*ctx
,
210 int hash
, int use_rsa
, size_t sig_len
)
212 const br_x509_class
**xc
;
213 const br_x509_pkey
*pk
;
214 br_multihash_context mhc
;
215 unsigned char hv
[64], head
[4];
218 xc
= ctx
->eng
.x509ctx
;
219 pk
= (*xc
)->get_pkey(xc
);
220 br_multihash_zero(&mhc
);
221 br_multihash_copyimpl(&mhc
, &ctx
->eng
.mhash
);
222 br_multihash_init(&mhc
);
223 br_multihash_update(&mhc
,
224 ctx
->eng
.client_random
, sizeof ctx
->eng
.client_random
);
225 br_multihash_update(&mhc
,
226 ctx
->eng
.server_random
, sizeof ctx
->eng
.server_random
);
229 head
[2] = ctx
->eng
.ecdhe_curve
;
230 head
[3] = ctx
->eng
.ecdhe_point_len
;
231 br_multihash_update(&mhc
, head
, sizeof head
);
232 br_multihash_update(&mhc
,
233 ctx
->eng
.ecdhe_point
, ctx
->eng
.ecdhe_point_len
);
235 hv_len
= br_multihash_out(&mhc
, hash
, hv
);
237 return BR_ERR_INVALID_ALGORITHM
;
240 if (!br_multihash_out(&mhc
, br_md5_ID
, hv
)
241 || !br_multihash_out(&mhc
, br_sha1_ID
, hv
+ 16))
243 return BR_ERR_INVALID_ALGORITHM
;
248 unsigned char tmp
[64];
249 const unsigned char *hash_oid
;
252 hash_oid
= HASH_OID
[hash
- 2];
256 if (!ctx
->irsavrfy(ctx
->eng
.pad
, sig_len
,
257 hash_oid
, hv_len
, &pk
->key
.rsa
, tmp
)
258 || memcmp(tmp
, hv
, hv_len
) != 0)
260 return BR_ERR_BAD_SIGNATURE
;
263 if (!ctx
->iecdsa(ctx
->eng
.iec
, hv
, hv_len
, &pk
->key
.ec
,
264 ctx
->eng
.pad
, sig_len
))
266 return BR_ERR_BAD_SIGNATURE
;
273 * Perform client-size ECDH (or ECDHE). The point that should be sent to
274 * the server is written in the pad; returned value is either the point
275 * length (in bytes), or -x on error, with 'x' being an error code.
277 * The point _from_ the server is taken from ecdhe_point[] if 'ecdhe'
278 * is non-zero, or from the X.509 engine context if 'ecdhe' is zero
282 make_pms_ecdh(br_ssl_client_context
*ctx
, unsigned ecdhe
, int prf_id
)
285 unsigned char key
[66], point
[133];
286 const unsigned char *generator
, *order
, *point_src
;
287 size_t glen
, olen
, point_len
;
291 curve
= ctx
->eng
.ecdhe_curve
;
292 point_src
= ctx
->eng
.ecdhe_point
;
293 point_len
= ctx
->eng
.ecdhe_point_len
;
295 const br_x509_class
**xc
;
296 const br_x509_pkey
*pk
;
298 xc
= ctx
->eng
.x509ctx
;
299 pk
= (*xc
)->get_pkey(xc
);
300 curve
= pk
->key
.ec
.curve
;
301 point_src
= pk
->key
.ec
.q
;
302 point_len
= pk
->key
.ec
.qlen
;
304 if ((ctx
->eng
.iec
->supported_curves
& ((uint32_t)1 << curve
)) == 0) {
305 return -BR_ERR_INVALID_ALGORITHM
;
309 * We need to generate our key, as a non-zero random value which
310 * is lower than the curve order, in a "large enough" range. We
311 * force top bit to 0 and bottom bit to 1, which guarantees that
312 * the value is in the proper range.
314 order
= ctx
->eng
.iec
->order(curve
, &olen
);
316 while (mask
>= order
[0]) {
319 br_hmac_drbg_generate(&ctx
->eng
.rng
, key
, olen
);
321 key
[olen
- 1] |= 0x01;
324 * Compute the common ECDH point, whose X coordinate is the
327 generator
= ctx
->eng
.iec
->generator(curve
, &glen
);
328 if (glen
!= point_len
) {
329 return -BR_ERR_INVALID_ALGORITHM
;
332 memcpy(point
, point_src
, glen
);
333 if (!ctx
->eng
.iec
->mul(point
, glen
, key
, olen
, curve
)) {
334 return -BR_ERR_INVALID_ALGORITHM
;
338 * The pre-master secret is the X coordinate.
340 br_ssl_engine_compute_master(&ctx
->eng
, prf_id
, point
+ 1, glen
>> 1);
342 memcpy(point
, generator
, glen
);
343 if (!ctx
->eng
.iec
->mul(point
, glen
, key
, olen
, curve
)) {
344 return -BR_ERR_INVALID_ALGORITHM
;
346 memcpy(ctx
->eng
.pad
, point
, glen
);
352 static const uint8_t t0_datablock
[] = {
353 0x00, 0x00, 0x0A, 0x00, 0x24, 0x00, 0x2F, 0x01, 0x24, 0x00, 0x35, 0x02,
354 0x24, 0x00, 0x3C, 0x01, 0x44, 0x00, 0x3D, 0x02, 0x44, 0x00, 0x9C, 0x03,
355 0x04, 0x00, 0x9D, 0x04, 0x05, 0xC0, 0x03, 0x40, 0x24, 0xC0, 0x04, 0x41,
356 0x24, 0xC0, 0x05, 0x42, 0x24, 0xC0, 0x08, 0x20, 0x24, 0xC0, 0x09, 0x21,
357 0x24, 0xC0, 0x0A, 0x22, 0x24, 0xC0, 0x0D, 0x30, 0x24, 0xC0, 0x0E, 0x31,
358 0x24, 0xC0, 0x0F, 0x32, 0x24, 0xC0, 0x12, 0x10, 0x24, 0xC0, 0x13, 0x11,
359 0x24, 0xC0, 0x14, 0x12, 0x24, 0xC0, 0x23, 0x21, 0x44, 0xC0, 0x24, 0x22,
360 0x55, 0xC0, 0x25, 0x41, 0x44, 0xC0, 0x26, 0x42, 0x55, 0xC0, 0x27, 0x11,
361 0x44, 0xC0, 0x28, 0x12, 0x55, 0xC0, 0x29, 0x31, 0x44, 0xC0, 0x2A, 0x32,
362 0x55, 0xC0, 0x2B, 0x23, 0x04, 0xC0, 0x2C, 0x24, 0x05, 0xC0, 0x2D, 0x43,
363 0x04, 0xC0, 0x2E, 0x44, 0x05, 0xC0, 0x2F, 0x13, 0x04, 0xC0, 0x30, 0x14,
364 0x05, 0xC0, 0x31, 0x33, 0x04, 0xC0, 0x32, 0x34, 0x05, 0xCC, 0xA8, 0x15,
365 0x04, 0xCC, 0xA9, 0x25, 0x04, 0x00, 0x00
368 static const uint8_t t0_codeblock
[] = {
369 0x00, 0x01, 0x00, 0x0A, 0x00, 0x00, 0x01, 0x00, 0x0C, 0x00, 0x00, 0x01,
370 0x00, 0x0D, 0x00, 0x00, 0x01, 0x00, 0x0E, 0x00, 0x00, 0x01, 0x01, 0x08,
371 0x00, 0x00, 0x01, 0x01, 0x09, 0x00, 0x00, 0x01, 0x02, 0x08, 0x00, 0x00,
372 0x01, 0x02, 0x09, 0x00, 0x00, 0x1A, 0x1A, 0x00, 0x00, 0x01,
373 T0_INT1(BR_ERR_BAD_CCS
), 0x00, 0x00, 0x01,
374 T0_INT1(BR_ERR_BAD_CIPHER_SUITE
), 0x00, 0x00, 0x01,
375 T0_INT1(BR_ERR_BAD_COMPRESSION
), 0x00, 0x00, 0x01,
376 T0_INT1(BR_ERR_BAD_FINISHED
), 0x00, 0x00, 0x01,
377 T0_INT1(BR_ERR_BAD_FRAGLEN
), 0x00, 0x00, 0x01,
378 T0_INT1(BR_ERR_BAD_HANDSHAKE
), 0x00, 0x00, 0x01,
379 T0_INT1(BR_ERR_BAD_HELLO_DONE
), 0x00, 0x00, 0x01,
380 T0_INT1(BR_ERR_BAD_PARAM
), 0x00, 0x00, 0x01,
381 T0_INT1(BR_ERR_BAD_SECRENEG
), 0x00, 0x00, 0x01,
382 T0_INT1(BR_ERR_BAD_SNI
), 0x00, 0x00, 0x01, T0_INT1(BR_ERR_BAD_VERSION
),
383 0x00, 0x00, 0x01, T0_INT1(BR_ERR_EXTRA_EXTENSION
), 0x00, 0x00, 0x01,
384 T0_INT1(BR_ERR_INVALID_ALGORITHM
), 0x00, 0x00, 0x01,
385 T0_INT1(BR_ERR_LIMIT_EXCEEDED
), 0x00, 0x00, 0x01, T0_INT1(BR_ERR_OK
),
386 0x00, 0x00, 0x01, T0_INT1(BR_ERR_OVERSIZED_ID
), 0x00, 0x00, 0x01,
387 T0_INT1(BR_ERR_RESUME_MISMATCH
), 0x00, 0x00, 0x01,
388 T0_INT1(BR_ERR_UNEXPECTED
), 0x00, 0x00, 0x01,
389 T0_INT1(BR_ERR_UNSUPPORTED_VERSION
), 0x00, 0x00, 0x01,
390 T0_INT2(offsetof(br_ssl_engine_context
, action
)), 0x00, 0x00, 0x01,
391 T0_INT2(offsetof(br_ssl_engine_context
, alert
)), 0x00, 0x00, 0x01,
392 T0_INT2(offsetof(br_ssl_engine_context
, application_data
)), 0x00, 0x00,
394 T0_INT2(offsetof(br_ssl_engine_context
, session
) + offsetof(br_ssl_session_parameters
, cipher_suite
)),
396 T0_INT2(offsetof(br_ssl_engine_context
, client_random
)), 0x00, 0x00,
397 0x01, T0_INT2(offsetof(br_ssl_engine_context
, close_received
)), 0x00,
398 0x00, 0x01, T0_INT2(offsetof(br_ssl_engine_context
, ecdhe_curve
)),
400 T0_INT2(offsetof(br_ssl_engine_context
, ecdhe_point
)), 0x00, 0x00,
401 0x01, T0_INT2(offsetof(br_ssl_engine_context
, ecdhe_point_len
)), 0x00,
402 0x00, 0x01, T0_INT2(offsetof(br_ssl_engine_context
, log_max_frag_len
)),
404 T0_INT2(offsetof(br_ssl_client_context
, min_clienthello_len
)), 0x00,
405 0x00, 0x01, T0_INT2(offsetof(br_ssl_engine_context
, pad
)), 0x00, 0x00,
406 0x01, T0_INT2(offsetof(br_ssl_engine_context
, record_type_in
)), 0x00,
407 0x00, 0x01, T0_INT2(offsetof(br_ssl_engine_context
, record_type_out
)),
408 0x00, 0x00, 0x01, T0_INT2(offsetof(br_ssl_engine_context
, reneg
)),
410 T0_INT2(offsetof(br_ssl_engine_context
, saved_finished
)), 0x00, 0x00,
411 0x01, T0_INT2(offsetof(br_ssl_engine_context
, server_name
)), 0x00,
412 0x00, 0x01, T0_INT2(offsetof(br_ssl_engine_context
, server_random
)),
414 T0_INT2(offsetof(br_ssl_engine_context
, session
) + offsetof(br_ssl_session_parameters
, session_id
)),
416 T0_INT2(offsetof(br_ssl_engine_context
, session
) + offsetof(br_ssl_session_parameters
, session_id_len
)),
418 T0_INT2(offsetof(br_ssl_engine_context
, shutdown_recv
)), 0x00, 0x00,
419 0x01, T0_INT2(offsetof(br_ssl_engine_context
, suites_buf
)), 0x00, 0x00,
420 0x01, T0_INT2(offsetof(br_ssl_engine_context
, suites_num
)), 0x00, 0x00,
422 T0_INT2(offsetof(br_ssl_engine_context
, session
) + offsetof(br_ssl_session_parameters
, version
)),
423 0x00, 0x00, 0x01, T0_INT2(offsetof(br_ssl_engine_context
, version_in
)),
425 T0_INT2(offsetof(br_ssl_engine_context
, version_max
)), 0x00, 0x00,
426 0x01, T0_INT2(offsetof(br_ssl_engine_context
, version_min
)), 0x00,
427 0x00, 0x01, T0_INT2(offsetof(br_ssl_engine_context
, version_out
)),
428 0x00, 0x00, 0x09, 0x1B, 0x40, 0x06, 0x02, 0x50, 0x1C, 0x00, 0x00, 0x06,
429 0x08, 0x1E, 0x0D, 0x05, 0x02, 0x59, 0x1C, 0x04, 0x01, 0x2B, 0x00, 0x00,
430 0x01, 0x01, 0x00, 0x01, 0x03, 0x00, 0x7A, 0x1B, 0x46, 0x32, 0x7E, 0x1B,
431 0x05, 0x04, 0x48, 0x01, 0x00, 0x00, 0x02, 0x00, 0x0D, 0x06, 0x02, 0x7E,
432 0x00, 0x46, 0x04, 0x6B, 0x00, 0x06, 0x02, 0x50, 0x1C, 0x00, 0x00, 0x1B,
433 0x6B, 0x32, 0x05, 0x03, 0x01, 0x0C, 0x08, 0x32, 0x5F, 0x1E, 0x81, 0x0B,
434 0x15, 0x67, 0x01, 0x0C, 0x22, 0x00, 0x00, 0x1B, 0x16, 0x01, 0x08, 0x0B,
435 0x32, 0x44, 0x16, 0x08, 0x00, 0x01, 0x03, 0x00, 0x01, 0x00, 0x5E, 0x2C,
436 0x1D, 0x13, 0x26, 0x06, 0x08, 0x02, 0x00, 0x81, 0x2A, 0x03, 0x00, 0x04,
437 0x74, 0x01, 0x00, 0x81, 0x22, 0x02, 0x00, 0x1B, 0x13, 0x11, 0x06, 0x02,
438 0x57, 0x1C, 0x81, 0x2A, 0x04, 0x75, 0x01, 0x01, 0x00, 0x5E, 0x2C, 0x01,
439 0x16, 0x69, 0x2C, 0x25, 0x81, 0x2E, 0x1D, 0x81, 0x12, 0x06, 0x0B, 0x01,
440 0x7F, 0x81, 0x0E, 0x01, 0x7F, 0x81, 0x2D, 0x04, 0x80, 0x42, 0x81, 0x0F,
441 0x5F, 0x1E, 0x81, 0x02, 0x01, T0_INT1(BR_KEYTYPE_SIGN
), 0x11, 0x06,
442 0x02, 0x81, 0x13, 0x81, 0x16, 0x1B, 0x01, 0x0D, 0x0D, 0x06, 0x09, 0x1A,
443 0x81, 0x15, 0x81, 0x16, 0x01, 0x7F, 0x04, 0x02, 0x01, 0x00, 0x03, 0x00,
444 0x01, 0x0E, 0x0D, 0x05, 0x02, 0x5A, 0x1C, 0x06, 0x02, 0x4F, 0x1C, 0x24,
445 0x06, 0x02, 0x5A, 0x1C, 0x02, 0x00, 0x06, 0x02, 0x81, 0x34, 0x81, 0x2F,
446 0x01, 0x7F, 0x81, 0x2D, 0x01, 0x7F, 0x81, 0x0E, 0x01, 0x01, 0x5E, 0x2C,
447 0x01, 0x17, 0x69, 0x2C, 0x00, 0x00, 0x28, 0x28, 0x00, 0x00, 0x7B, 0x01,
448 0x0C, 0x10, 0x01, 0x00, 0x28, 0x0D, 0x06, 0x05, 0x1A, 0x01,
449 T0_INT1(BR_KEYTYPE_RSA
| BR_KEYTYPE_KEYX
), 0x04, 0x30, 0x01, 0x01,
450 0x28, 0x0D, 0x06, 0x05, 0x1A, 0x01,
451 T0_INT1(BR_KEYTYPE_RSA
| BR_KEYTYPE_SIGN
), 0x04, 0x25, 0x01, 0x02,
452 0x28, 0x0D, 0x06, 0x05, 0x1A, 0x01,
453 T0_INT1(BR_KEYTYPE_EC
| BR_KEYTYPE_SIGN
), 0x04, 0x1A, 0x01, 0x03,
454 0x28, 0x0D, 0x06, 0x05, 0x1A, 0x01,
455 T0_INT1(BR_KEYTYPE_EC
| BR_KEYTYPE_KEYX
), 0x04, 0x0F, 0x01, 0x04,
456 0x28, 0x0D, 0x06, 0x05, 0x1A, 0x01,
457 T0_INT1(BR_KEYTYPE_EC
| BR_KEYTYPE_KEYX
), 0x04, 0x04, 0x01, 0x00,
458 0x32, 0x1A, 0x00, 0x00, 0x65, 0x1F, 0x01, 0x0E, 0x0D, 0x06, 0x04, 0x01,
459 0x00, 0x04, 0x02, 0x01, 0x05, 0x00, 0x00, 0x2E, 0x06, 0x04, 0x01, 0x06,
460 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x6A, 0x1F, 0x1B, 0x06, 0x08, 0x01,
461 0x01, 0x09, 0x01, 0x11, 0x07, 0x04, 0x03, 0x1A, 0x01, 0x05, 0x00, 0x01,
462 0x2F, 0x03, 0x00, 0x1A, 0x01, 0x00, 0x31, 0x06, 0x03, 0x02, 0x00, 0x08,
463 0x30, 0x06, 0x03, 0x02, 0x00, 0x08, 0x1B, 0x06, 0x06, 0x01, 0x01, 0x0B,
464 0x01, 0x06, 0x08, 0x00, 0x00, 0x6C, 0x2D, 0x1B, 0x06, 0x03, 0x01, 0x09,
465 0x08, 0x00, 0x01, 0x2E, 0x1B, 0x06, 0x1E, 0x01, 0x00, 0x03, 0x00, 0x1B,
466 0x06, 0x0E, 0x1B, 0x01, 0x01, 0x11, 0x02, 0x00, 0x08, 0x03, 0x00, 0x01,
467 0x01, 0x10, 0x04, 0x6F, 0x1A, 0x02, 0x00, 0x01, 0x01, 0x0B, 0x01, 0x06,
468 0x08, 0x00, 0x00, 0x81, 0x00, 0x81, 0x29, 0x1B, 0x01, 0x07, 0x11, 0x01,
469 0x00, 0x28, 0x0D, 0x06, 0x0A, 0x1A, 0x01, 0x10, 0x11, 0x06, 0x02, 0x81,
470 0x00, 0x04, 0x2D, 0x01, 0x01, 0x28, 0x0D, 0x06, 0x24, 0x1A, 0x1A, 0x01,
471 0x00, 0x5E, 0x2C, 0x81, 0x11, 0x6A, 0x1F, 0x01, 0x01, 0x0D, 0x06, 0x11,
472 0x1D, 0x13, 0x26, 0x06, 0x05, 0x81, 0x29, 0x1A, 0x04, 0x77, 0x01, 0x80,
473 0x64, 0x81, 0x22, 0x04, 0x02, 0x81, 0x00, 0x04, 0x03, 0x5A, 0x1C, 0x1A,
474 0x04, 0xFF, 0x3A, 0x01, 0x1B, 0x03, 0x00, 0x09, 0x1B, 0x40, 0x06, 0x02,
475 0x50, 0x1C, 0x02, 0x00, 0x00, 0x00, 0x7B, 0x01, 0x0F, 0x11, 0x00, 0x00,
476 0x5D, 0x1F, 0x01, 0x00, 0x28, 0x0D, 0x06, 0x10, 0x1A, 0x1B, 0x01, 0x01,
477 0x0C, 0x06, 0x03, 0x1A, 0x01, 0x02, 0x5D, 0x2C, 0x01, 0x00, 0x04, 0x15,
478 0x01, 0x01, 0x28, 0x0D, 0x06, 0x09, 0x1A, 0x01, 0x00, 0x5D, 0x2C, 0x42,
479 0x00, 0x04, 0x06, 0x01, 0x82, 0x00, 0x08, 0x1C, 0x1A, 0x00, 0x00, 0x01,
480 0x00, 0x20, 0x06, 0x06, 0x2A, 0x81, 0x0C, 0x27, 0x04, 0x77, 0x1B, 0x06,
481 0x04, 0x01, 0x01, 0x70, 0x2C, 0x00, 0x00, 0x20, 0x06, 0x0B, 0x68, 0x1F,
482 0x01, 0x14, 0x0C, 0x06, 0x02, 0x5A, 0x1C, 0x04, 0x12, 0x81, 0x29, 0x01,
483 0x07, 0x11, 0x1B, 0x01, 0x02, 0x0C, 0x06, 0x06, 0x06, 0x02, 0x5A, 0x1C,
484 0x04, 0x6F, 0x1A, 0x81, 0x1F, 0x01, 0x01, 0x0C, 0x24, 0x27, 0x06, 0x02,
485 0x49, 0x1C, 0x1B, 0x01, 0x01, 0x81, 0x25, 0x26, 0x81, 0x10, 0x00, 0x01,
486 0x81, 0x16, 0x01, 0x0B, 0x0D, 0x05, 0x02, 0x5A, 0x1C, 0x5F, 0x1E, 0x81,
487 0x02, 0x3F, 0x81, 0x1D, 0x81, 0x0A, 0x1B, 0x06, 0x26, 0x81, 0x1D, 0x81,
488 0x0A, 0x1B, 0x3E, 0x1B, 0x06, 0x19, 0x1B, 0x01, 0x82, 0x00, 0x0E, 0x06,
489 0x05, 0x01, 0x82, 0x00, 0x04, 0x01, 0x1B, 0x03, 0x00, 0x67, 0x02, 0x00,
490 0x81, 0x14, 0x02, 0x00, 0x3B, 0x04, 0x64, 0x7C, 0x3C, 0x04, 0x57, 0x7C,
491 0x7C, 0x3D, 0x1B, 0x06, 0x01, 0x1C, 0x1A, 0x00, 0x00, 0x7D, 0x81, 0x16,
492 0x01, 0x14, 0x0C, 0x06, 0x02, 0x5A, 0x1C, 0x67, 0x01, 0x0C, 0x08, 0x01,
493 0x0C, 0x81, 0x14, 0x7C, 0x67, 0x1B, 0x01, 0x0C, 0x08, 0x01, 0x0C, 0x21,
494 0x05, 0x02, 0x4C, 0x1C, 0x00, 0x00, 0x81, 0x17, 0x06, 0x02, 0x5A, 0x1C,
495 0x06, 0x02, 0x4E, 0x1C, 0x00, 0x09, 0x81, 0x16, 0x01, 0x02, 0x0D, 0x05,
496 0x02, 0x5A, 0x1C, 0x81, 0x1C, 0x03, 0x00, 0x02, 0x00, 0x76, 0x1E, 0x0A,
497 0x02, 0x00, 0x75, 0x1E, 0x0E, 0x27, 0x06, 0x02, 0x5B, 0x1C, 0x02, 0x00,
498 0x74, 0x1E, 0x0C, 0x06, 0x02, 0x53, 0x1C, 0x02, 0x00, 0x77, 0x2B, 0x6D,
499 0x01, 0x20, 0x81, 0x14, 0x01, 0x00, 0x03, 0x01, 0x81, 0x1E, 0x03, 0x02,
500 0x02, 0x02, 0x01, 0x20, 0x0E, 0x06, 0x02, 0x58, 0x1C, 0x67, 0x02, 0x02,
501 0x81, 0x14, 0x02, 0x02, 0x6F, 0x1F, 0x0D, 0x02, 0x02, 0x01, 0x00, 0x0E,
502 0x11, 0x06, 0x0B, 0x6E, 0x67, 0x02, 0x02, 0x21, 0x06, 0x04, 0x01, 0x7F,
503 0x03, 0x01, 0x6E, 0x67, 0x02, 0x02, 0x22, 0x02, 0x02, 0x6F, 0x2C, 0x02,
504 0x00, 0x73, 0x02, 0x01, 0x79, 0x81, 0x1C, 0x1B, 0x81, 0x20, 0x40, 0x06,
505 0x02, 0x4A, 0x1C, 0x5F, 0x02, 0x01, 0x79, 0x81, 0x1E, 0x06, 0x02, 0x4B,
506 0x1C, 0x1B, 0x06, 0x81, 0x3D, 0x81, 0x1C, 0x81, 0x0A, 0x81, 0x07, 0x03,
507 0x03, 0x81, 0x05, 0x03, 0x04, 0x81, 0x03, 0x03, 0x05, 0x81, 0x06, 0x03,
508 0x06, 0x81, 0x08, 0x03, 0x07, 0x81, 0x04, 0x03, 0x08, 0x1B, 0x06, 0x81,
509 0x0B, 0x81, 0x1C, 0x01, 0x00, 0x28, 0x0D, 0x06, 0x10, 0x1A, 0x02, 0x03,
510 0x05, 0x02, 0x54, 0x1C, 0x01, 0x00, 0x03, 0x03, 0x81, 0x1B, 0x04, 0x80,
511 0x70, 0x01, 0x01, 0x28, 0x0D, 0x06, 0x10, 0x1A, 0x02, 0x05, 0x05, 0x02,
512 0x54, 0x1C, 0x01, 0x00, 0x03, 0x05, 0x81, 0x19, 0x04, 0x80, 0x5A, 0x01,
513 0x83, 0xFE, 0x01, 0x28, 0x0D, 0x06, 0x10, 0x1A, 0x02, 0x04, 0x05, 0x02,
514 0x54, 0x1C, 0x01, 0x00, 0x03, 0x04, 0x81, 0x1A, 0x04, 0x80, 0x42, 0x01,
515 0x0D, 0x28, 0x0D, 0x06, 0x0F, 0x1A, 0x02, 0x06, 0x05, 0x02, 0x54, 0x1C,
516 0x01, 0x00, 0x03, 0x06, 0x81, 0x18, 0x04, 0x2D, 0x01, 0x0A, 0x28, 0x0D,
517 0x06, 0x0F, 0x1A, 0x02, 0x07, 0x05, 0x02, 0x54, 0x1C, 0x01, 0x00, 0x03,
518 0x07, 0x81, 0x18, 0x04, 0x18, 0x01, 0x0B, 0x28, 0x0D, 0x06, 0x0F, 0x1A,
519 0x02, 0x08, 0x05, 0x02, 0x54, 0x1C, 0x01, 0x00, 0x03, 0x08, 0x81, 0x18,
520 0x04, 0x03, 0x54, 0x1C, 0x1A, 0x04, 0xFE, 0x71, 0x02, 0x04, 0x06, 0x0D,
521 0x02, 0x04, 0x01, 0x05, 0x0E, 0x06, 0x02, 0x51, 0x1C, 0x01, 0x01, 0x6A,
522 0x2C, 0x7C, 0x7C, 0x02, 0x01, 0x00, 0x04, 0x81, 0x16, 0x01, 0x0C, 0x0D,
523 0x05, 0x02, 0x5A, 0x1C, 0x81, 0x1E, 0x01, 0x03, 0x0D, 0x05, 0x02, 0x55,
524 0x1C, 0x81, 0x1C, 0x1B, 0x62, 0x2C, 0x1B, 0x01, 0x20, 0x0F, 0x06, 0x02,
525 0x55, 0x1C, 0x2E, 0x32, 0x10, 0x01, 0x01, 0x11, 0x05, 0x02, 0x55, 0x1C,
526 0x81, 0x1E, 0x1B, 0x01, 0x81, 0x05, 0x0E, 0x06, 0x02, 0x55, 0x1C, 0x1B,
527 0x64, 0x2C, 0x63, 0x32, 0x81, 0x14, 0x73, 0x1E, 0x01, 0x86, 0x03, 0x0F,
528 0x03, 0x00, 0x5F, 0x1E, 0x81, 0x27, 0x03, 0x01, 0x01, 0x02, 0x03, 0x02,
529 0x02, 0x00, 0x06, 0x23, 0x81, 0x1E, 0x1B, 0x1B, 0x01, 0x02, 0x0A, 0x32,
530 0x01, 0x06, 0x0E, 0x27, 0x06, 0x02, 0x55, 0x1C, 0x03, 0x02, 0x81, 0x1E,
531 0x02, 0x01, 0x01, 0x01, 0x0B, 0x01, 0x03, 0x08, 0x0D, 0x05, 0x02, 0x55,
532 0x1C, 0x04, 0x08, 0x02, 0x01, 0x06, 0x04, 0x01, 0x00, 0x03, 0x02, 0x81,
533 0x1C, 0x1B, 0x03, 0x03, 0x1B, 0x01, 0x84, 0x00, 0x0E, 0x06, 0x02, 0x56,
534 0x1C, 0x67, 0x32, 0x81, 0x14, 0x02, 0x02, 0x02, 0x01, 0x02, 0x03, 0x38,
535 0x1B, 0x06, 0x01, 0x1C, 0x1A, 0x7C, 0x00, 0x02, 0x03, 0x00, 0x03, 0x01,
536 0x02, 0x00, 0x78, 0x02, 0x01, 0x02, 0x00, 0x29, 0x1B, 0x01, 0x00, 0x0D,
537 0x06, 0x02, 0x48, 0x00, 0x81, 0x2B, 0x04, 0x73, 0x00, 0x1B, 0x06, 0x05,
538 0x81, 0x1E, 0x1A, 0x04, 0x78, 0x1A, 0x00, 0x00, 0x81, 0x17, 0x1B, 0x42,
539 0x06, 0x07, 0x1A, 0x06, 0x02, 0x4E, 0x1C, 0x04, 0x73, 0x00, 0x00, 0x81,
540 0x1F, 0x01, 0x03, 0x81, 0x1D, 0x32, 0x1A, 0x32, 0x00, 0x00, 0x81, 0x1C,
541 0x81, 0x23, 0x00, 0x00, 0x81, 0x1C, 0x01, 0x01, 0x0D, 0x05, 0x02, 0x4D,
542 0x1C, 0x81, 0x1E, 0x01, 0x08, 0x08, 0x65, 0x1F, 0x0D, 0x05, 0x02, 0x4D,
543 0x1C, 0x00, 0x00, 0x81, 0x1C, 0x6A, 0x1F, 0x05, 0x16, 0x01, 0x01, 0x0D,
544 0x05, 0x02, 0x51, 0x1C, 0x81, 0x1E, 0x01, 0x00, 0x0D, 0x05, 0x02, 0x51,
545 0x1C, 0x01, 0x02, 0x6A, 0x2C, 0x04, 0x1E, 0x01, 0x19, 0x0D, 0x05, 0x02,
546 0x51, 0x1C, 0x81, 0x1E, 0x01, 0x18, 0x0D, 0x05, 0x02, 0x51, 0x1C, 0x67,
547 0x01, 0x18, 0x81, 0x14, 0x6B, 0x67, 0x01, 0x18, 0x21, 0x05, 0x02, 0x51,
548 0x1C, 0x00, 0x00, 0x81, 0x1C, 0x06, 0x02, 0x52, 0x1C, 0x00, 0x00, 0x01,
549 0x02, 0x78, 0x81, 0x1F, 0x01, 0x08, 0x0B, 0x81, 0x1F, 0x08, 0x00, 0x00,
550 0x01, 0x03, 0x78, 0x81, 0x1F, 0x01, 0x08, 0x0B, 0x81, 0x1F, 0x08, 0x01,
551 0x08, 0x0B, 0x81, 0x1F, 0x08, 0x00, 0x00, 0x01, 0x01, 0x78, 0x81, 0x1F,
552 0x00, 0x00, 0x2A, 0x1B, 0x40, 0x05, 0x01, 0x00, 0x1A, 0x81, 0x2B, 0x04,
553 0x75, 0x02, 0x03, 0x00, 0x72, 0x1F, 0x03, 0x01, 0x01, 0x00, 0x1B, 0x02,
554 0x01, 0x0A, 0x06, 0x10, 0x1B, 0x01, 0x01, 0x0B, 0x71, 0x08, 0x1E, 0x02,
555 0x00, 0x0D, 0x06, 0x01, 0x00, 0x44, 0x04, 0x6A, 0x1A, 0x01, 0x7F, 0x00,
556 0x00, 0x01, 0x15, 0x69, 0x2C, 0x32, 0x3A, 0x1A, 0x3A, 0x1A, 0x1D, 0x00,
557 0x00, 0x01, 0x01, 0x32, 0x81, 0x21, 0x00, 0x00, 0x32, 0x28, 0x78, 0x32,
558 0x1B, 0x06, 0x06, 0x81, 0x1F, 0x1A, 0x45, 0x04, 0x77, 0x1A, 0x00, 0x00,
559 0x7B, 0x41, 0x00, 0x02, 0x03, 0x00, 0x5F, 0x1E, 0x7B, 0x03, 0x01, 0x02,
560 0x01, 0x01, 0x0F, 0x11, 0x02, 0x01, 0x01, 0x04, 0x10, 0x01, 0x0F, 0x11,
561 0x02, 0x01, 0x01, 0x08, 0x10, 0x01, 0x0F, 0x11, 0x01, 0x00, 0x28, 0x0D,
562 0x06, 0x10, 0x1A, 0x01, 0x00, 0x01, 0x18, 0x02, 0x00, 0x06, 0x03, 0x35,
563 0x04, 0x01, 0x36, 0x04, 0x80, 0x56, 0x01, 0x01, 0x28, 0x0D, 0x06, 0x10,
564 0x1A, 0x01, 0x01, 0x01, 0x10, 0x02, 0x00, 0x06, 0x03, 0x35, 0x04, 0x01,
565 0x36, 0x04, 0x80, 0x40, 0x01, 0x02, 0x28, 0x0D, 0x06, 0x0F, 0x1A, 0x01,
566 0x01, 0x01, 0x20, 0x02, 0x00, 0x06, 0x03, 0x35, 0x04, 0x01, 0x36, 0x04,
567 0x2B, 0x01, 0x03, 0x28, 0x0D, 0x06, 0x0E, 0x1A, 0x1A, 0x01, 0x10, 0x02,
568 0x00, 0x06, 0x03, 0x33, 0x04, 0x01, 0x34, 0x04, 0x17, 0x01, 0x04, 0x28,
569 0x0D, 0x06, 0x0E, 0x1A, 0x1A, 0x01, 0x20, 0x02, 0x00, 0x06, 0x03, 0x33,
570 0x04, 0x01, 0x34, 0x04, 0x03, 0x50, 0x1C, 0x1A, 0x00, 0x00, 0x7B, 0x01,
571 0x0C, 0x10, 0x1B, 0x43, 0x32, 0x01, 0x03, 0x0A, 0x11, 0x00, 0x00, 0x7B,
572 0x01, 0x0C, 0x10, 0x01, 0x01, 0x0D, 0x00, 0x00, 0x7B, 0x01, 0x0C, 0x10,
573 0x42, 0x00, 0x00, 0x14, 0x01, 0x00, 0x5C, 0x1F, 0x1B, 0x06, 0x1F, 0x01,
574 0x01, 0x28, 0x0D, 0x06, 0x06, 0x1A, 0x01, 0x00, 0x7F, 0x04, 0x11, 0x01,
575 0x02, 0x28, 0x0D, 0x06, 0x0A, 0x1A, 0x5E, 0x1F, 0x06, 0x03, 0x01, 0x10,
576 0x27, 0x04, 0x01, 0x1A, 0x04, 0x01, 0x1A, 0x61, 0x1F, 0x05, 0x34, 0x20,
577 0x06, 0x31, 0x68, 0x1F, 0x01, 0x14, 0x28, 0x0D, 0x06, 0x06, 0x1A, 0x01,
578 0x02, 0x27, 0x04, 0x23, 0x01, 0x15, 0x28, 0x0D, 0x06, 0x0A, 0x1A, 0x81,
579 0x0D, 0x06, 0x03, 0x01, 0x7F, 0x7F, 0x04, 0x13, 0x01, 0x16, 0x28, 0x0D,
580 0x06, 0x06, 0x1A, 0x01, 0x01, 0x27, 0x04, 0x07, 0x1A, 0x01, 0x04, 0x27,
581 0x01, 0x00, 0x1A, 0x13, 0x06, 0x03, 0x01, 0x08, 0x27, 0x00, 0x00, 0x14,
582 0x1B, 0x05, 0x10, 0x20, 0x06, 0x0D, 0x68, 0x1F, 0x01, 0x15, 0x0D, 0x06,
583 0x05, 0x1A, 0x81, 0x0D, 0x04, 0x01, 0x17, 0x00, 0x00, 0x81, 0x29, 0x01,
584 0x07, 0x11, 0x01, 0x01, 0x0E, 0x06, 0x02, 0x5A, 0x1C, 0x00, 0x01, 0x03,
585 0x00, 0x1D, 0x13, 0x06, 0x05, 0x02, 0x00, 0x69, 0x2C, 0x00, 0x81, 0x29,
586 0x1A, 0x04, 0x73, 0x00, 0x01, 0x14, 0x81, 0x2C, 0x01, 0x01, 0x81, 0x38,
587 0x1D, 0x1B, 0x01, 0x00, 0x81, 0x25, 0x01, 0x16, 0x81, 0x2C, 0x81, 0x30,
588 0x1D, 0x00, 0x02, 0x81, 0x05, 0x81, 0x07, 0x08, 0x81, 0x03, 0x08, 0x81,
589 0x06, 0x08, 0x81, 0x08, 0x08, 0x81, 0x04, 0x08, 0x03, 0x00, 0x01, 0x01,
590 0x81, 0x38, 0x01, 0x27, 0x6F, 0x1F, 0x08, 0x72, 0x1F, 0x01, 0x01, 0x0B,
591 0x08, 0x02, 0x00, 0x06, 0x04, 0x46, 0x02, 0x00, 0x08, 0x66, 0x1E, 0x28,
592 0x09, 0x1B, 0x43, 0x06, 0x24, 0x02, 0x00, 0x05, 0x04, 0x32, 0x46, 0x32,
593 0x47, 0x01, 0x04, 0x09, 0x1B, 0x40, 0x06, 0x03, 0x1A, 0x01, 0x00, 0x1B,
594 0x01, 0x04, 0x08, 0x02, 0x00, 0x08, 0x03, 0x00, 0x32, 0x01, 0x04, 0x08,
595 0x28, 0x08, 0x32, 0x04, 0x03, 0x1A, 0x01, 0x7F, 0x03, 0x01, 0x81, 0x37,
596 0x75, 0x1E, 0x81, 0x36, 0x60, 0x01, 0x04, 0x12, 0x60, 0x01, 0x04, 0x08,
597 0x01, 0x1C, 0x23, 0x60, 0x01, 0x20, 0x81, 0x31, 0x6E, 0x6F, 0x1F, 0x81,
598 0x33, 0x72, 0x1F, 0x1B, 0x01, 0x01, 0x0B, 0x81, 0x36, 0x71, 0x32, 0x1B,
599 0x06, 0x11, 0x45, 0x28, 0x1E, 0x1B, 0x81, 0x24, 0x05, 0x02, 0x4A, 0x1C,
600 0x81, 0x36, 0x32, 0x46, 0x32, 0x04, 0x6C, 0x48, 0x01, 0x01, 0x81, 0x38,
601 0x01, 0x00, 0x81, 0x38, 0x02, 0x00, 0x06, 0x81, 0x47, 0x02, 0x00, 0x81,
602 0x36, 0x81, 0x05, 0x06, 0x12, 0x01, 0x83, 0xFE, 0x01, 0x81, 0x36, 0x6B,
603 0x81, 0x05, 0x01, 0x04, 0x09, 0x1B, 0x81, 0x36, 0x45, 0x81, 0x33, 0x81,
604 0x07, 0x06, 0x1C, 0x01, 0x00, 0x81, 0x36, 0x6C, 0x81, 0x07, 0x01, 0x04,
605 0x09, 0x1B, 0x81, 0x36, 0x01, 0x02, 0x09, 0x1B, 0x81, 0x36, 0x01, 0x00,
606 0x81, 0x38, 0x01, 0x03, 0x09, 0x81, 0x32, 0x81, 0x03, 0x06, 0x0F, 0x01,
607 0x01, 0x81, 0x36, 0x01, 0x01, 0x81, 0x36, 0x65, 0x1F, 0x01, 0x08, 0x09,
608 0x81, 0x38, 0x81, 0x06, 0x06, 0x1F, 0x01, 0x0D, 0x81, 0x36, 0x81, 0x06,
609 0x01, 0x04, 0x09, 0x1B, 0x81, 0x36, 0x01, 0x02, 0x09, 0x81, 0x36, 0x30,
610 0x06, 0x04, 0x01, 0x03, 0x81, 0x35, 0x31, 0x06, 0x04, 0x01, 0x01, 0x81,
611 0x35, 0x81, 0x08, 0x1B, 0x06, 0x27, 0x01, 0x0A, 0x81, 0x36, 0x01, 0x04,
612 0x09, 0x1B, 0x81, 0x36, 0x47, 0x81, 0x36, 0x2E, 0x01, 0x00, 0x1B, 0x01,
613 0x20, 0x0A, 0x06, 0x0E, 0x81, 0x01, 0x10, 0x01, 0x01, 0x11, 0x06, 0x03,
614 0x1B, 0x81, 0x36, 0x44, 0x04, 0x6C, 0x48, 0x04, 0x01, 0x1A, 0x81, 0x04,
615 0x06, 0x0D, 0x01, 0x0B, 0x81, 0x36, 0x01, 0x02, 0x81, 0x36, 0x01, 0x82,
616 0x00, 0x81, 0x36, 0x02, 0x01, 0x40, 0x05, 0x14, 0x01, 0x15, 0x81, 0x36,
617 0x02, 0x01, 0x1B, 0x81, 0x36, 0x1B, 0x06, 0x07, 0x45, 0x01, 0x00, 0x81,
618 0x38, 0x04, 0x76, 0x1A, 0x00, 0x00, 0x01, 0x10, 0x81, 0x38, 0x5F, 0x1E,
619 0x1B, 0x81, 0x28, 0x06, 0x10, 0x81, 0x0B, 0x19, 0x1B, 0x46, 0x81, 0x37,
620 0x1B, 0x81, 0x36, 0x67, 0x32, 0x81, 0x31, 0x04, 0x12, 0x1B, 0x81, 0x26,
621 0x32, 0x81, 0x0B, 0x18, 0x1B, 0x44, 0x81, 0x37, 0x1B, 0x81, 0x38, 0x67,
622 0x32, 0x81, 0x31, 0x00, 0x00, 0x7D, 0x01, 0x14, 0x81, 0x38, 0x01, 0x0C,
623 0x81, 0x37, 0x67, 0x01, 0x0C, 0x81, 0x31, 0x00, 0x00, 0x39, 0x1B, 0x01,
624 0x00, 0x0D, 0x06, 0x02, 0x48, 0x00, 0x81, 0x29, 0x1A, 0x04, 0x72, 0x00,
625 0x1B, 0x81, 0x36, 0x81, 0x31, 0x00, 0x00, 0x1B, 0x81, 0x38, 0x81, 0x31,
626 0x00, 0x00, 0x01, 0x0B, 0x81, 0x38, 0x01, 0x03, 0x81, 0x37, 0x01, 0x00,
627 0x81, 0x37, 0x00, 0x01, 0x03, 0x00, 0x2F, 0x1A, 0x1B, 0x01, 0x10, 0x11,
628 0x06, 0x08, 0x01, 0x04, 0x81, 0x38, 0x02, 0x00, 0x81, 0x38, 0x1B, 0x01,
629 0x08, 0x11, 0x06, 0x08, 0x01, 0x03, 0x81, 0x38, 0x02, 0x00, 0x81, 0x38,
630 0x1B, 0x01, 0x20, 0x11, 0x06, 0x08, 0x01, 0x05, 0x81, 0x38, 0x02, 0x00,
631 0x81, 0x38, 0x1B, 0x01, 0x80, 0x40, 0x11, 0x06, 0x08, 0x01, 0x06, 0x81,
632 0x38, 0x02, 0x00, 0x81, 0x38, 0x01, 0x04, 0x11, 0x06, 0x08, 0x01, 0x02,
633 0x81, 0x38, 0x02, 0x00, 0x81, 0x38, 0x00, 0x00, 0x1B, 0x01, 0x08, 0x37,
634 0x81, 0x38, 0x81, 0x38, 0x00, 0x00, 0x1B, 0x01, 0x10, 0x37, 0x81, 0x38,
635 0x81, 0x36, 0x00, 0x00, 0x1B, 0x3A, 0x06, 0x02, 0x1A, 0x00, 0x81, 0x29,
639 static const uint16_t t0_caddr
[] = {
763 #define T0_INTERPRETED 64
765 #define T0_ENTER(ip, rp, slot) do { \
766 const unsigned char *t0_newip; \
768 t0_newip = &t0_codeblock[t0_caddr[(slot) - T0_INTERPRETED]]; \
769 t0_lnum = t0_parse7E_unsigned(&t0_newip); \
771 *((rp) ++) = (uint32_t)((ip) - &t0_codeblock[0]) + (t0_lnum << 16); \
775 #define T0_DEFENTRY(name, slot) \
779 t0_context *t0ctx = ctx; \
780 t0ctx->ip = &t0_codeblock[0]; \
781 T0_ENTER(t0ctx->ip, t0ctx->rp, slot); \
784 T0_DEFENTRY(br_ssl_hs_client_init_main
, 137)
787 br_ssl_hs_client_run(void *t0ctx
)
790 const unsigned char *ip
;
792 #define T0_LOCAL(x) (*(rp - 2 - (x)))
793 #define T0_POP() (*-- dp)
794 #define T0_POPi() (*(int32_t *)(-- dp))
795 #define T0_PEEK(x) (*(dp - 1 - (x)))
796 #define T0_PEEKi(x) (*(int32_t *)(dp - 1 - (x)))
797 #define T0_PUSH(v) do { *dp = (v); dp ++; } while (0)
798 #define T0_PUSHi(v) do { *(int32_t *)dp = (v); dp ++; } while (0)
799 #define T0_RPOP() (*-- rp)
800 #define T0_RPOPi() (*(int32_t *)(-- rp))
801 #define T0_RPUSH(v) do { *rp = (v); rp ++; } while (0)
802 #define T0_RPUSHi(v) do { *(int32_t *)rp = (v); rp ++; } while (0)
803 #define T0_ROLL(x) do { \
804 size_t t0len = (size_t)(x); \
805 uint32_t t0tmp = *(dp - 1 - t0len); \
806 memmove(dp - t0len - 1, dp - t0len, t0len * sizeof *dp); \
809 #define T0_SWAP() do { \
810 uint32_t t0tmp = *(dp - 2); \
811 *(dp - 2) = *(dp - 1); \
814 #define T0_ROT() do { \
815 uint32_t t0tmp = *(dp - 3); \
816 *(dp - 3) = *(dp - 2); \
817 *(dp - 2) = *(dp - 1); \
820 #define T0_NROT() do { \
821 uint32_t t0tmp = *(dp - 1); \
822 *(dp - 1) = *(dp - 2); \
823 *(dp - 2) = *(dp - 3); \
826 #define T0_PICK(x) do { \
827 uint32_t t0depth = (x); \
828 T0_PUSH(T0_PEEK(t0depth)); \
830 #define T0_CO() do { \
833 #define T0_RET() break
835 dp
= ((t0_context
*)t0ctx
)->dp
;
836 rp
= ((t0_context
*)t0ctx
)->rp
;
837 ip
= ((t0_context
*)t0ctx
)->ip
;
841 t0x
= t0_parse7E_unsigned(&ip
);
842 if (t0x
< T0_INTERPRETED
) {
854 ip
= &t0_codeblock
[t0x
];
856 case 1: /* literal constant */
857 T0_PUSHi(t0_parse7E_signed(&ip
));
859 case 2: /* read local */
860 T0_PUSH(T0_LOCAL(t0_parse7E_unsigned(&ip
)));
862 case 3: /* write local */
863 T0_LOCAL(t0_parse7E_unsigned(&ip
)) = T0_POP();
866 t0off
= t0_parse7E_signed(&ip
);
869 case 5: /* jump if */
870 t0off
= t0_parse7E_signed(&ip
);
875 case 6: /* jump if not */
876 t0off
= t0_parse7E_signed(&ip
);
884 uint32_t b
= T0_POP();
885 uint32_t a
= T0_POP();
893 uint32_t b
= T0_POP();
894 uint32_t a
= T0_POP();
902 uint32_t b
= T0_POP();
903 uint32_t a
= T0_POP();
911 int32_t b
= T0_POPi();
912 int32_t a
= T0_POPi();
913 T0_PUSH(-(uint32_t)(a
< b
));
920 int c
= (int)T0_POPi();
921 uint32_t x
= T0_POP();
929 uint32_t b
= T0_POP();
930 uint32_t a
= T0_POP();
931 T0_PUSH(-(uint32_t)(a
!= b
));
938 uint32_t b
= T0_POP();
939 uint32_t a
= T0_POP();
940 T0_PUSH(-(uint32_t)(a
== b
));
947 int32_t b
= T0_POPi();
948 int32_t a
= T0_POPi();
949 T0_PUSH(-(uint32_t)(a
> b
));
956 int32_t b
= T0_POPi();
957 int32_t a
= T0_POPi();
958 T0_PUSH(-(uint32_t)(a
>= b
));
965 int c
= (int)T0_POPi();
966 int32_t x
= T0_POPi();
974 uint32_t b
= T0_POP();
975 uint32_t a
= T0_POP();
983 size_t len
= (size_t)T0_POP();
984 void *addr
= (unsigned char *)ENG
+ (size_t)T0_POP();
985 memset(addr
, 0, len
);
992 T0_PUSHi(-(ENG
->hlen_out
> 0));
1002 /* compute-Finished-inner */
1004 int prf_id
= T0_POP();
1005 int from_client
= T0_POPi();
1006 unsigned char seed
[48];
1009 br_tls_prf_impl prf
= br_ssl_engine_get_PRF(ENG
, prf_id
);
1010 if (ENG
->session
.version
>= BR_TLS12
) {
1011 seed_len
= br_multihash_out(&ENG
->mhash
, prf_id
, seed
);
1013 br_multihash_out(&ENG
->mhash
, br_md5_ID
, seed
);
1014 br_multihash_out(&ENG
->mhash
, br_sha1_ID
, seed
+ 16);
1017 prf(ENG
->pad
, 12, ENG
->session
.master_secret
,
1018 sizeof ENG
->session
.master_secret
,
1019 from_client
? "client finished" : "server finished",
1027 size_t addr
= T0_POP();
1028 T0_PUSH(t0_datablock
[addr
]);
1042 unsigned prf_id
= T0_POP();
1043 unsigned ecdhe
= T0_POP();
1046 x
= make_pms_ecdh(CTX
, ecdhe
, prf_id
);
1048 br_ssl_engine_fail(ENG
, -x
);
1057 /* do-rsa-encrypt */
1061 x
= make_pms_rsa(CTX
, T0_POP());
1063 br_ssl_engine_fail(ENG
, -x
);
1078 T0_PUSH(T0_PEEK(0));
1084 br_ssl_engine_fail(ENG
, (int)T0_POPi());
1092 br_ssl_engine_flush_record(ENG
);
1099 size_t addr
= (size_t)T0_POP();
1100 T0_PUSH(*(uint16_t *)((unsigned char *)ENG
+ addr
));
1107 size_t addr
= (size_t)T0_POP();
1108 T0_PUSH(*((unsigned char *)ENG
+ addr
));
1115 T0_PUSHi(-(ENG
->hlen_in
!= 0));
1122 size_t len
= (size_t)T0_POP();
1123 void *addr2
= (unsigned char *)ENG
+ (size_t)T0_POP();
1124 void *addr1
= (unsigned char *)ENG
+ (size_t)T0_POP();
1125 int x
= memcmp(addr1
, addr2
, len
);
1126 T0_PUSH((uint32_t)-(x
== 0));
1133 size_t len
= (size_t)T0_POP();
1134 void *src
= (unsigned char *)ENG
+ (size_t)T0_POP();
1135 void *dst
= (unsigned char *)ENG
+ (size_t)T0_POP();
1136 memcpy(dst
, src
, len
);
1143 size_t len
= (size_t)T0_POP();
1144 void *addr
= (unsigned char *)ENG
+ (size_t)T0_POP();
1145 br_hmac_drbg_generate(&ENG
->rng
, addr
, len
);
1150 /* more-incoming-bytes? */
1152 T0_PUSHi(ENG
->hlen_in
!= 0 || !br_ssl_engine_recvrec_finished(ENG
));
1157 /* multihash-init */
1159 br_multihash_init(&ENG
->mhash
);
1166 uint32_t a
= T0_POP();
1174 uint32_t b
= T0_POP();
1175 uint32_t a
= T0_POP();
1182 T0_PUSH(T0_PEEK(1));
1186 /* read-chunk-native */
1188 size_t clen
= ENG
->hlen_in
;
1194 if ((size_t)len
< clen
) {
1197 memcpy((unsigned char *)ENG
+ addr
, ENG
->hbuf_in
, clen
);
1198 if (ENG
->record_type_in
== BR_SSL_HANDSHAKE
) {
1199 br_multihash_update(&ENG
->mhash
, ENG
->hbuf_in
, clen
);
1201 T0_PUSH(addr
+ (uint32_t)clen
);
1202 T0_PUSH(len
- (uint32_t)clen
);
1203 ENG
->hbuf_in
+= clen
;
1204 ENG
->hlen_in
-= clen
;
1212 if (ENG
->hlen_in
> 0) {
1215 x
= *ENG
->hbuf_in
++;
1216 if (ENG
->record_type_in
== BR_SSL_HANDSHAKE
) {
1217 br_multihash_update(&ENG
->mhash
, &x
, 1);
1230 size_t addr
= (size_t)T0_POP();
1231 *(uint16_t *)((unsigned char *)ENG
+ addr
) = (uint16_t)T0_POP();
1238 size_t addr
= (size_t)T0_POP();
1239 *((unsigned char *)ENG
+ addr
) = (unsigned char)T0_POP();
1246 void *str
= (unsigned char *)ENG
+ (size_t)T0_POP();
1247 T0_PUSH((uint32_t)strlen(str
));
1252 /* supported-curves */
1254 uint32_t x
= ENG
->iec
== NULL
? 0 : ENG
->iec
->supported_curves
;
1260 /* supported-hash-functions */
1267 for (i
= br_sha1_ID
; i
<= br_sha512_ID
; i
++) {
1268 if (br_multihash_getimpl(&ENG
->mhash
, i
)) {
1279 /* supports-ecdsa? */
1281 T0_PUSHi(-(CTX
->iecdsa
!= 0));
1286 /* supports-rsa-sign? */
1288 T0_PUSHi(-(CTX
->irsavrfy
!= 0));
1298 /* switch-aesgcm-in */
1300 int is_client
, prf_id
;
1301 unsigned cipher_key_len
;
1303 cipher_key_len
= T0_POP();
1305 is_client
= T0_POP();
1306 br_ssl_engine_switch_gcm_in(ENG
, is_client
, prf_id
,
1307 ENG
->iaes_ctr
, cipher_key_len
);
1312 /* switch-aesgcm-out */
1314 int is_client
, prf_id
;
1315 unsigned cipher_key_len
;
1317 cipher_key_len
= T0_POP();
1319 is_client
= T0_POP();
1320 br_ssl_engine_switch_gcm_out(ENG
, is_client
, prf_id
,
1321 ENG
->iaes_ctr
, cipher_key_len
);
1328 int is_client
, prf_id
, mac_id
, aes
;
1329 unsigned cipher_key_len
;
1331 cipher_key_len
= T0_POP();
1335 is_client
= T0_POP();
1336 br_ssl_engine_switch_cbc_in(ENG
, is_client
, prf_id
, mac_id
,
1337 aes
? ENG
->iaes_cbcdec
: ENG
->ides_cbcdec
, cipher_key_len
);
1342 /* switch-cbc-out */
1344 int is_client
, prf_id
, mac_id
, aes
;
1345 unsigned cipher_key_len
;
1347 cipher_key_len
= T0_POP();
1351 is_client
= T0_POP();
1352 br_ssl_engine_switch_cbc_out(ENG
, is_client
, prf_id
, mac_id
,
1353 aes
? ENG
->iaes_cbcenc
: ENG
->ides_cbcenc
, cipher_key_len
);
1360 int c
= (int)T0_POPi();
1361 uint32_t x
= T0_POP();
1367 /* verify-SKE-sig */
1369 size_t sig_len
= T0_POP();
1370 int use_rsa
= T0_POPi();
1371 int hash
= T0_POPi();
1373 T0_PUSH(verify_SKE_sig(CTX
, hash
, use_rsa
, sig_len
));
1378 /* write-blob-chunk */
1380 size_t clen
= ENG
->hlen_out
;
1386 if ((size_t)len
< clen
) {
1389 memcpy(ENG
->hbuf_out
, (unsigned char *)ENG
+ addr
, clen
);
1390 if (ENG
->record_type_out
== BR_SSL_HANDSHAKE
) {
1391 br_multihash_update(&ENG
->mhash
, ENG
->hbuf_out
, clen
);
1393 T0_PUSH(addr
+ (uint32_t)clen
);
1394 T0_PUSH(len
- (uint32_t)clen
);
1395 ENG
->hbuf_out
+= clen
;
1396 ENG
->hlen_out
-= clen
;
1406 x
= (unsigned char)T0_POP();
1407 if (ENG
->hlen_out
> 0) {
1408 if (ENG
->record_type_out
== BR_SSL_HANDSHAKE
) {
1409 br_multihash_update(&ENG
->mhash
, &x
, 1);
1411 *ENG
->hbuf_out
++ = x
;
1423 const br_x509_class
*xc
;
1426 xc
= *(ENG
->x509ctx
);
1428 xc
->append(ENG
->x509ctx
, ENG
->pad
, len
);
1435 const br_x509_class
*xc
;
1437 xc
= *(ENG
->x509ctx
);
1438 xc
->end_cert(ENG
->x509ctx
);
1443 /* x509-end-chain */
1445 const br_x509_class
*xc
;
1447 xc
= *(ENG
->x509ctx
);
1448 T0_PUSH(xc
->end_chain(ENG
->x509ctx
));
1453 /* x509-start-cert */
1455 const br_x509_class
*xc
;
1457 xc
= *(ENG
->x509ctx
);
1458 xc
->start_cert(ENG
->x509ctx
, T0_POP());
1463 /* x509-start-chain */
1465 const br_x509_class
*xc
;
1467 xc
= *(ENG
->x509ctx
);
1468 xc
->start_chain(ENG
->x509ctx
, T0_POP(), ENG
->server_name
);
1475 T0_ENTER(ip
, rp
, t0x
);
1479 ((t0_context
*)t0ctx
)->dp
= dp
;
1480 ((t0_context
*)t0ctx
)->rp
= rp
;
1481 ((t0_context
*)t0ctx
)->ip
= ip
;