View | Details | Raw Unified | Return to bug 200756
Collapse All | Expand All

(-)modules/ssl/ssl_engine_dh.c 2015-05-20 15:25:17.610098218 +0000 (-14 / +14 lines)
Lines 104-111 Link Here
104
104
105
    if (nKeyLen == 512)
105
    if (nKeyLen == 2048)
106
        dh = get_dh512();
106
        dh = get_dh2048();
107
    else if (nKeyLen == 1024)
107
    else if (nKeyLen == 3072)
108
        dh = get_dh1024();
108
        dh = get_dh3072();
109
    else
109
    else
110
        dh = get_dh1024();
110
        dh = get_dh3072();
111
    return dh;
111
    return dh;
Lines 153-155 Link Here
153
#   generate the DH parameters
153
#   generate the DH parameters
154
print "1. Generate 512 and 1024 bit Diffie-Hellman parameters (p, g)\n";
154
print "1. Generate 2048 and 3072 bit Diffie-Hellman parameters (p, g)\n";
155
my $rand = '';
155
my $rand = '';
Lines 163-166 Link Here
163
$rand = "-rand $rand" if ($rand ne '');
163
$rand = "-rand $rand" if ($rand ne '');
164
system("openssl gendh $rand -out dh512.pem 512");
164
system("openssl gendh $rand -out dh2048.pem 2048");
165
system("openssl gendh $rand -out dh1024.pem 1024");
165
system("openssl gendh $rand -out dh3072.pem 3072");
166
166
Lines 168-173 Link Here
168
my $dhinfo = '';
168
my $dhinfo = '';
169
open(FP, "openssl dh -noout -text -in dh512.pem |") || die;
169
open(FP, "openssl dh -noout -text -in dh2048.pem |") || die;
170
$dhinfo .= $_ while (<FP>);
170
$dhinfo .= $_ while (<FP>);
171
close(FP);
171
close(FP);
172
open(FP, "openssl dh -noout -text -in dh1024.pem |") || die;
172
open(FP, "openssl dh -noout -text -in dh3072.pem |") || die;
173
$dhinfo .= $_ while (<FP>);
173
$dhinfo .= $_ while (<FP>);
Lines 179-184 Link Here
179
my $dhsource = '';
179
my $dhsource = '';
180
open(FP, "openssl dh -noout -C -in dh512.pem | indent | expand |") || die;
180
open(FP, "openssl dh -noout -C -in dh2048.pem | indent | expand |") || die;
181
$dhsource .= $_ while (<FP>);
181
$dhsource .= $_ while (<FP>);
182
close(FP);
182
close(FP);
183
open(FP, "openssl dh -noout -C -in dh1024.pem | indent | expand |") || die;
183
open(FP, "openssl dh -noout -C -in dh3072.pem | indent | expand |") || die;
184
$dhsource .= $_ while (<FP>);
184
$dhsource .= $_ while (<FP>);
Lines 205-208 Link Here
205
#   cleanup
205
#   cleanup
206
unlink("dh512.pem");
206
unlink("dh2048.pem");
207
unlink("dh1024.pem");
207
unlink("dh3072.pem");

Return to bug 200756