Lines 2-10
Link Here
|
2 |
#ifndef HEADER_DH_H |
2 |
#ifndef HEADER_DH_H |
3 |
#include <openssl/dh.h> |
3 |
#include <openssl/dh.h> |
4 |
#endif |
4 |
#endif |
|
|
5 |
|
5 |
static DH *get_dh1024() |
6 |
static DH *get_dh1024() |
6 |
{ |
7 |
{ |
7 |
static unsigned char dh1024_p[]={ |
8 |
static unsigned char dhp_1024[]={ |
8 |
0x85,0x08,0xFF,0x6C,0xC1,0x0C,0x23,0x55,0xC5,0xF8,0x3D,0x47, |
9 |
0x85,0x08,0xFF,0x6C,0xC1,0x0C,0x23,0x55,0xC5,0xF8,0x3D,0x47, |
9 |
0x6F,0x23,0x36,0xDA,0x98,0xF3,0xE4,0x56,0xCD,0xA0,0xF3,0x02, |
10 |
0x6F,0x23,0x36,0xDA,0x98,0xF3,0xE4,0x56,0xCD,0xA0,0xF3,0x02, |
10 |
0x18,0xB0,0xCB,0xD2,0x92,0x4B,0xDC,0x76,0x2B,0x24,0x2B,0x20, |
11 |
0x18,0xB0,0xCB,0xD2,0x92,0x4B,0xDC,0x76,0x2B,0x24,0x2B,0x20, |
Lines 17-32
static DH *get_dh1024()
Link Here
|
17 |
0xF4,0xB8,0xB7,0x5B,0xEF,0x7E,0x06,0x43,0x2A,0x8E,0x33,0x69, |
18 |
0xF4,0xB8,0xB7,0x5B,0xEF,0x7E,0x06,0x43,0x2A,0x8E,0x33,0x69, |
18 |
0x71,0x65,0x35,0xBF,0xCB,0xCD,0xB0,0x5B, |
19 |
0x71,0x65,0x35,0xBF,0xCB,0xCD,0xB0,0x5B, |
19 |
}; |
20 |
}; |
20 |
static unsigned char dh1024_g[]={ |
21 |
static unsigned char dhg_1024[]={ |
21 |
0x02, |
22 |
0x02, |
22 |
}; |
23 |
}; |
23 |
DH *dh; |
24 |
DH *dh; |
|
|
25 |
BIGNUM *dhp_bn, *dhg_bn; |
24 |
|
26 |
|
25 |
if ((dh=DH_new()) == NULL) return(NULL); |
27 |
if ((dh=DH_new()) == NULL) return(NULL); |
26 |
dh->p=BN_bin2bn(dh1024_p,sizeof(dh1024_p),NULL); |
28 |
dhp_bn = BN_bin2bn(dhp_1024, sizeof (dhp_1024), NULL); |
27 |
dh->g=BN_bin2bn(dh1024_g,sizeof(dh1024_g),NULL); |
29 |
dhg_bn = BN_bin2bn(dhg_1024, sizeof (dhg_1024), NULL); |
28 |
if ((dh->p == NULL) || (dh->g == NULL)) { |
30 |
if (!DH_set0_pqg(dh, dhp_bn, NULL, dhg_bn)) { |
29 |
DH_free(dh); return(NULL); |
31 |
DH_free(dh); |
|
|
32 |
BN_free(dhp_bn); |
33 |
BN_free(dhg_bn); |
34 |
return(NULL); |
30 |
} |
35 |
} |
31 |
return(dh); |
36 |
return(dh); |
32 |
} |
37 |
} |