Debian Codegraph @

src/dhparam.c

raw
1 /* dhparam.c: initial DH parameters for stunnel */
2 #include "prototypes.h"
3 #ifndef OPENSSL_NO_DH
4 #define DN_new DH_new
5 DH *get_dh2048(void) {
6 static unsigned char dhp_2048[] = {
7 0xe6, 0xb7, 0xf2, 0x02, 0x95, 0x0a, 0xe9, 0xa8, 0xa8, 0x85, 0x70, 0x2d,
8 0xde, 0xc5, 0x60, 0x31, 0x47, 0x88, 0x69, 0x85, 0x83, 0x2d, 0x6f, 0x06,
9 0x26, 0x29, 0x77, 0x26, 0x98, 0xf8, 0x2c, 0x64, 0x68, 0x04, 0xed, 0x07,
10 0x44, 0xe1, 0xe8, 0x44, 0xab, 0x29, 0xa6, 0x5f, 0x14, 0xf2, 0xbc, 0x1b,
11 0x45, 0x5a, 0x34, 0x20, 0x53, 0x84, 0x14, 0xa0, 0xfe, 0x02, 0xc1, 0x03,
12 0xd5, 0x77, 0xf8, 0xa6, 0x99, 0xe5, 0x3c, 0x6a, 0x34, 0x16, 0x29, 0xc5,
13 0xa3, 0x09, 0xc7, 0x0e, 0x58, 0xf6, 0xff, 0x6b, 0xbe, 0x2d, 0x7d, 0x36,
14 0x09, 0x1d, 0x00, 0x78, 0xcd, 0xce, 0x5e, 0xef, 0xef, 0x8f, 0x90, 0xb9,
15 0x44, 0x36, 0x25, 0x78, 0xee, 0xce, 0x24, 0xc4, 0xf4, 0xbd, 0x04, 0xa2,
16 0x39, 0x4e, 0xa2, 0xd1, 0x16, 0x74, 0x74, 0xd8, 0x6b, 0xe0, 0x04, 0x35,
17 0x58, 0x90, 0xa4, 0x18, 0x3a, 0x64, 0x78, 0xee, 0x67, 0x4d, 0x69, 0x23,
18 0x1a, 0xa5, 0xd6, 0x86, 0x13, 0x5a, 0xf9, 0x78, 0x64, 0xe9, 0xb7, 0x64,
19 0x52, 0x27, 0xd9, 0x27, 0x68, 0x2e, 0x03, 0xd4, 0x66, 0x1a, 0x37, 0x1d,
20 0xdc, 0x85, 0x14, 0x93, 0x51, 0x2b, 0xa2, 0x14, 0x93, 0x5d, 0x62, 0x2c,
21 0x76, 0xc4, 0x9c, 0xd7, 0x3a, 0xb2, 0xec, 0x11, 0x3b, 0xf2, 0xca, 0xf5,
22 0xe7, 0x96, 0x72, 0xe1, 0x99, 0x32, 0x82, 0x6d, 0x79, 0xf2, 0x15, 0xc2,
23 0x44, 0xa2, 0x59, 0x6f, 0xa8, 0x9f, 0x43, 0xbb, 0x98, 0xcd, 0x89, 0xd2,
24 0x59, 0xb0, 0x0f, 0x48, 0x88, 0xa7, 0xa0, 0x84, 0xab, 0xfa, 0x95, 0x4e,
25 0x6f, 0x77, 0x65, 0xe7, 0x95, 0x58, 0x12, 0x35, 0x5a, 0x09, 0x39, 0x0c,
26 0xe3, 0x39, 0x90, 0xf3, 0x4f, 0xf5, 0x70, 0x62, 0xcf, 0x97, 0xc6, 0x09,
27 0x7d, 0xee, 0x00, 0xff, 0x82, 0x5c, 0x4c, 0xfb, 0x7a, 0x2f, 0xb3, 0xe2,
28 0xa3, 0x2f, 0xcc, 0xc7
29 };
30 static unsigned char dhg_2048[] = {
31 0x02
32 };
33 DH *dh = DH_new();
34 BIGNUM *p, *g;
35
36 if (dh == NULL)
37 return NULL;
38 p = BN_bin2bn(dhp_2048, sizeof(dhp_2048), NULL);
39 g = BN_bin2bn(dhg_2048, sizeof(dhg_2048), NULL);
40 if (p == NULL || g == NULL
41 || !DH_set0_pqg(dh, p, NULL, g)) {
42 DH_free(dh);
43 BN_free(p);
44 BN_free(g);
45 return NULL;
46 }
47 return dh;
48 }
49 #endif /* OPENSSL_NO_DH */
50 /* built for stunnel 5.78 */