xref: /freebsd/crypto/openssl/fuzz/server.c (revision e0c4386e7e71d93b0edc0c8fa156263fc4a8b0b6)
1*e0c4386eSCy Schubert /*
2*e0c4386eSCy Schubert  * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved.
3*e0c4386eSCy Schubert  *
4*e0c4386eSCy Schubert  * Licensed under the Apache License 2.0 (the "License");
5*e0c4386eSCy Schubert  * you may not use this file except in compliance with the License.
6*e0c4386eSCy Schubert  * You may obtain a copy of the License at
7*e0c4386eSCy Schubert  * https://www.openssl.org/source/license.html
8*e0c4386eSCy Schubert  * or in the file LICENSE in the source distribution.
9*e0c4386eSCy Schubert  */
10*e0c4386eSCy Schubert 
11*e0c4386eSCy Schubert /* Shamelessly copied from BoringSSL and converted to C. */
12*e0c4386eSCy Schubert 
13*e0c4386eSCy Schubert /* Test first part of SSL server handshake. */
14*e0c4386eSCy Schubert 
15*e0c4386eSCy Schubert /* We need to use some deprecated APIs */
16*e0c4386eSCy Schubert #define OPENSSL_SUPPRESS_DEPRECATED
17*e0c4386eSCy Schubert 
18*e0c4386eSCy Schubert #include <time.h>
19*e0c4386eSCy Schubert #include <openssl/rand.h>
20*e0c4386eSCy Schubert #include <openssl/ssl.h>
21*e0c4386eSCy Schubert #include <openssl/rsa.h>
22*e0c4386eSCy Schubert #include <openssl/dsa.h>
23*e0c4386eSCy Schubert #include <openssl/ec.h>
24*e0c4386eSCy Schubert #include <openssl/dh.h>
25*e0c4386eSCy Schubert #include <openssl/err.h>
26*e0c4386eSCy Schubert #include "fuzzer.h"
27*e0c4386eSCy Schubert 
28*e0c4386eSCy Schubert static const uint8_t kCertificateDER[] = {
29*e0c4386eSCy Schubert     0x30, 0x82, 0x02, 0xff, 0x30, 0x82, 0x01, 0xe7, 0xa0, 0x03, 0x02, 0x01,
30*e0c4386eSCy Schubert     0x02, 0x02, 0x11, 0x00, 0xb1, 0x84, 0xee, 0x34, 0x99, 0x98, 0x76, 0xfb,
31*e0c4386eSCy Schubert     0x6f, 0xb2, 0x15, 0xc8, 0x47, 0x79, 0x05, 0x9b, 0x30, 0x0d, 0x06, 0x09,
32*e0c4386eSCy Schubert     0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x30,
33*e0c4386eSCy Schubert     0x12, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55, 0x04, 0x0a, 0x13, 0x07,
34*e0c4386eSCy Schubert     0x41, 0x63, 0x6d, 0x65, 0x20, 0x43, 0x6f, 0x30, 0x1e, 0x17, 0x0d, 0x31,
35*e0c4386eSCy Schubert     0x35, 0x31, 0x31, 0x30, 0x37, 0x30, 0x30, 0x32, 0x34, 0x35, 0x36, 0x5a,
36*e0c4386eSCy Schubert     0x17, 0x0d, 0x31, 0x36, 0x31, 0x31, 0x30, 0x36, 0x30, 0x30, 0x32, 0x34,
37*e0c4386eSCy Schubert     0x35, 0x36, 0x5a, 0x30, 0x12, 0x31, 0x10, 0x30, 0x0e, 0x06, 0x03, 0x55,
38*e0c4386eSCy Schubert     0x04, 0x0a, 0x13, 0x07, 0x41, 0x63, 0x6d, 0x65, 0x20, 0x43, 0x6f, 0x30,
39*e0c4386eSCy Schubert     0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
40*e0c4386eSCy Schubert     0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00, 0x30,
41*e0c4386eSCy Schubert     0x82, 0x01, 0x0a, 0x02, 0x82, 0x01, 0x01, 0x00, 0xce, 0x47, 0xcb, 0x11,
42*e0c4386eSCy Schubert     0xbb, 0xd2, 0x9d, 0x8e, 0x9e, 0xd2, 0x1e, 0x14, 0xaf, 0xc7, 0xea, 0xb6,
43*e0c4386eSCy Schubert     0xc9, 0x38, 0x2a, 0x6f, 0xb3, 0x7e, 0xfb, 0xbc, 0xfc, 0x59, 0x42, 0xb9,
44*e0c4386eSCy Schubert     0x56, 0xf0, 0x4c, 0x3f, 0xf7, 0x31, 0x84, 0xbe, 0xac, 0x03, 0x9e, 0x71,
45*e0c4386eSCy Schubert     0x91, 0x85, 0xd8, 0x32, 0xbd, 0x00, 0xea, 0xac, 0x65, 0xf6, 0x03, 0xc8,
46*e0c4386eSCy Schubert     0x0f, 0x8b, 0xfd, 0x6e, 0x58, 0x88, 0x04, 0x41, 0x92, 0x74, 0xa6, 0x57,
47*e0c4386eSCy Schubert     0x2e, 0x8e, 0x88, 0xd5, 0x3d, 0xda, 0x14, 0x3e, 0x63, 0x88, 0x22, 0xe3,
48*e0c4386eSCy Schubert     0x53, 0xe9, 0xba, 0x39, 0x09, 0xac, 0xfb, 0xd0, 0x4c, 0xf2, 0x3c, 0x20,
49*e0c4386eSCy Schubert     0xd6, 0x97, 0xe6, 0xed, 0xf1, 0x62, 0x1e, 0xe5, 0xc9, 0x48, 0xa0, 0xca,
50*e0c4386eSCy Schubert     0x2e, 0x3c, 0x14, 0x5a, 0x82, 0xd4, 0xed, 0xb1, 0xe3, 0x43, 0xc1, 0x2a,
51*e0c4386eSCy Schubert     0x59, 0xa5, 0xb9, 0xc8, 0x48, 0xa7, 0x39, 0x23, 0x74, 0xa7, 0x37, 0xb0,
52*e0c4386eSCy Schubert     0x6f, 0xc3, 0x64, 0x99, 0x6c, 0xa2, 0x82, 0xc8, 0xf6, 0xdb, 0x86, 0x40,
53*e0c4386eSCy Schubert     0xce, 0xd1, 0x85, 0x9f, 0xce, 0x69, 0xf4, 0x15, 0x2a, 0x23, 0xca, 0xea,
54*e0c4386eSCy Schubert     0xb7, 0x7b, 0xdf, 0xfb, 0x43, 0x5f, 0xff, 0x7a, 0x49, 0x49, 0x0e, 0xe7,
55*e0c4386eSCy Schubert     0x02, 0x51, 0x45, 0x13, 0xe8, 0x90, 0x64, 0x21, 0x0c, 0x26, 0x2b, 0x5d,
56*e0c4386eSCy Schubert     0xfc, 0xe4, 0xb5, 0x86, 0x89, 0x43, 0x22, 0x4c, 0xf3, 0x3b, 0xf3, 0x09,
57*e0c4386eSCy Schubert     0xc4, 0xa4, 0x10, 0x80, 0xf2, 0x46, 0xe2, 0x46, 0x8f, 0x76, 0x50, 0xbf,
58*e0c4386eSCy Schubert     0xaf, 0x2b, 0x90, 0x1b, 0x78, 0xc7, 0xcf, 0xc1, 0x77, 0xd0, 0xfb, 0xa9,
59*e0c4386eSCy Schubert     0xfb, 0xc9, 0x66, 0x5a, 0xc5, 0x9b, 0x31, 0x41, 0x67, 0x01, 0xbe, 0x33,
60*e0c4386eSCy Schubert     0x10, 0xba, 0x05, 0x58, 0xed, 0x76, 0x53, 0xde, 0x5d, 0xc1, 0xe8, 0xbb,
61*e0c4386eSCy Schubert     0x9f, 0xf1, 0xcd, 0xfb, 0xdf, 0x64, 0x7f, 0xd7, 0x18, 0xab, 0x0f, 0x94,
62*e0c4386eSCy Schubert     0x28, 0x95, 0x4a, 0xcc, 0x6a, 0xa9, 0x50, 0xc7, 0x05, 0x47, 0x10, 0x41,
63*e0c4386eSCy Schubert     0x02, 0x03, 0x01, 0x00, 0x01, 0xa3, 0x50, 0x30, 0x4e, 0x30, 0x0e, 0x06,
64*e0c4386eSCy Schubert     0x03, 0x55, 0x1d, 0x0f, 0x01, 0x01, 0xff, 0x04, 0x04, 0x03, 0x02, 0x05,
65*e0c4386eSCy Schubert     0xa0, 0x30, 0x13, 0x06, 0x03, 0x55, 0x1d, 0x25, 0x04, 0x0c, 0x30, 0x0a,
66*e0c4386eSCy Schubert     0x06, 0x08, 0x2b, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, 0x30, 0x0c,
67*e0c4386eSCy Schubert     0x06, 0x03, 0x55, 0x1d, 0x13, 0x01, 0x01, 0xff, 0x04, 0x02, 0x30, 0x00,
68*e0c4386eSCy Schubert     0x30, 0x19, 0x06, 0x03, 0x55, 0x1d, 0x11, 0x04, 0x12, 0x30, 0x10, 0x82,
69*e0c4386eSCy Schubert     0x0e, 0x66, 0x75, 0x7a, 0x7a, 0x2e, 0x62, 0x6f, 0x72, 0x69, 0x6e, 0x67,
70*e0c4386eSCy Schubert     0x73, 0x73, 0x6c, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7,
71*e0c4386eSCy Schubert     0x0d, 0x01, 0x01, 0x0b, 0x05, 0x00, 0x03, 0x82, 0x01, 0x01, 0x00, 0x92,
72*e0c4386eSCy Schubert     0xde, 0xef, 0x96, 0x06, 0x7b, 0xff, 0x71, 0x7d, 0x4e, 0xa0, 0x7d, 0xae,
73*e0c4386eSCy Schubert     0xb8, 0x22, 0xb4, 0x2c, 0xf7, 0x96, 0x9c, 0x37, 0x1d, 0x8f, 0xe7, 0xd9,
74*e0c4386eSCy Schubert     0x47, 0xff, 0x3f, 0xe9, 0x35, 0x95, 0x0e, 0xdd, 0xdc, 0x7f, 0xc8, 0x8a,
75*e0c4386eSCy Schubert     0x1e, 0x36, 0x1d, 0x38, 0x47, 0xfc, 0x76, 0xd2, 0x1f, 0x98, 0xa1, 0x36,
76*e0c4386eSCy Schubert     0xac, 0xc8, 0x70, 0x38, 0x0a, 0x3d, 0x51, 0x8d, 0x0f, 0x03, 0x1b, 0xef,
77*e0c4386eSCy Schubert     0x62, 0xa1, 0xcb, 0x2b, 0x4a, 0x8c, 0x12, 0x2b, 0x54, 0x50, 0x9a, 0x6b,
78*e0c4386eSCy Schubert     0xfe, 0xaf, 0xd9, 0xf6, 0xbf, 0x58, 0x11, 0x58, 0x5e, 0xe5, 0x86, 0x1e,
79*e0c4386eSCy Schubert     0x3b, 0x6b, 0x30, 0x7e, 0x72, 0x89, 0xe8, 0x6b, 0x7b, 0xb7, 0xaf, 0xef,
80*e0c4386eSCy Schubert     0x8b, 0xa9, 0x3e, 0xb0, 0xcd, 0x0b, 0xef, 0xb0, 0x0c, 0x96, 0x2b, 0xc5,
81*e0c4386eSCy Schubert     0x3b, 0xd5, 0xf1, 0xc2, 0xae, 0x3a, 0x60, 0xd9, 0x0f, 0x75, 0x37, 0x55,
82*e0c4386eSCy Schubert     0x4d, 0x62, 0xd2, 0xed, 0x96, 0xac, 0x30, 0x6b, 0xda, 0xa1, 0x48, 0x17,
83*e0c4386eSCy Schubert     0x96, 0x23, 0x85, 0x9a, 0x57, 0x77, 0xe9, 0x22, 0xa2, 0x37, 0x03, 0xba,
84*e0c4386eSCy Schubert     0x49, 0x77, 0x40, 0x3b, 0x76, 0x4b, 0xda, 0xc1, 0x04, 0x57, 0x55, 0x34,
85*e0c4386eSCy Schubert     0x22, 0x83, 0x45, 0x29, 0xab, 0x2e, 0x11, 0xff, 0x0d, 0xab, 0x55, 0xb1,
86*e0c4386eSCy Schubert     0xa7, 0x58, 0x59, 0x05, 0x25, 0xf9, 0x1e, 0x3d, 0xb7, 0xac, 0x04, 0x39,
87*e0c4386eSCy Schubert     0x2c, 0xf9, 0xaf, 0xb8, 0x68, 0xfb, 0x8e, 0x35, 0x71, 0x32, 0xff, 0x70,
88*e0c4386eSCy Schubert     0xe9, 0x46, 0x6d, 0x5c, 0x06, 0x90, 0x88, 0x23, 0x48, 0x0c, 0x50, 0xeb,
89*e0c4386eSCy Schubert     0x0a, 0xa9, 0xae, 0xe8, 0xfc, 0xbe, 0xa5, 0x76, 0x94, 0xd7, 0x64, 0x22,
90*e0c4386eSCy Schubert     0x38, 0x98, 0x17, 0xa4, 0x3a, 0xa7, 0x59, 0x9f, 0x1d, 0x3b, 0x75, 0x90,
91*e0c4386eSCy Schubert     0x1a, 0x81, 0xef, 0x19, 0xfb, 0x2b, 0xb7, 0xa7, 0x64, 0x61, 0x22, 0xa4,
92*e0c4386eSCy Schubert     0x6f, 0x7b, 0xfa, 0x58, 0xbb, 0x8c, 0x4e, 0x77, 0x67, 0xd0, 0x5d, 0x58,
93*e0c4386eSCy Schubert     0x76, 0x8a, 0xbb,
94*e0c4386eSCy Schubert };
95*e0c4386eSCy Schubert 
96*e0c4386eSCy Schubert #ifndef OPENSSL_NO_DEPRECATED_3_0
97*e0c4386eSCy Schubert static const uint8_t kRSAPrivateKeyDER[] = {
98*e0c4386eSCy Schubert     0x30, 0x82, 0x04, 0xa5, 0x02, 0x01, 0x00, 0x02, 0x82, 0x01, 0x01, 0x00,
99*e0c4386eSCy Schubert     0xce, 0x47, 0xcb, 0x11, 0xbb, 0xd2, 0x9d, 0x8e, 0x9e, 0xd2, 0x1e, 0x14,
100*e0c4386eSCy Schubert     0xaf, 0xc7, 0xea, 0xb6, 0xc9, 0x38, 0x2a, 0x6f, 0xb3, 0x7e, 0xfb, 0xbc,
101*e0c4386eSCy Schubert     0xfc, 0x59, 0x42, 0xb9, 0x56, 0xf0, 0x4c, 0x3f, 0xf7, 0x31, 0x84, 0xbe,
102*e0c4386eSCy Schubert     0xac, 0x03, 0x9e, 0x71, 0x91, 0x85, 0xd8, 0x32, 0xbd, 0x00, 0xea, 0xac,
103*e0c4386eSCy Schubert     0x65, 0xf6, 0x03, 0xc8, 0x0f, 0x8b, 0xfd, 0x6e, 0x58, 0x88, 0x04, 0x41,
104*e0c4386eSCy Schubert     0x92, 0x74, 0xa6, 0x57, 0x2e, 0x8e, 0x88, 0xd5, 0x3d, 0xda, 0x14, 0x3e,
105*e0c4386eSCy Schubert     0x63, 0x88, 0x22, 0xe3, 0x53, 0xe9, 0xba, 0x39, 0x09, 0xac, 0xfb, 0xd0,
106*e0c4386eSCy Schubert     0x4c, 0xf2, 0x3c, 0x20, 0xd6, 0x97, 0xe6, 0xed, 0xf1, 0x62, 0x1e, 0xe5,
107*e0c4386eSCy Schubert     0xc9, 0x48, 0xa0, 0xca, 0x2e, 0x3c, 0x14, 0x5a, 0x82, 0xd4, 0xed, 0xb1,
108*e0c4386eSCy Schubert     0xe3, 0x43, 0xc1, 0x2a, 0x59, 0xa5, 0xb9, 0xc8, 0x48, 0xa7, 0x39, 0x23,
109*e0c4386eSCy Schubert     0x74, 0xa7, 0x37, 0xb0, 0x6f, 0xc3, 0x64, 0x99, 0x6c, 0xa2, 0x82, 0xc8,
110*e0c4386eSCy Schubert     0xf6, 0xdb, 0x86, 0x40, 0xce, 0xd1, 0x85, 0x9f, 0xce, 0x69, 0xf4, 0x15,
111*e0c4386eSCy Schubert     0x2a, 0x23, 0xca, 0xea, 0xb7, 0x7b, 0xdf, 0xfb, 0x43, 0x5f, 0xff, 0x7a,
112*e0c4386eSCy Schubert     0x49, 0x49, 0x0e, 0xe7, 0x02, 0x51, 0x45, 0x13, 0xe8, 0x90, 0x64, 0x21,
113*e0c4386eSCy Schubert     0x0c, 0x26, 0x2b, 0x5d, 0xfc, 0xe4, 0xb5, 0x86, 0x89, 0x43, 0x22, 0x4c,
114*e0c4386eSCy Schubert     0xf3, 0x3b, 0xf3, 0x09, 0xc4, 0xa4, 0x10, 0x80, 0xf2, 0x46, 0xe2, 0x46,
115*e0c4386eSCy Schubert     0x8f, 0x76, 0x50, 0xbf, 0xaf, 0x2b, 0x90, 0x1b, 0x78, 0xc7, 0xcf, 0xc1,
116*e0c4386eSCy Schubert     0x77, 0xd0, 0xfb, 0xa9, 0xfb, 0xc9, 0x66, 0x5a, 0xc5, 0x9b, 0x31, 0x41,
117*e0c4386eSCy Schubert     0x67, 0x01, 0xbe, 0x33, 0x10, 0xba, 0x05, 0x58, 0xed, 0x76, 0x53, 0xde,
118*e0c4386eSCy Schubert     0x5d, 0xc1, 0xe8, 0xbb, 0x9f, 0xf1, 0xcd, 0xfb, 0xdf, 0x64, 0x7f, 0xd7,
119*e0c4386eSCy Schubert     0x18, 0xab, 0x0f, 0x94, 0x28, 0x95, 0x4a, 0xcc, 0x6a, 0xa9, 0x50, 0xc7,
120*e0c4386eSCy Schubert     0x05, 0x47, 0x10, 0x41, 0x02, 0x03, 0x01, 0x00, 0x01, 0x02, 0x82, 0x01,
121*e0c4386eSCy Schubert     0x01, 0x00, 0xa8, 0x47, 0xb9, 0x4a, 0x06, 0x47, 0x93, 0x71, 0x3d, 0xef,
122*e0c4386eSCy Schubert     0x7b, 0xca, 0xb4, 0x7c, 0x0a, 0xe6, 0x82, 0xd0, 0xe7, 0x0d, 0xa9, 0x08,
123*e0c4386eSCy Schubert     0xf6, 0xa4, 0xfd, 0xd8, 0x73, 0xae, 0x6f, 0x56, 0x29, 0x5e, 0x25, 0x72,
124*e0c4386eSCy Schubert     0xa8, 0x30, 0x44, 0x73, 0xcf, 0x56, 0x26, 0xb9, 0x61, 0xde, 0x42, 0x81,
125*e0c4386eSCy Schubert     0xf4, 0xf0, 0x1f, 0x5d, 0xcb, 0x47, 0xf2, 0x26, 0xe9, 0xe0, 0x93, 0x28,
126*e0c4386eSCy Schubert     0xa3, 0x10, 0x3b, 0x42, 0x1e, 0x51, 0x11, 0x12, 0x06, 0x5e, 0xaf, 0xce,
127*e0c4386eSCy Schubert     0xb0, 0xa5, 0x14, 0xdd, 0x82, 0x58, 0xa1, 0xa4, 0x12, 0xdf, 0x65, 0x1d,
128*e0c4386eSCy Schubert     0x51, 0x70, 0x64, 0xd5, 0x58, 0x68, 0x11, 0xa8, 0x6a, 0x23, 0xc2, 0xbf,
129*e0c4386eSCy Schubert     0xa1, 0x25, 0x24, 0x47, 0xb3, 0xa4, 0x3c, 0x83, 0x96, 0xb7, 0x1f, 0xf4,
130*e0c4386eSCy Schubert     0x44, 0xd4, 0xd1, 0xe9, 0xfc, 0x33, 0x68, 0x5e, 0xe2, 0x68, 0x99, 0x9c,
131*e0c4386eSCy Schubert     0x91, 0xe8, 0x72, 0xc9, 0xd7, 0x8c, 0x80, 0x20, 0x8e, 0x77, 0x83, 0x4d,
132*e0c4386eSCy Schubert     0xe4, 0xab, 0xf9, 0x74, 0xa1, 0xdf, 0xd3, 0xc0, 0x0d, 0x5b, 0x05, 0x51,
133*e0c4386eSCy Schubert     0xc2, 0x6f, 0xb2, 0x91, 0x02, 0xec, 0xc0, 0x02, 0x1a, 0x5c, 0x91, 0x05,
134*e0c4386eSCy Schubert     0xf1, 0xe3, 0xfa, 0x65, 0xc2, 0xad, 0x24, 0xe6, 0xe5, 0x3c, 0xb6, 0x16,
135*e0c4386eSCy Schubert     0xf1, 0xa1, 0x67, 0x1a, 0x9d, 0x37, 0x56, 0xbf, 0x01, 0xd7, 0x3b, 0x35,
136*e0c4386eSCy Schubert     0x30, 0x57, 0x73, 0xf4, 0xf0, 0x5e, 0xa7, 0xe8, 0x0a, 0xc1, 0x94, 0x17,
137*e0c4386eSCy Schubert     0xcf, 0x0a, 0xbd, 0xf5, 0x31, 0xa7, 0x2d, 0xf7, 0xf5, 0xd9, 0x8c, 0xc2,
138*e0c4386eSCy Schubert     0x01, 0xbd, 0xda, 0x16, 0x8e, 0xb9, 0x30, 0x40, 0xa6, 0x6e, 0xbd, 0xcd,
139*e0c4386eSCy Schubert     0x4d, 0x84, 0x67, 0x4e, 0x0b, 0xce, 0xd5, 0xef, 0xf8, 0x08, 0x63, 0x02,
140*e0c4386eSCy Schubert     0xc6, 0xc7, 0xf7, 0x67, 0x92, 0xe2, 0x23, 0x9d, 0x27, 0x22, 0x1d, 0xc6,
141*e0c4386eSCy Schubert     0x67, 0x5e, 0x66, 0xbf, 0x03, 0xb8, 0xa9, 0x67, 0xd4, 0x39, 0xd8, 0x75,
142*e0c4386eSCy Schubert     0xfa, 0xe8, 0xed, 0x56, 0xb8, 0x81, 0x02, 0x81, 0x81, 0x00, 0xf7, 0x46,
143*e0c4386eSCy Schubert     0x68, 0xc6, 0x13, 0xf8, 0xba, 0x0f, 0x83, 0xdb, 0x05, 0xa8, 0x25, 0x00,
144*e0c4386eSCy Schubert     0x70, 0x9c, 0x9e, 0x8b, 0x12, 0x34, 0x0d, 0x96, 0xcf, 0x0d, 0x98, 0x9b,
145*e0c4386eSCy Schubert     0x8d, 0x9c, 0x96, 0x78, 0xd1, 0x3c, 0x01, 0x8c, 0xb9, 0x35, 0x5c, 0x20,
146*e0c4386eSCy Schubert     0x42, 0xb4, 0x38, 0xe3, 0xd6, 0x54, 0xe7, 0x55, 0xd6, 0x26, 0x8a, 0x0c,
147*e0c4386eSCy Schubert     0xf6, 0x1f, 0xe0, 0x04, 0xc1, 0x22, 0x42, 0x19, 0x61, 0xc4, 0x94, 0x7c,
148*e0c4386eSCy Schubert     0x07, 0x2e, 0x80, 0x52, 0xfe, 0x8d, 0xe6, 0x92, 0x3a, 0x91, 0xfe, 0x72,
149*e0c4386eSCy Schubert     0x99, 0xe1, 0x2a, 0x73, 0x76, 0xb1, 0x24, 0x20, 0x67, 0xde, 0x28, 0xcb,
150*e0c4386eSCy Schubert     0x0e, 0xe6, 0x52, 0xb5, 0xfa, 0xfb, 0x8b, 0x1e, 0x6a, 0x1d, 0x09, 0x26,
151*e0c4386eSCy Schubert     0xb9, 0xa7, 0x61, 0xba, 0xf8, 0x79, 0xd2, 0x66, 0x57, 0x28, 0xd7, 0x31,
152*e0c4386eSCy Schubert     0xb5, 0x0b, 0x27, 0x19, 0x1e, 0x6f, 0x46, 0xfc, 0x54, 0x95, 0xeb, 0x78,
153*e0c4386eSCy Schubert     0x01, 0xb6, 0xd9, 0x79, 0x5a, 0x4d, 0x02, 0x81, 0x81, 0x00, 0xd5, 0x8f,
154*e0c4386eSCy Schubert     0x16, 0x53, 0x2f, 0x57, 0x93, 0xbf, 0x09, 0x75, 0xbf, 0x63, 0x40, 0x3d,
155*e0c4386eSCy Schubert     0x27, 0xfd, 0x23, 0x21, 0xde, 0x9b, 0xe9, 0x73, 0x3f, 0x49, 0x02, 0xd2,
156*e0c4386eSCy Schubert     0x38, 0x96, 0xcf, 0xc3, 0xba, 0x92, 0x07, 0x87, 0x52, 0xa9, 0x35, 0xe3,
157*e0c4386eSCy Schubert     0x0c, 0xe4, 0x2f, 0x05, 0x7b, 0x37, 0xa5, 0x40, 0x9c, 0x3b, 0x94, 0xf7,
158*e0c4386eSCy Schubert     0xad, 0xa0, 0xee, 0x3a, 0xa8, 0xfb, 0x1f, 0x11, 0x1f, 0xd8, 0x9a, 0x80,
159*e0c4386eSCy Schubert     0x42, 0x3d, 0x7f, 0xa4, 0xb8, 0x9a, 0xaa, 0xea, 0x72, 0xc1, 0xe3, 0xed,
160*e0c4386eSCy Schubert     0x06, 0x60, 0x92, 0x37, 0xf9, 0xba, 0xfb, 0x9e, 0xed, 0x05, 0xa6, 0xd4,
161*e0c4386eSCy Schubert     0x72, 0x68, 0x4f, 0x63, 0xfe, 0xd6, 0x10, 0x0d, 0x4f, 0x0a, 0x93, 0xc6,
162*e0c4386eSCy Schubert     0xb9, 0xd7, 0xaf, 0xfd, 0xd9, 0x57, 0x7d, 0xcb, 0x75, 0xe8, 0x93, 0x2b,
163*e0c4386eSCy Schubert     0xae, 0x4f, 0xea, 0xd7, 0x30, 0x0b, 0x58, 0x44, 0x82, 0x0f, 0x84, 0x5d,
164*e0c4386eSCy Schubert     0x62, 0x11, 0x78, 0xea, 0x5f, 0xc5, 0x02, 0x81, 0x81, 0x00, 0x82, 0x0c,
165*e0c4386eSCy Schubert     0xc1, 0xe6, 0x0b, 0x72, 0xf1, 0x48, 0x5f, 0xac, 0xbd, 0x98, 0xe5, 0x7d,
166*e0c4386eSCy Schubert     0x09, 0xbd, 0x15, 0x95, 0x47, 0x09, 0xa1, 0x6c, 0x03, 0x91, 0xbf, 0x05,
167*e0c4386eSCy Schubert     0x70, 0xc1, 0x3e, 0x52, 0x64, 0x99, 0x0e, 0xa7, 0x98, 0x70, 0xfb, 0xf6,
168*e0c4386eSCy Schubert     0xeb, 0x9e, 0x25, 0x9d, 0x8e, 0x88, 0x30, 0xf2, 0xf0, 0x22, 0x6c, 0xd0,
169*e0c4386eSCy Schubert     0xcc, 0x51, 0x8f, 0x5c, 0x70, 0xc7, 0x37, 0xc4, 0x69, 0xab, 0x1d, 0xfc,
170*e0c4386eSCy Schubert     0xed, 0x3a, 0x03, 0xbb, 0xa2, 0xad, 0xb6, 0xea, 0x89, 0x6b, 0x67, 0x4b,
171*e0c4386eSCy Schubert     0x96, 0xaa, 0xd9, 0xcc, 0xc8, 0x4b, 0xfa, 0x18, 0x21, 0x08, 0xb2, 0xa3,
172*e0c4386eSCy Schubert     0xb9, 0x3e, 0x61, 0x99, 0xdc, 0x5a, 0x97, 0x9c, 0x73, 0x6a, 0xb9, 0xf9,
173*e0c4386eSCy Schubert     0x68, 0x03, 0x24, 0x5f, 0x55, 0x77, 0x9c, 0xb4, 0xbe, 0x7a, 0x78, 0x53,
174*e0c4386eSCy Schubert     0x68, 0x48, 0x69, 0x53, 0xc8, 0xb1, 0xf5, 0xbf, 0x98, 0x2d, 0x11, 0x1e,
175*e0c4386eSCy Schubert     0x98, 0xa8, 0x36, 0x50, 0xa0, 0xb1, 0x02, 0x81, 0x81, 0x00, 0x90, 0x88,
176*e0c4386eSCy Schubert     0x30, 0x71, 0xc7, 0xfe, 0x9b, 0x6d, 0x95, 0x37, 0x6d, 0x79, 0xfc, 0x85,
177*e0c4386eSCy Schubert     0xe7, 0x44, 0x78, 0xbc, 0x79, 0x6e, 0x47, 0x86, 0xc9, 0xf3, 0xdd, 0xc6,
178*e0c4386eSCy Schubert     0xec, 0xa9, 0x94, 0x9f, 0x40, 0xeb, 0x87, 0xd0, 0xdb, 0xee, 0xcd, 0x1b,
179*e0c4386eSCy Schubert     0x87, 0x23, 0xff, 0x76, 0xd4, 0x37, 0x8a, 0xcd, 0xb9, 0x6e, 0xd1, 0x98,
180*e0c4386eSCy Schubert     0xf6, 0x97, 0x8d, 0xe3, 0x81, 0x6d, 0xc3, 0x4e, 0xd1, 0xa0, 0xc4, 0x9f,
181*e0c4386eSCy Schubert     0xbd, 0x34, 0xe5, 0xe8, 0x53, 0x4f, 0xca, 0x10, 0xb5, 0xed, 0xe7, 0x16,
182*e0c4386eSCy Schubert     0x09, 0x54, 0xde, 0x60, 0xa7, 0xd1, 0x16, 0x6e, 0x2e, 0xb7, 0xbe, 0x7a,
183*e0c4386eSCy Schubert     0xd5, 0x9b, 0x26, 0xef, 0xe4, 0x0e, 0x77, 0xfa, 0xa9, 0xdd, 0xdc, 0xb9,
184*e0c4386eSCy Schubert     0x88, 0x19, 0x23, 0x70, 0xc7, 0xe1, 0x60, 0xaf, 0x8c, 0x73, 0x04, 0xf7,
185*e0c4386eSCy Schubert     0x71, 0x17, 0x81, 0x36, 0x75, 0xbb, 0x97, 0xd7, 0x75, 0xb6, 0x8e, 0xbc,
186*e0c4386eSCy Schubert     0xac, 0x9c, 0x6a, 0x9b, 0x24, 0x89, 0x02, 0x81, 0x80, 0x5a, 0x2b, 0xc7,
187*e0c4386eSCy Schubert     0x6b, 0x8c, 0x65, 0xdb, 0x04, 0x73, 0xab, 0x25, 0xe1, 0x5b, 0xbc, 0x3c,
188*e0c4386eSCy Schubert     0xcf, 0x5a, 0x3c, 0x04, 0xae, 0x97, 0x2e, 0xfd, 0xa4, 0x97, 0x1f, 0x05,
189*e0c4386eSCy Schubert     0x17, 0x27, 0xac, 0x7c, 0x30, 0x85, 0xb4, 0x82, 0x3f, 0x5b, 0xb7, 0x94,
190*e0c4386eSCy Schubert     0x3b, 0x7f, 0x6c, 0x0c, 0xc7, 0x16, 0xc6, 0xa0, 0xbd, 0x80, 0xb0, 0x81,
191*e0c4386eSCy Schubert     0xde, 0xa0, 0x23, 0xa6, 0xf6, 0x75, 0x33, 0x51, 0x35, 0xa2, 0x75, 0x55,
192*e0c4386eSCy Schubert     0x70, 0x4d, 0x42, 0xbb, 0xcf, 0x54, 0xe4, 0xdb, 0x2d, 0x88, 0xa0, 0x7a,
193*e0c4386eSCy Schubert     0xf2, 0x17, 0xa7, 0xdd, 0x13, 0x44, 0x9f, 0x5f, 0x6b, 0x2c, 0x42, 0x42,
194*e0c4386eSCy Schubert     0x8b, 0x13, 0x4d, 0xf9, 0x5b, 0xf8, 0x33, 0x42, 0xd9, 0x9e, 0x50, 0x1c,
195*e0c4386eSCy Schubert     0x7c, 0xbc, 0xfa, 0x62, 0x85, 0x0b, 0xcf, 0x99, 0xda, 0x9e, 0x04, 0x90,
196*e0c4386eSCy Schubert     0xb2, 0xc6, 0xb2, 0x0a, 0x2a, 0x7c, 0x6d, 0x6a, 0x40, 0xfc, 0xf5, 0x50,
197*e0c4386eSCy Schubert     0x98, 0x46, 0x89, 0x82, 0x40,
198*e0c4386eSCy Schubert };
199*e0c4386eSCy Schubert #endif
200*e0c4386eSCy Schubert 
201*e0c4386eSCy Schubert #ifndef OPENSSL_NO_EC
202*e0c4386eSCy Schubert # ifndef OPENSSL_NO_DEPRECATED_3_0
203*e0c4386eSCy Schubert /*
204*e0c4386eSCy Schubert  *  -----BEGIN EC PRIVATE KEY-----
205*e0c4386eSCy Schubert  *  MHcCAQEEIJLyl7hJjpQL/RhP1x2zS79xdiPJQB683gWeqcqHPeZkoAoGCCqGSM49
206*e0c4386eSCy Schubert  *  AwEHoUQDQgAEdsjygVYjjaKBF4CNECVllNf017p5/MxNSWDoTHy9I2GeDwEDDazI
207*e0c4386eSCy Schubert  *  D/xy8JiYjtPKVE/Zqwbmivp2UwtH28a7NQ==
208*e0c4386eSCy Schubert  *  -----END EC PRIVATE KEY-----
209*e0c4386eSCy Schubert  */
210*e0c4386eSCy Schubert static const char ECDSAPrivateKeyPEM[] = {
211*e0c4386eSCy Schubert     0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x45,
212*e0c4386eSCy Schubert     0x43, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b, 0x45,
213*e0c4386eSCy Schubert     0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x48, 0x63, 0x43, 0x41,
214*e0c4386eSCy Schubert     0x51, 0x45, 0x45, 0x49, 0x4a, 0x4c, 0x79, 0x6c, 0x37, 0x68, 0x4a, 0x6a,
215*e0c4386eSCy Schubert     0x70, 0x51, 0x4c, 0x2f, 0x52, 0x68, 0x50, 0x31, 0x78, 0x32, 0x7a, 0x53,
216*e0c4386eSCy Schubert     0x37, 0x39, 0x78, 0x64, 0x69, 0x50, 0x4a, 0x51, 0x42, 0x36, 0x38, 0x33,
217*e0c4386eSCy Schubert     0x67, 0x57, 0x65, 0x71, 0x63, 0x71, 0x48, 0x50, 0x65, 0x5a, 0x6b, 0x6f,
218*e0c4386eSCy Schubert     0x41, 0x6f, 0x47, 0x43, 0x43, 0x71, 0x47, 0x53, 0x4d, 0x34, 0x39, 0x0a,
219*e0c4386eSCy Schubert     0x41, 0x77, 0x45, 0x48, 0x6f, 0x55, 0x51, 0x44, 0x51, 0x67, 0x41, 0x45,
220*e0c4386eSCy Schubert     0x64, 0x73, 0x6a, 0x79, 0x67, 0x56, 0x59, 0x6a, 0x6a, 0x61, 0x4b, 0x42,
221*e0c4386eSCy Schubert     0x46, 0x34, 0x43, 0x4e, 0x45, 0x43, 0x56, 0x6c, 0x6c, 0x4e, 0x66, 0x30,
222*e0c4386eSCy Schubert     0x31, 0x37, 0x70, 0x35, 0x2f, 0x4d, 0x78, 0x4e, 0x53, 0x57, 0x44, 0x6f,
223*e0c4386eSCy Schubert     0x54, 0x48, 0x79, 0x39, 0x49, 0x32, 0x47, 0x65, 0x44, 0x77, 0x45, 0x44,
224*e0c4386eSCy Schubert     0x44, 0x61, 0x7a, 0x49, 0x0a, 0x44, 0x2f, 0x78, 0x79, 0x38, 0x4a, 0x69,
225*e0c4386eSCy Schubert     0x59, 0x6a, 0x74, 0x50, 0x4b, 0x56, 0x45, 0x2f, 0x5a, 0x71, 0x77, 0x62,
226*e0c4386eSCy Schubert     0x6d, 0x69, 0x76, 0x70, 0x32, 0x55, 0x77, 0x74, 0x48, 0x32, 0x38, 0x61,
227*e0c4386eSCy Schubert     0x37, 0x4e, 0x51, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45,
228*e0c4386eSCy Schubert     0x4e, 0x44, 0x20, 0x45, 0x43, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54,
229*e0c4386eSCy Schubert     0x45, 0x20, 0x4b, 0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a
230*e0c4386eSCy Schubert };
231*e0c4386eSCy Schubert # endif
232*e0c4386eSCy Schubert 
233*e0c4386eSCy Schubert /*
234*e0c4386eSCy Schubert  * -----BEGIN CERTIFICATE-----
235*e0c4386eSCy Schubert  *  MIIBXzCCAQagAwIBAgIJAK6/Yvf/ain6MAoGCCqGSM49BAMCMBIxEDAOBgNVBAoM
236*e0c4386eSCy Schubert  *  B0FjbWUgQ28wHhcNMTYxMjI1MTEzOTI3WhcNMjYxMjI1MTEzOTI3WjASMRAwDgYD
237*e0c4386eSCy Schubert  *  VQQKDAdBY21lIENvMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEdsjygVYjjaKB
238*e0c4386eSCy Schubert  *  F4CNECVllNf017p5/MxNSWDoTHy9I2GeDwEDDazID/xy8JiYjtPKVE/Zqwbmivp2
239*e0c4386eSCy Schubert  *  UwtH28a7NaNFMEMwCQYDVR0TBAIwADALBgNVHQ8EBAMCBaAwEwYDVR0lBAwwCgYI
240*e0c4386eSCy Schubert  *  KwYBBQUHAwEwFAYDVR0RBA0wC4IJbG9jYWxob3N0MAoGCCqGSM49BAMCA0cAMEQC
241*e0c4386eSCy Schubert  *  IEzr3t/jejVE9oSnBp8c3P2p+lDLVRrB8zxLyjZvirUXAiAyQPaE9MNcL8/nRpuu
242*e0c4386eSCy Schubert  *  99I1enCSmWIAJ57IwuJ/n1d45Q==
243*e0c4386eSCy Schubert  *  -----END CERTIFICATE-----
244*e0c4386eSCy Schubert  */
245*e0c4386eSCy Schubert static const char ECDSACertPEM[] = {
246*e0c4386eSCy Schubert     0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
247*e0c4386eSCy Schubert     0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
248*e0c4386eSCy Schubert     0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x42, 0x58, 0x7a, 0x43, 0x43,
249*e0c4386eSCy Schubert     0x41, 0x51, 0x61, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x4a,
250*e0c4386eSCy Schubert     0x41, 0x4b, 0x36, 0x2f, 0x59, 0x76, 0x66, 0x2f, 0x61, 0x69, 0x6e, 0x36,
251*e0c4386eSCy Schubert     0x4d, 0x41, 0x6f, 0x47, 0x43, 0x43, 0x71, 0x47, 0x53, 0x4d, 0x34, 0x39,
252*e0c4386eSCy Schubert     0x42, 0x41, 0x4d, 0x43, 0x4d, 0x42, 0x49, 0x78, 0x45, 0x44, 0x41, 0x4f,
253*e0c4386eSCy Schubert     0x42, 0x67, 0x4e, 0x56, 0x42, 0x41, 0x6f, 0x4d, 0x0a, 0x42, 0x30, 0x46,
254*e0c4386eSCy Schubert     0x6a, 0x62, 0x57, 0x55, 0x67, 0x51, 0x32, 0x38, 0x77, 0x48, 0x68, 0x63,
255*e0c4386eSCy Schubert     0x4e, 0x4d, 0x54, 0x59, 0x78, 0x4d, 0x6a, 0x49, 0x31, 0x4d, 0x54, 0x45,
256*e0c4386eSCy Schubert     0x7a, 0x4f, 0x54, 0x49, 0x33, 0x57, 0x68, 0x63, 0x4e, 0x4d, 0x6a, 0x59,
257*e0c4386eSCy Schubert     0x78, 0x4d, 0x6a, 0x49, 0x31, 0x4d, 0x54, 0x45, 0x7a, 0x4f, 0x54, 0x49,
258*e0c4386eSCy Schubert     0x33, 0x57, 0x6a, 0x41, 0x53, 0x4d, 0x52, 0x41, 0x77, 0x44, 0x67, 0x59,
259*e0c4386eSCy Schubert     0x44, 0x0a, 0x56, 0x51, 0x51, 0x4b, 0x44, 0x41, 0x64, 0x42, 0x59, 0x32,
260*e0c4386eSCy Schubert     0x31, 0x6c, 0x49, 0x45, 0x4e, 0x76, 0x4d, 0x46, 0x6b, 0x77, 0x45, 0x77,
261*e0c4386eSCy Schubert     0x59, 0x48, 0x4b, 0x6f, 0x5a, 0x49, 0x7a, 0x6a, 0x30, 0x43, 0x41, 0x51,
262*e0c4386eSCy Schubert     0x59, 0x49, 0x4b, 0x6f, 0x5a, 0x49, 0x7a, 0x6a, 0x30, 0x44, 0x41, 0x51,
263*e0c4386eSCy Schubert     0x63, 0x44, 0x51, 0x67, 0x41, 0x45, 0x64, 0x73, 0x6a, 0x79, 0x67, 0x56,
264*e0c4386eSCy Schubert     0x59, 0x6a, 0x6a, 0x61, 0x4b, 0x42, 0x0a, 0x46, 0x34, 0x43, 0x4e, 0x45,
265*e0c4386eSCy Schubert     0x43, 0x56, 0x6c, 0x6c, 0x4e, 0x66, 0x30, 0x31, 0x37, 0x70, 0x35, 0x2f,
266*e0c4386eSCy Schubert     0x4d, 0x78, 0x4e, 0x53, 0x57, 0x44, 0x6f, 0x54, 0x48, 0x79, 0x39, 0x49,
267*e0c4386eSCy Schubert     0x32, 0x47, 0x65, 0x44, 0x77, 0x45, 0x44, 0x44, 0x61, 0x7a, 0x49, 0x44,
268*e0c4386eSCy Schubert     0x2f, 0x78, 0x79, 0x38, 0x4a, 0x69, 0x59, 0x6a, 0x74, 0x50, 0x4b, 0x56,
269*e0c4386eSCy Schubert     0x45, 0x2f, 0x5a, 0x71, 0x77, 0x62, 0x6d, 0x69, 0x76, 0x70, 0x32, 0x0a,
270*e0c4386eSCy Schubert     0x55, 0x77, 0x74, 0x48, 0x32, 0x38, 0x61, 0x37, 0x4e, 0x61, 0x4e, 0x46,
271*e0c4386eSCy Schubert     0x4d, 0x45, 0x4d, 0x77, 0x43, 0x51, 0x59, 0x44, 0x56, 0x52, 0x30, 0x54,
272*e0c4386eSCy Schubert     0x42, 0x41, 0x49, 0x77, 0x41, 0x44, 0x41, 0x4c, 0x42, 0x67, 0x4e, 0x56,
273*e0c4386eSCy Schubert     0x48, 0x51, 0x38, 0x45, 0x42, 0x41, 0x4d, 0x43, 0x42, 0x61, 0x41, 0x77,
274*e0c4386eSCy Schubert     0x45, 0x77, 0x59, 0x44, 0x56, 0x52, 0x30, 0x6c, 0x42, 0x41, 0x77, 0x77,
275*e0c4386eSCy Schubert     0x43, 0x67, 0x59, 0x49, 0x0a, 0x4b, 0x77, 0x59, 0x42, 0x42, 0x51, 0x55,
276*e0c4386eSCy Schubert     0x48, 0x41, 0x77, 0x45, 0x77, 0x46, 0x41, 0x59, 0x44, 0x56, 0x52, 0x30,
277*e0c4386eSCy Schubert     0x52, 0x42, 0x41, 0x30, 0x77, 0x43, 0x34, 0x49, 0x4a, 0x62, 0x47, 0x39,
278*e0c4386eSCy Schubert     0x6a, 0x59, 0x57, 0x78, 0x6f, 0x62, 0x33, 0x4e, 0x30, 0x4d, 0x41, 0x6f,
279*e0c4386eSCy Schubert     0x47, 0x43, 0x43, 0x71, 0x47, 0x53, 0x4d, 0x34, 0x39, 0x42, 0x41, 0x4d,
280*e0c4386eSCy Schubert     0x43, 0x41, 0x30, 0x63, 0x41, 0x4d, 0x45, 0x51, 0x43, 0x0a, 0x49, 0x45,
281*e0c4386eSCy Schubert     0x7a, 0x72, 0x33, 0x74, 0x2f, 0x6a, 0x65, 0x6a, 0x56, 0x45, 0x39, 0x6f,
282*e0c4386eSCy Schubert     0x53, 0x6e, 0x42, 0x70, 0x38, 0x63, 0x33, 0x50, 0x32, 0x70, 0x2b, 0x6c,
283*e0c4386eSCy Schubert     0x44, 0x4c, 0x56, 0x52, 0x72, 0x42, 0x38, 0x7a, 0x78, 0x4c, 0x79, 0x6a,
284*e0c4386eSCy Schubert     0x5a, 0x76, 0x69, 0x72, 0x55, 0x58, 0x41, 0x69, 0x41, 0x79, 0x51, 0x50,
285*e0c4386eSCy Schubert     0x61, 0x45, 0x39, 0x4d, 0x4e, 0x63, 0x4c, 0x38, 0x2f, 0x6e, 0x52, 0x70,
286*e0c4386eSCy Schubert     0x75, 0x75, 0x0a, 0x39, 0x39, 0x49, 0x31, 0x65, 0x6e, 0x43, 0x53, 0x6d,
287*e0c4386eSCy Schubert     0x57, 0x49, 0x41, 0x4a, 0x35, 0x37, 0x49, 0x77, 0x75, 0x4a, 0x2f, 0x6e,
288*e0c4386eSCy Schubert     0x31, 0x64, 0x34, 0x35, 0x51, 0x3d, 0x3d, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d,
289*e0c4386eSCy Schubert     0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49,
290*e0c4386eSCy Schubert     0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a
291*e0c4386eSCy Schubert };
292*e0c4386eSCy Schubert #endif
293*e0c4386eSCy Schubert 
294*e0c4386eSCy Schubert #if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
295*e0c4386eSCy Schubert /*
296*e0c4386eSCy Schubert  * -----BEGIN DSA PRIVATE KEY-----
297*e0c4386eSCy Schubert  * MIIBuwIBAAKBgQDdkFKzNABLOha7Eqj7004+p5fhtR6bxpujToMmSZTYi8igVVXP
298*e0c4386eSCy Schubert  * Wzf03ULKS5UKjA6WpR6EiZAhm+PdxusZ5xfAuRZLdKy0bgxn1f348Rwh+EQNaEM8
299*e0c4386eSCy Schubert  * 0TGcnw5ijwKmSw5yyHPDWdiHzoqEBlhAf8Nl22YTXax/clsc/pu/RRLAdwIVAIEg
300*e0c4386eSCy Schubert  * QqWRf/1EIZZcgM65Qpd65YuxAoGBAKBauV/RuloFHoSy5iWXESDywiS380tN5974
301*e0c4386eSCy Schubert  * GukGwoYdZo5uSIH6ahpeNSef0MbHGAzr7ZVEnhCQfRAwH1gRvSHoq/Rbmcvtd3r+
302*e0c4386eSCy Schubert  * QtQHOwvQHgLAynhI4i73c794czHaR+439bmcaSwDnQduRM85Mho/jiiZzAVPxBmG
303*e0c4386eSCy Schubert  * POIMWNXXAoGAI6Ep5IE7yn3JzkXO9B6tC3bbDM+ZzuuInwZLbtZ8lim7Dsqabg4k
304*e0c4386eSCy Schubert  * 2YbE4R95Bnfwnjsyl80mq/DbQN5lAHBvjDrkC6ItojBGKI3+iIrqGUEJdxvl4ulj
305*e0c4386eSCy Schubert  * F0PmSD7zvIG8BfocKOel+EHH0YryExiW6krV1KW2ZRmJrqSFw6KCjV0CFFQFbPfU
306*e0c4386eSCy Schubert  * xy5PmKytJmXR8BmppkIO
307*e0c4386eSCy Schubert  * -----END DSA PRIVATE KEY-----
308*e0c4386eSCy Schubert  */
309*e0c4386eSCy Schubert static const char DSAPrivateKeyPEM[] = {
310*e0c4386eSCy Schubert     0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x44,
311*e0c4386eSCy Schubert     0x53, 0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b,
312*e0c4386eSCy Schubert     0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x42,
313*e0c4386eSCy Schubert     0x75, 0x77, 0x49, 0x42, 0x41, 0x41, 0x4b, 0x42, 0x67, 0x51, 0x44, 0x64,
314*e0c4386eSCy Schubert     0x6b, 0x46, 0x4b, 0x7a, 0x4e, 0x41, 0x42, 0x4c, 0x4f, 0x68, 0x61, 0x37,
315*e0c4386eSCy Schubert     0x45, 0x71, 0x6a, 0x37, 0x30, 0x30, 0x34, 0x2b, 0x70, 0x35, 0x66, 0x68,
316*e0c4386eSCy Schubert     0x74, 0x52, 0x36, 0x62, 0x78, 0x70, 0x75, 0x6a, 0x54, 0x6f, 0x4d, 0x6d,
317*e0c4386eSCy Schubert     0x53, 0x5a, 0x54, 0x59, 0x69, 0x38, 0x69, 0x67, 0x56, 0x56, 0x58, 0x50,
318*e0c4386eSCy Schubert     0x0a, 0x57, 0x7a, 0x66, 0x30, 0x33, 0x55, 0x4c, 0x4b, 0x53, 0x35, 0x55,
319*e0c4386eSCy Schubert     0x4b, 0x6a, 0x41, 0x36, 0x57, 0x70, 0x52, 0x36, 0x45, 0x69, 0x5a, 0x41,
320*e0c4386eSCy Schubert     0x68, 0x6d, 0x2b, 0x50, 0x64, 0x78, 0x75, 0x73, 0x5a, 0x35, 0x78, 0x66,
321*e0c4386eSCy Schubert     0x41, 0x75, 0x52, 0x5a, 0x4c, 0x64, 0x4b, 0x79, 0x30, 0x62, 0x67, 0x78,
322*e0c4386eSCy Schubert     0x6e, 0x31, 0x66, 0x33, 0x34, 0x38, 0x52, 0x77, 0x68, 0x2b, 0x45, 0x51,
323*e0c4386eSCy Schubert     0x4e, 0x61, 0x45, 0x4d, 0x38, 0x0a, 0x30, 0x54, 0x47, 0x63, 0x6e, 0x77,
324*e0c4386eSCy Schubert     0x35, 0x69, 0x6a, 0x77, 0x4b, 0x6d, 0x53, 0x77, 0x35, 0x79, 0x79, 0x48,
325*e0c4386eSCy Schubert     0x50, 0x44, 0x57, 0x64, 0x69, 0x48, 0x7a, 0x6f, 0x71, 0x45, 0x42, 0x6c,
326*e0c4386eSCy Schubert     0x68, 0x41, 0x66, 0x38, 0x4e, 0x6c, 0x32, 0x32, 0x59, 0x54, 0x58, 0x61,
327*e0c4386eSCy Schubert     0x78, 0x2f, 0x63, 0x6c, 0x73, 0x63, 0x2f, 0x70, 0x75, 0x2f, 0x52, 0x52,
328*e0c4386eSCy Schubert     0x4c, 0x41, 0x64, 0x77, 0x49, 0x56, 0x41, 0x49, 0x45, 0x67, 0x0a, 0x51,
329*e0c4386eSCy Schubert     0x71, 0x57, 0x52, 0x66, 0x2f, 0x31, 0x45, 0x49, 0x5a, 0x5a, 0x63, 0x67,
330*e0c4386eSCy Schubert     0x4d, 0x36, 0x35, 0x51, 0x70, 0x64, 0x36, 0x35, 0x59, 0x75, 0x78, 0x41,
331*e0c4386eSCy Schubert     0x6f, 0x47, 0x42, 0x41, 0x4b, 0x42, 0x61, 0x75, 0x56, 0x2f, 0x52, 0x75,
332*e0c4386eSCy Schubert     0x6c, 0x6f, 0x46, 0x48, 0x6f, 0x53, 0x79, 0x35, 0x69, 0x57, 0x58, 0x45,
333*e0c4386eSCy Schubert     0x53, 0x44, 0x79, 0x77, 0x69, 0x53, 0x33, 0x38, 0x30, 0x74, 0x4e, 0x35,
334*e0c4386eSCy Schubert     0x39, 0x37, 0x34, 0x0a, 0x47, 0x75, 0x6b, 0x47, 0x77, 0x6f, 0x59, 0x64,
335*e0c4386eSCy Schubert     0x5a, 0x6f, 0x35, 0x75, 0x53, 0x49, 0x48, 0x36, 0x61, 0x68, 0x70, 0x65,
336*e0c4386eSCy Schubert     0x4e, 0x53, 0x65, 0x66, 0x30, 0x4d, 0x62, 0x48, 0x47, 0x41, 0x7a, 0x72,
337*e0c4386eSCy Schubert     0x37, 0x5a, 0x56, 0x45, 0x6e, 0x68, 0x43, 0x51, 0x66, 0x52, 0x41, 0x77,
338*e0c4386eSCy Schubert     0x48, 0x31, 0x67, 0x52, 0x76, 0x53, 0x48, 0x6f, 0x71, 0x2f, 0x52, 0x62,
339*e0c4386eSCy Schubert     0x6d, 0x63, 0x76, 0x74, 0x64, 0x33, 0x72, 0x2b, 0x0a, 0x51, 0x74, 0x51,
340*e0c4386eSCy Schubert     0x48, 0x4f, 0x77, 0x76, 0x51, 0x48, 0x67, 0x4c, 0x41, 0x79, 0x6e, 0x68,
341*e0c4386eSCy Schubert     0x49, 0x34, 0x69, 0x37, 0x33, 0x63, 0x37, 0x39, 0x34, 0x63, 0x7a, 0x48,
342*e0c4386eSCy Schubert     0x61, 0x52, 0x2b, 0x34, 0x33, 0x39, 0x62, 0x6d, 0x63, 0x61, 0x53, 0x77,
343*e0c4386eSCy Schubert     0x44, 0x6e, 0x51, 0x64, 0x75, 0x52, 0x4d, 0x38, 0x35, 0x4d, 0x68, 0x6f,
344*e0c4386eSCy Schubert     0x2f, 0x6a, 0x69, 0x69, 0x5a, 0x7a, 0x41, 0x56, 0x50, 0x78, 0x42, 0x6d,
345*e0c4386eSCy Schubert     0x47, 0x0a, 0x50, 0x4f, 0x49, 0x4d, 0x57, 0x4e, 0x58, 0x58, 0x41, 0x6f,
346*e0c4386eSCy Schubert     0x47, 0x41, 0x49, 0x36, 0x45, 0x70, 0x35, 0x49, 0x45, 0x37, 0x79, 0x6e,
347*e0c4386eSCy Schubert     0x33, 0x4a, 0x7a, 0x6b, 0x58, 0x4f, 0x39, 0x42, 0x36, 0x74, 0x43, 0x33,
348*e0c4386eSCy Schubert     0x62, 0x62, 0x44, 0x4d, 0x2b, 0x5a, 0x7a, 0x75, 0x75, 0x49, 0x6e, 0x77,
349*e0c4386eSCy Schubert     0x5a, 0x4c, 0x62, 0x74, 0x5a, 0x38, 0x6c, 0x69, 0x6d, 0x37, 0x44, 0x73,
350*e0c4386eSCy Schubert     0x71, 0x61, 0x62, 0x67, 0x34, 0x6b, 0x0a, 0x32, 0x59, 0x62, 0x45, 0x34,
351*e0c4386eSCy Schubert     0x52, 0x39, 0x35, 0x42, 0x6e, 0x66, 0x77, 0x6e, 0x6a, 0x73, 0x79, 0x6c,
352*e0c4386eSCy Schubert     0x38, 0x30, 0x6d, 0x71, 0x2f, 0x44, 0x62, 0x51, 0x4e, 0x35, 0x6c, 0x41,
353*e0c4386eSCy Schubert     0x48, 0x42, 0x76, 0x6a, 0x44, 0x72, 0x6b, 0x43, 0x36, 0x49, 0x74, 0x6f,
354*e0c4386eSCy Schubert     0x6a, 0x42, 0x47, 0x4b, 0x49, 0x33, 0x2b, 0x69, 0x49, 0x72, 0x71, 0x47,
355*e0c4386eSCy Schubert     0x55, 0x45, 0x4a, 0x64, 0x78, 0x76, 0x6c, 0x34, 0x75, 0x6c, 0x6a, 0x0a,
356*e0c4386eSCy Schubert     0x46, 0x30, 0x50, 0x6d, 0x53, 0x44, 0x37, 0x7a, 0x76, 0x49, 0x47, 0x38,
357*e0c4386eSCy Schubert     0x42, 0x66, 0x6f, 0x63, 0x4b, 0x4f, 0x65, 0x6c, 0x2b, 0x45, 0x48, 0x48,
358*e0c4386eSCy Schubert     0x30, 0x59, 0x72, 0x79, 0x45, 0x78, 0x69, 0x57, 0x36, 0x6b, 0x72, 0x56,
359*e0c4386eSCy Schubert     0x31, 0x4b, 0x57, 0x32, 0x5a, 0x52, 0x6d, 0x4a, 0x72, 0x71, 0x53, 0x46,
360*e0c4386eSCy Schubert     0x77, 0x36, 0x4b, 0x43, 0x6a, 0x56, 0x30, 0x43, 0x46, 0x46, 0x51, 0x46,
361*e0c4386eSCy Schubert     0x62, 0x50, 0x66, 0x55, 0x0a, 0x78, 0x79, 0x35, 0x50, 0x6d, 0x4b, 0x79,
362*e0c4386eSCy Schubert     0x74, 0x4a, 0x6d, 0x58, 0x52, 0x38, 0x42, 0x6d, 0x70, 0x70, 0x6b, 0x49,
363*e0c4386eSCy Schubert     0x4f, 0x0a, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x44,
364*e0c4386eSCy Schubert     0x53, 0x41, 0x20, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x20, 0x4b,
365*e0c4386eSCy Schubert     0x45, 0x59, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x0a
366*e0c4386eSCy Schubert };
367*e0c4386eSCy Schubert 
368*e0c4386eSCy Schubert /*
369*e0c4386eSCy Schubert  * -----BEGIN CERTIFICATE-----
370*e0c4386eSCy Schubert  * MIICqTCCAmegAwIBAgIJAILDGUk37fWGMAsGCWCGSAFlAwQDAjASMRAwDgYDVQQK
371*e0c4386eSCy Schubert  * DAdBY21lIENvMB4XDTE2MTIyNTEzMjUzNloXDTI2MTIyNTEzMjUzNlowEjEQMA4G
372*e0c4386eSCy Schubert  * A1UECgwHQWNtZSBDbzCCAbcwggEsBgcqhkjOOAQBMIIBHwKBgQDdkFKzNABLOha7
373*e0c4386eSCy Schubert  * Eqj7004+p5fhtR6bxpujToMmSZTYi8igVVXPWzf03ULKS5UKjA6WpR6EiZAhm+Pd
374*e0c4386eSCy Schubert  * xusZ5xfAuRZLdKy0bgxn1f348Rwh+EQNaEM80TGcnw5ijwKmSw5yyHPDWdiHzoqE
375*e0c4386eSCy Schubert  * BlhAf8Nl22YTXax/clsc/pu/RRLAdwIVAIEgQqWRf/1EIZZcgM65Qpd65YuxAoGB
376*e0c4386eSCy Schubert  * AKBauV/RuloFHoSy5iWXESDywiS380tN5974GukGwoYdZo5uSIH6ahpeNSef0MbH
377*e0c4386eSCy Schubert  * GAzr7ZVEnhCQfRAwH1gRvSHoq/Rbmcvtd3r+QtQHOwvQHgLAynhI4i73c794czHa
378*e0c4386eSCy Schubert  * R+439bmcaSwDnQduRM85Mho/jiiZzAVPxBmGPOIMWNXXA4GEAAKBgCOhKeSBO8p9
379*e0c4386eSCy Schubert  * yc5FzvQerQt22wzPmc7riJ8GS27WfJYpuw7Kmm4OJNmGxOEfeQZ38J47MpfNJqvw
380*e0c4386eSCy Schubert  * 20DeZQBwb4w65AuiLaIwRiiN/oiK6hlBCXcb5eLpYxdD5kg+87yBvAX6HCjnpfhB
381*e0c4386eSCy Schubert  * x9GK8hMYlupK1dSltmUZia6khcOigo1do0UwQzAJBgNVHRMEAjAAMAsGA1UdDwQE
382*e0c4386eSCy Schubert  * AwIFoDATBgNVHSUEDDAKBggrBgEFBQcDATAUBgNVHREEDTALgglsb2NhbGhvc3Qw
383*e0c4386eSCy Schubert  * CwYJYIZIAWUDBAMCAy8AMCwCFClxInXTRWNJEWdi5ilNr/fbM1bKAhQy4B7wtmfd
384*e0c4386eSCy Schubert  * I+zV6g3w9qBkNqStpA==
385*e0c4386eSCy Schubert  * -----END CERTIFICATE-----
386*e0c4386eSCy Schubert  */
387*e0c4386eSCy Schubert static const char DSACertPEM[] = {
388*e0c4386eSCy Schubert     0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e, 0x20, 0x43,
389*e0c4386eSCy Schubert     0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d,
390*e0c4386eSCy Schubert     0x2d, 0x2d, 0x2d, 0x0a, 0x4d, 0x49, 0x49, 0x43, 0x71, 0x54, 0x43, 0x43,
391*e0c4386eSCy Schubert     0x41, 0x6d, 0x65, 0x67, 0x41, 0x77, 0x49, 0x42, 0x41, 0x67, 0x49, 0x4a,
392*e0c4386eSCy Schubert     0x41, 0x49, 0x4c, 0x44, 0x47, 0x55, 0x6b, 0x33, 0x37, 0x66, 0x57, 0x47,
393*e0c4386eSCy Schubert     0x4d, 0x41, 0x73, 0x47, 0x43, 0x57, 0x43, 0x47, 0x53, 0x41, 0x46, 0x6c,
394*e0c4386eSCy Schubert     0x41, 0x77, 0x51, 0x44, 0x41, 0x6a, 0x41, 0x53, 0x4d, 0x52, 0x41, 0x77,
395*e0c4386eSCy Schubert     0x44, 0x67, 0x59, 0x44, 0x56, 0x51, 0x51, 0x4b, 0x0a, 0x44, 0x41, 0x64,
396*e0c4386eSCy Schubert     0x42, 0x59, 0x32, 0x31, 0x6c, 0x49, 0x45, 0x4e, 0x76, 0x4d, 0x42, 0x34,
397*e0c4386eSCy Schubert     0x58, 0x44, 0x54, 0x45, 0x32, 0x4d, 0x54, 0x49, 0x79, 0x4e, 0x54, 0x45,
398*e0c4386eSCy Schubert     0x7a, 0x4d, 0x6a, 0x55, 0x7a, 0x4e, 0x6c, 0x6f, 0x58, 0x44, 0x54, 0x49,
399*e0c4386eSCy Schubert     0x32, 0x4d, 0x54, 0x49, 0x79, 0x4e, 0x54, 0x45, 0x7a, 0x4d, 0x6a, 0x55,
400*e0c4386eSCy Schubert     0x7a, 0x4e, 0x6c, 0x6f, 0x77, 0x45, 0x6a, 0x45, 0x51, 0x4d, 0x41, 0x34,
401*e0c4386eSCy Schubert     0x47, 0x0a, 0x41, 0x31, 0x55, 0x45, 0x43, 0x67, 0x77, 0x48, 0x51, 0x57,
402*e0c4386eSCy Schubert     0x4e, 0x74, 0x5a, 0x53, 0x42, 0x44, 0x62, 0x7a, 0x43, 0x43, 0x41, 0x62,
403*e0c4386eSCy Schubert     0x63, 0x77, 0x67, 0x67, 0x45, 0x73, 0x42, 0x67, 0x63, 0x71, 0x68, 0x6b,
404*e0c4386eSCy Schubert     0x6a, 0x4f, 0x4f, 0x41, 0x51, 0x42, 0x4d, 0x49, 0x49, 0x42, 0x48, 0x77,
405*e0c4386eSCy Schubert     0x4b, 0x42, 0x67, 0x51, 0x44, 0x64, 0x6b, 0x46, 0x4b, 0x7a, 0x4e, 0x41,
406*e0c4386eSCy Schubert     0x42, 0x4c, 0x4f, 0x68, 0x61, 0x37, 0x0a, 0x45, 0x71, 0x6a, 0x37, 0x30,
407*e0c4386eSCy Schubert     0x30, 0x34, 0x2b, 0x70, 0x35, 0x66, 0x68, 0x74, 0x52, 0x36, 0x62, 0x78,
408*e0c4386eSCy Schubert     0x70, 0x75, 0x6a, 0x54, 0x6f, 0x4d, 0x6d, 0x53, 0x5a, 0x54, 0x59, 0x69,
409*e0c4386eSCy Schubert     0x38, 0x69, 0x67, 0x56, 0x56, 0x58, 0x50, 0x57, 0x7a, 0x66, 0x30, 0x33,
410*e0c4386eSCy Schubert     0x55, 0x4c, 0x4b, 0x53, 0x35, 0x55, 0x4b, 0x6a, 0x41, 0x36, 0x57, 0x70,
411*e0c4386eSCy Schubert     0x52, 0x36, 0x45, 0x69, 0x5a, 0x41, 0x68, 0x6d, 0x2b, 0x50, 0x64, 0x0a,
412*e0c4386eSCy Schubert     0x78, 0x75, 0x73, 0x5a, 0x35, 0x78, 0x66, 0x41, 0x75, 0x52, 0x5a, 0x4c,
413*e0c4386eSCy Schubert     0x64, 0x4b, 0x79, 0x30, 0x62, 0x67, 0x78, 0x6e, 0x31, 0x66, 0x33, 0x34,
414*e0c4386eSCy Schubert     0x38, 0x52, 0x77, 0x68, 0x2b, 0x45, 0x51, 0x4e, 0x61, 0x45, 0x4d, 0x38,
415*e0c4386eSCy Schubert     0x30, 0x54, 0x47, 0x63, 0x6e, 0x77, 0x35, 0x69, 0x6a, 0x77, 0x4b, 0x6d,
416*e0c4386eSCy Schubert     0x53, 0x77, 0x35, 0x79, 0x79, 0x48, 0x50, 0x44, 0x57, 0x64, 0x69, 0x48,
417*e0c4386eSCy Schubert     0x7a, 0x6f, 0x71, 0x45, 0x0a, 0x42, 0x6c, 0x68, 0x41, 0x66, 0x38, 0x4e,
418*e0c4386eSCy Schubert     0x6c, 0x32, 0x32, 0x59, 0x54, 0x58, 0x61, 0x78, 0x2f, 0x63, 0x6c, 0x73,
419*e0c4386eSCy Schubert     0x63, 0x2f, 0x70, 0x75, 0x2f, 0x52, 0x52, 0x4c, 0x41, 0x64, 0x77, 0x49,
420*e0c4386eSCy Schubert     0x56, 0x41, 0x49, 0x45, 0x67, 0x51, 0x71, 0x57, 0x52, 0x66, 0x2f, 0x31,
421*e0c4386eSCy Schubert     0x45, 0x49, 0x5a, 0x5a, 0x63, 0x67, 0x4d, 0x36, 0x35, 0x51, 0x70, 0x64,
422*e0c4386eSCy Schubert     0x36, 0x35, 0x59, 0x75, 0x78, 0x41, 0x6f, 0x47, 0x42, 0x0a, 0x41, 0x4b,
423*e0c4386eSCy Schubert     0x42, 0x61, 0x75, 0x56, 0x2f, 0x52, 0x75, 0x6c, 0x6f, 0x46, 0x48, 0x6f,
424*e0c4386eSCy Schubert     0x53, 0x79, 0x35, 0x69, 0x57, 0x58, 0x45, 0x53, 0x44, 0x79, 0x77, 0x69,
425*e0c4386eSCy Schubert     0x53, 0x33, 0x38, 0x30, 0x74, 0x4e, 0x35, 0x39, 0x37, 0x34, 0x47, 0x75,
426*e0c4386eSCy Schubert     0x6b, 0x47, 0x77, 0x6f, 0x59, 0x64, 0x5a, 0x6f, 0x35, 0x75, 0x53, 0x49,
427*e0c4386eSCy Schubert     0x48, 0x36, 0x61, 0x68, 0x70, 0x65, 0x4e, 0x53, 0x65, 0x66, 0x30, 0x4d,
428*e0c4386eSCy Schubert     0x62, 0x48, 0x0a, 0x47, 0x41, 0x7a, 0x72, 0x37, 0x5a, 0x56, 0x45, 0x6e,
429*e0c4386eSCy Schubert     0x68, 0x43, 0x51, 0x66, 0x52, 0x41, 0x77, 0x48, 0x31, 0x67, 0x52, 0x76,
430*e0c4386eSCy Schubert     0x53, 0x48, 0x6f, 0x71, 0x2f, 0x52, 0x62, 0x6d, 0x63, 0x76, 0x74, 0x64,
431*e0c4386eSCy Schubert     0x33, 0x72, 0x2b, 0x51, 0x74, 0x51, 0x48, 0x4f, 0x77, 0x76, 0x51, 0x48,
432*e0c4386eSCy Schubert     0x67, 0x4c, 0x41, 0x79, 0x6e, 0x68, 0x49, 0x34, 0x69, 0x37, 0x33, 0x63,
433*e0c4386eSCy Schubert     0x37, 0x39, 0x34, 0x63, 0x7a, 0x48, 0x61, 0x0a, 0x52, 0x2b, 0x34, 0x33,
434*e0c4386eSCy Schubert     0x39, 0x62, 0x6d, 0x63, 0x61, 0x53, 0x77, 0x44, 0x6e, 0x51, 0x64, 0x75,
435*e0c4386eSCy Schubert     0x52, 0x4d, 0x38, 0x35, 0x4d, 0x68, 0x6f, 0x2f, 0x6a, 0x69, 0x69, 0x5a,
436*e0c4386eSCy Schubert     0x7a, 0x41, 0x56, 0x50, 0x78, 0x42, 0x6d, 0x47, 0x50, 0x4f, 0x49, 0x4d,
437*e0c4386eSCy Schubert     0x57, 0x4e, 0x58, 0x58, 0x41, 0x34, 0x47, 0x45, 0x41, 0x41, 0x4b, 0x42,
438*e0c4386eSCy Schubert     0x67, 0x43, 0x4f, 0x68, 0x4b, 0x65, 0x53, 0x42, 0x4f, 0x38, 0x70, 0x39,
439*e0c4386eSCy Schubert     0x0a, 0x79, 0x63, 0x35, 0x46, 0x7a, 0x76, 0x51, 0x65, 0x72, 0x51, 0x74,
440*e0c4386eSCy Schubert     0x32, 0x32, 0x77, 0x7a, 0x50, 0x6d, 0x63, 0x37, 0x72, 0x69, 0x4a, 0x38,
441*e0c4386eSCy Schubert     0x47, 0x53, 0x32, 0x37, 0x57, 0x66, 0x4a, 0x59, 0x70, 0x75, 0x77, 0x37,
442*e0c4386eSCy Schubert     0x4b, 0x6d, 0x6d, 0x34, 0x4f, 0x4a, 0x4e, 0x6d, 0x47, 0x78, 0x4f, 0x45,
443*e0c4386eSCy Schubert     0x66, 0x65, 0x51, 0x5a, 0x33, 0x38, 0x4a, 0x34, 0x37, 0x4d, 0x70, 0x66,
444*e0c4386eSCy Schubert     0x4e, 0x4a, 0x71, 0x76, 0x77, 0x0a, 0x32, 0x30, 0x44, 0x65, 0x5a, 0x51,
445*e0c4386eSCy Schubert     0x42, 0x77, 0x62, 0x34, 0x77, 0x36, 0x35, 0x41, 0x75, 0x69, 0x4c, 0x61,
446*e0c4386eSCy Schubert     0x49, 0x77, 0x52, 0x69, 0x69, 0x4e, 0x2f, 0x6f, 0x69, 0x4b, 0x36, 0x68,
447*e0c4386eSCy Schubert     0x6c, 0x42, 0x43, 0x58, 0x63, 0x62, 0x35, 0x65, 0x4c, 0x70, 0x59, 0x78,
448*e0c4386eSCy Schubert     0x64, 0x44, 0x35, 0x6b, 0x67, 0x2b, 0x38, 0x37, 0x79, 0x42, 0x76, 0x41,
449*e0c4386eSCy Schubert     0x58, 0x36, 0x48, 0x43, 0x6a, 0x6e, 0x70, 0x66, 0x68, 0x42, 0x0a, 0x78,
450*e0c4386eSCy Schubert     0x39, 0x47, 0x4b, 0x38, 0x68, 0x4d, 0x59, 0x6c, 0x75, 0x70, 0x4b, 0x31,
451*e0c4386eSCy Schubert     0x64, 0x53, 0x6c, 0x74, 0x6d, 0x55, 0x5a, 0x69, 0x61, 0x36, 0x6b, 0x68,
452*e0c4386eSCy Schubert     0x63, 0x4f, 0x69, 0x67, 0x6f, 0x31, 0x64, 0x6f, 0x30, 0x55, 0x77, 0x51,
453*e0c4386eSCy Schubert     0x7a, 0x41, 0x4a, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x4d, 0x45, 0x41,
454*e0c4386eSCy Schubert     0x6a, 0x41, 0x41, 0x4d, 0x41, 0x73, 0x47, 0x41, 0x31, 0x55, 0x64, 0x44,
455*e0c4386eSCy Schubert     0x77, 0x51, 0x45, 0x0a, 0x41, 0x77, 0x49, 0x46, 0x6f, 0x44, 0x41, 0x54,
456*e0c4386eSCy Schubert     0x42, 0x67, 0x4e, 0x56, 0x48, 0x53, 0x55, 0x45, 0x44, 0x44, 0x41, 0x4b,
457*e0c4386eSCy Schubert     0x42, 0x67, 0x67, 0x72, 0x42, 0x67, 0x45, 0x46, 0x42, 0x51, 0x63, 0x44,
458*e0c4386eSCy Schubert     0x41, 0x54, 0x41, 0x55, 0x42, 0x67, 0x4e, 0x56, 0x48, 0x52, 0x45, 0x45,
459*e0c4386eSCy Schubert     0x44, 0x54, 0x41, 0x4c, 0x67, 0x67, 0x6c, 0x73, 0x62, 0x32, 0x4e, 0x68,
460*e0c4386eSCy Schubert     0x62, 0x47, 0x68, 0x76, 0x63, 0x33, 0x51, 0x77, 0x0a, 0x43, 0x77, 0x59,
461*e0c4386eSCy Schubert     0x4a, 0x59, 0x49, 0x5a, 0x49, 0x41, 0x57, 0x55, 0x44, 0x42, 0x41, 0x4d,
462*e0c4386eSCy Schubert     0x43, 0x41, 0x79, 0x38, 0x41, 0x4d, 0x43, 0x77, 0x43, 0x46, 0x43, 0x6c,
463*e0c4386eSCy Schubert     0x78, 0x49, 0x6e, 0x58, 0x54, 0x52, 0x57, 0x4e, 0x4a, 0x45, 0x57, 0x64,
464*e0c4386eSCy Schubert     0x69, 0x35, 0x69, 0x6c, 0x4e, 0x72, 0x2f, 0x66, 0x62, 0x4d, 0x31, 0x62,
465*e0c4386eSCy Schubert     0x4b, 0x41, 0x68, 0x51, 0x79, 0x34, 0x42, 0x37, 0x77, 0x74, 0x6d, 0x66,
466*e0c4386eSCy Schubert     0x64, 0x0a, 0x49, 0x2b, 0x7a, 0x56, 0x36, 0x67, 0x33, 0x77, 0x39, 0x71,
467*e0c4386eSCy Schubert     0x42, 0x6b, 0x4e, 0x71, 0x53, 0x74, 0x70, 0x41, 0x3d, 0x3d, 0x0a, 0x2d,
468*e0c4386eSCy Schubert     0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45, 0x52, 0x54,
469*e0c4386eSCy Schubert     0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d, 0x2d, 0x2d, 0x2d, 0x2d,
470*e0c4386eSCy Schubert     0x0a
471*e0c4386eSCy Schubert };
472*e0c4386eSCy Schubert #endif
473*e0c4386eSCy Schubert 
474*e0c4386eSCy Schubert /* unused, to avoid warning. */
475*e0c4386eSCy Schubert static int idx;
476*e0c4386eSCy Schubert 
477*e0c4386eSCy Schubert #define FUZZTIME 1485898104
478*e0c4386eSCy Schubert 
479*e0c4386eSCy Schubert #define TIME_IMPL(t) { if (t != NULL) *t = FUZZTIME; return FUZZTIME; }
480*e0c4386eSCy Schubert 
481*e0c4386eSCy Schubert /*
482*e0c4386eSCy Schubert  * This might not work in all cases (and definitely not on Windows
483*e0c4386eSCy Schubert  * because of the way linkers are) and callees can still get the
484*e0c4386eSCy Schubert  * current time instead of the fixed time. This will just result
485*e0c4386eSCy Schubert  * in things not being fully reproducible and have a slightly
486*e0c4386eSCy Schubert  * different coverage.
487*e0c4386eSCy Schubert  */
488*e0c4386eSCy Schubert #if !defined(_WIN32)
time(time_t * t)489*e0c4386eSCy Schubert time_t time(time_t *t) TIME_IMPL(t)
490*e0c4386eSCy Schubert #endif
491*e0c4386eSCy Schubert 
492*e0c4386eSCy Schubert int FuzzerInitialize(int *argc, char ***argv)
493*e0c4386eSCy Schubert {
494*e0c4386eSCy Schubert     STACK_OF(SSL_COMP) *comp_methods;
495*e0c4386eSCy Schubert 
496*e0c4386eSCy Schubert     FuzzerSetRand();
497*e0c4386eSCy Schubert     OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CRYPTO_STRINGS | OPENSSL_INIT_ASYNC, NULL);
498*e0c4386eSCy Schubert     OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, NULL);
499*e0c4386eSCy Schubert     ERR_clear_error();
500*e0c4386eSCy Schubert     CRYPTO_free_ex_index(0, -1);
501*e0c4386eSCy Schubert     idx = SSL_get_ex_data_X509_STORE_CTX_idx();
502*e0c4386eSCy Schubert     comp_methods = SSL_COMP_get_compression_methods();
503*e0c4386eSCy Schubert     if (comp_methods != NULL)
504*e0c4386eSCy Schubert         sk_SSL_COMP_sort(comp_methods);
505*e0c4386eSCy Schubert 
506*e0c4386eSCy Schubert     return 1;
507*e0c4386eSCy Schubert }
508*e0c4386eSCy Schubert 
FuzzerTestOneInput(const uint8_t * buf,size_t len)509*e0c4386eSCy Schubert int FuzzerTestOneInput(const uint8_t *buf, size_t len)
510*e0c4386eSCy Schubert {
511*e0c4386eSCy Schubert     SSL *server;
512*e0c4386eSCy Schubert     BIO *in;
513*e0c4386eSCy Schubert     BIO *out;
514*e0c4386eSCy Schubert #if !defined(OPENSSL_NO_EC)                     \
515*e0c4386eSCy Schubert     || (!defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0))
516*e0c4386eSCy Schubert     BIO *bio_buf;
517*e0c4386eSCy Schubert #endif
518*e0c4386eSCy Schubert     SSL_CTX *ctx;
519*e0c4386eSCy Schubert     int ret;
520*e0c4386eSCy Schubert #ifndef OPENSSL_NO_DEPRECATED_3_0
521*e0c4386eSCy Schubert     RSA *privkey;
522*e0c4386eSCy Schubert #endif
523*e0c4386eSCy Schubert     const uint8_t *bufp;
524*e0c4386eSCy Schubert #if !defined(OPENSSL_NO_DEPRECATED_3_0)
525*e0c4386eSCy Schubert     EVP_PKEY *pkey;
526*e0c4386eSCy Schubert #endif
527*e0c4386eSCy Schubert     X509 *cert;
528*e0c4386eSCy Schubert #ifndef OPENSSL_NO_DEPRECATED_3_0
529*e0c4386eSCy Schubert # ifndef OPENSSL_NO_EC
530*e0c4386eSCy Schubert     EC_KEY *ecdsakey = NULL;
531*e0c4386eSCy Schubert # endif
532*e0c4386eSCy Schubert #endif
533*e0c4386eSCy Schubert #if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
534*e0c4386eSCy Schubert     DSA *dsakey = NULL;
535*e0c4386eSCy Schubert #endif
536*e0c4386eSCy Schubert     uint8_t opt;
537*e0c4386eSCy Schubert 
538*e0c4386eSCy Schubert     if (len < 2)
539*e0c4386eSCy Schubert         return 0;
540*e0c4386eSCy Schubert 
541*e0c4386eSCy Schubert     /* This only fuzzes the initial flow from the client so far. */
542*e0c4386eSCy Schubert     ctx = SSL_CTX_new(SSLv23_method());
543*e0c4386eSCy Schubert 
544*e0c4386eSCy Schubert     ret = SSL_CTX_set_min_proto_version(ctx, 0);
545*e0c4386eSCy Schubert     OPENSSL_assert(ret == 1);
546*e0c4386eSCy Schubert     ret = SSL_CTX_set_cipher_list(ctx, "ALL:eNULL:@SECLEVEL=0");
547*e0c4386eSCy Schubert     OPENSSL_assert(ret == 1);
548*e0c4386eSCy Schubert 
549*e0c4386eSCy Schubert #ifndef OPENSSL_NO_DEPRECATED_3_0
550*e0c4386eSCy Schubert     /* RSA */
551*e0c4386eSCy Schubert     bufp = kRSAPrivateKeyDER;
552*e0c4386eSCy Schubert     privkey = d2i_RSAPrivateKey(NULL, &bufp, sizeof(kRSAPrivateKeyDER));
553*e0c4386eSCy Schubert     OPENSSL_assert(privkey != NULL);
554*e0c4386eSCy Schubert     pkey = EVP_PKEY_new();
555*e0c4386eSCy Schubert     EVP_PKEY_assign_RSA(pkey, privkey);
556*e0c4386eSCy Schubert     ret = SSL_CTX_use_PrivateKey(ctx, pkey);
557*e0c4386eSCy Schubert     OPENSSL_assert(ret == 1);
558*e0c4386eSCy Schubert     EVP_PKEY_free(pkey);
559*e0c4386eSCy Schubert #endif
560*e0c4386eSCy Schubert 
561*e0c4386eSCy Schubert     bufp = kCertificateDER;
562*e0c4386eSCy Schubert     cert = d2i_X509(NULL, &bufp, sizeof(kCertificateDER));
563*e0c4386eSCy Schubert     OPENSSL_assert(cert != NULL);
564*e0c4386eSCy Schubert     ret = SSL_CTX_use_certificate(ctx, cert);
565*e0c4386eSCy Schubert     OPENSSL_assert(ret == 1);
566*e0c4386eSCy Schubert     X509_free(cert);
567*e0c4386eSCy Schubert 
568*e0c4386eSCy Schubert #ifndef OPENSSL_NO_EC
569*e0c4386eSCy Schubert # ifndef OPENSSL_NO_DEPRECATED_3_0
570*e0c4386eSCy Schubert     /* ECDSA */
571*e0c4386eSCy Schubert     bio_buf = BIO_new(BIO_s_mem());
572*e0c4386eSCy Schubert     OPENSSL_assert((size_t)BIO_write(bio_buf, ECDSAPrivateKeyPEM, sizeof(ECDSAPrivateKeyPEM)) == sizeof(ECDSAPrivateKeyPEM));
573*e0c4386eSCy Schubert     ecdsakey = PEM_read_bio_ECPrivateKey(bio_buf, NULL, NULL, NULL);
574*e0c4386eSCy Schubert     ERR_print_errors_fp(stderr);
575*e0c4386eSCy Schubert     OPENSSL_assert(ecdsakey != NULL);
576*e0c4386eSCy Schubert     BIO_free(bio_buf);
577*e0c4386eSCy Schubert     pkey = EVP_PKEY_new();
578*e0c4386eSCy Schubert     EVP_PKEY_assign_EC_KEY(pkey, ecdsakey);
579*e0c4386eSCy Schubert     ret = SSL_CTX_use_PrivateKey(ctx, pkey);
580*e0c4386eSCy Schubert     OPENSSL_assert(ret == 1);
581*e0c4386eSCy Schubert     EVP_PKEY_free(pkey);
582*e0c4386eSCy Schubert # endif
583*e0c4386eSCy Schubert     bio_buf = BIO_new(BIO_s_mem());
584*e0c4386eSCy Schubert     OPENSSL_assert((size_t)BIO_write(bio_buf, ECDSACertPEM, sizeof(ECDSACertPEM)) == sizeof(ECDSACertPEM));
585*e0c4386eSCy Schubert     cert = PEM_read_bio_X509(bio_buf, NULL, NULL, NULL);
586*e0c4386eSCy Schubert     OPENSSL_assert(cert != NULL);
587*e0c4386eSCy Schubert     BIO_free(bio_buf);
588*e0c4386eSCy Schubert     ret = SSL_CTX_use_certificate(ctx, cert);
589*e0c4386eSCy Schubert     OPENSSL_assert(ret == 1);
590*e0c4386eSCy Schubert     X509_free(cert);
591*e0c4386eSCy Schubert #endif
592*e0c4386eSCy Schubert 
593*e0c4386eSCy Schubert #if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
594*e0c4386eSCy Schubert     /* DSA */
595*e0c4386eSCy Schubert     bio_buf = BIO_new(BIO_s_mem());
596*e0c4386eSCy Schubert     OPENSSL_assert((size_t)BIO_write(bio_buf, DSAPrivateKeyPEM, sizeof(DSAPrivateKeyPEM)) == sizeof(DSAPrivateKeyPEM));
597*e0c4386eSCy Schubert     dsakey = PEM_read_bio_DSAPrivateKey(bio_buf, NULL, NULL, NULL);
598*e0c4386eSCy Schubert     ERR_print_errors_fp(stderr);
599*e0c4386eSCy Schubert     OPENSSL_assert(dsakey != NULL);
600*e0c4386eSCy Schubert     BIO_free(bio_buf);
601*e0c4386eSCy Schubert     pkey = EVP_PKEY_new();
602*e0c4386eSCy Schubert     EVP_PKEY_assign_DSA(pkey, dsakey);
603*e0c4386eSCy Schubert     ret = SSL_CTX_use_PrivateKey(ctx, pkey);
604*e0c4386eSCy Schubert     OPENSSL_assert(ret == 1);
605*e0c4386eSCy Schubert     EVP_PKEY_free(pkey);
606*e0c4386eSCy Schubert 
607*e0c4386eSCy Schubert     bio_buf = BIO_new(BIO_s_mem());
608*e0c4386eSCy Schubert     OPENSSL_assert((size_t)BIO_write(bio_buf, DSACertPEM, sizeof(DSACertPEM)) == sizeof(DSACertPEM));
609*e0c4386eSCy Schubert     cert = PEM_read_bio_X509(bio_buf, NULL, NULL, NULL);
610*e0c4386eSCy Schubert     OPENSSL_assert(cert != NULL);
611*e0c4386eSCy Schubert     BIO_free(bio_buf);
612*e0c4386eSCy Schubert     ret = SSL_CTX_use_certificate(ctx, cert);
613*e0c4386eSCy Schubert     OPENSSL_assert(ret == 1);
614*e0c4386eSCy Schubert     X509_free(cert);
615*e0c4386eSCy Schubert #endif
616*e0c4386eSCy Schubert 
617*e0c4386eSCy Schubert     server = SSL_new(ctx);
618*e0c4386eSCy Schubert     in = BIO_new(BIO_s_mem());
619*e0c4386eSCy Schubert     out = BIO_new(BIO_s_mem());
620*e0c4386eSCy Schubert     SSL_set_bio(server, in, out);
621*e0c4386eSCy Schubert     SSL_set_accept_state(server);
622*e0c4386eSCy Schubert 
623*e0c4386eSCy Schubert     opt = (uint8_t)buf[len-1];
624*e0c4386eSCy Schubert     len--;
625*e0c4386eSCy Schubert 
626*e0c4386eSCy Schubert     OPENSSL_assert((size_t)BIO_write(in, buf, len) == len);
627*e0c4386eSCy Schubert 
628*e0c4386eSCy Schubert     if ((opt & 0x01) != 0)
629*e0c4386eSCy Schubert     {
630*e0c4386eSCy Schubert         do {
631*e0c4386eSCy Schubert             char early_buf[16384];
632*e0c4386eSCy Schubert             size_t early_len;
633*e0c4386eSCy Schubert             ret = SSL_read_early_data(server, early_buf, sizeof(early_buf), &early_len);
634*e0c4386eSCy Schubert 
635*e0c4386eSCy Schubert             if (ret != SSL_READ_EARLY_DATA_SUCCESS)
636*e0c4386eSCy Schubert                 break;
637*e0c4386eSCy Schubert         } while (1);
638*e0c4386eSCy Schubert     }
639*e0c4386eSCy Schubert 
640*e0c4386eSCy Schubert     if (SSL_do_handshake(server) == 1) {
641*e0c4386eSCy Schubert         /* Keep reading application data until error or EOF. */
642*e0c4386eSCy Schubert         uint8_t tmp[1024];
643*e0c4386eSCy Schubert         for (;;) {
644*e0c4386eSCy Schubert             if (SSL_read(server, tmp, sizeof(tmp)) <= 0) {
645*e0c4386eSCy Schubert                 break;
646*e0c4386eSCy Schubert             }
647*e0c4386eSCy Schubert         }
648*e0c4386eSCy Schubert     }
649*e0c4386eSCy Schubert     SSL_free(server);
650*e0c4386eSCy Schubert     ERR_clear_error();
651*e0c4386eSCy Schubert     SSL_CTX_free(ctx);
652*e0c4386eSCy Schubert 
653*e0c4386eSCy Schubert     return 0;
654*e0c4386eSCy Schubert }
655*e0c4386eSCy Schubert 
FuzzerCleanup(void)656*e0c4386eSCy Schubert void FuzzerCleanup(void)
657*e0c4386eSCy Schubert {
658*e0c4386eSCy Schubert     FuzzerClearRand();
659*e0c4386eSCy Schubert }
660