Lines Matching +full:1 +full:- +full:512

2 # Copyright 2020-2025 The OpenSSL Project Authors. All Rights Reserved.
26 my $fipsconf = srctop_file("test", "fips-and-base.cnf");
40 if (-T $file) {
45 if ($firstline eq "-----BEGIN DH PARAMETERS-----") {
47 } elsif ($firstline eq "-----BEGIN X9.42 DH PARAMETERS-----") {
63 my @textdata = run(app(['openssl', 'dhparam', '-in', $file, '-noout',
64 '-text', '-inform', $format]), capture => 1);
77 $readbits = $1;
92 my $keybits_line = "recommended-private-length: $keybits bits";
102 checkdhparams(data_file("pkcs3-2-1024.pem"), "PKCS3", 2, "PEM", 1024);
106 checkdhparams(data_file("pkcs3-5-1024.pem"), "PKCS3", 5, "PEM", 1024);
110 checkdhparams(data_file("pkcs3-2-2048.pem"), "PKCS3", 2, "PEM", 2048);
114 checkdhparams(data_file("x942-0-1024.pem"), "X9.42", 0, "PEM", 1024);
118 checkdhparams(data_file("pkcs3-2-1024.der"), "PKCS3", 2, "DER", 1024);
122 checkdhparams(data_file("pkcs3-5-1024.der"), "PKCS3", 5, "DER", 1024);
126 checkdhparams(data_file("pkcs3-2-2048.der"), "PKCS3", 2, "DER", 2048);
129 checkdhparams(data_file("x942-0-1024.der"), "X9.42", 0, "DER", 1024);
133 #use 512 for the size for speed reasons. Don't use this in real applications!
134 subtest "Generate: 512 bit PKCS3 params, generator 2, PEM file" => sub {
136 ok(run(app([ 'openssl', 'dhparam', '-out', 'gen-pkcs3-2-512.pem',
137 '512' ])));
138 checkdhparams("gen-pkcs3-2-512.pem", "PKCS3", 2, "PEM", 512, 125);
140 subtest "Generate: 512 bit PKCS3 params, explicit generator 2, PEM file" => sub {
142 ok(run(app([ 'openssl', 'dhparam', '-out', 'gen-pkcs3-exp2-512.pem', '-2',
143 '512' ])));
144 checkdhparams("gen-pkcs3-exp2-512.pem", "PKCS3", 2, "PEM", 512, 125);
146 subtest "Generate: 512 bit PKCS3 params, generator 5, PEM file" => sub {
148 ok(run(app([ 'openssl', 'dhparam', '-out', 'gen-pkcs3-5-512.pem', '-5',
149 '512' ])));
150 checkdhparams("gen-pkcs3-5-512.pem", "PKCS3", 5, "PEM", 512, 125);
152 subtest "Generate: 512 bit PKCS3 params, generator 2, explicit PEM file" => sub {
154 ok(run(app([ 'openssl', 'dhparam', '-out', 'gen-pkcs3-2-512.exp.pem',
155 '-outform', 'PEM', '512' ])));
156 checkdhparams("gen-pkcs3-2-512.exp.pem", "PKCS3", 2, "PEM", 512, 125);
161 subtest "Generate: 512 bit X9.42 params, generator 0, PEM file" => sub {
163 ok(run(app([ 'openssl', 'dhparam', '-out', 'gen-x942-0-512.pem',
164 '-dsaparam', '512' ])));
165 checkdhparams("gen-x942-0-512.pem", "X9.42", 0, "PEM", 512);
167 subtest "Generate: 512 bit X9.42 params, explicit generator 2, PEM file" => sub {
168 plan tests => 1;
169 #Expected to fail - you cannot select a generator with '-dsaparam'
170 ok(!run(app([ 'openssl', 'dhparam', '-out', 'gen-x942-exp2-512.pem', '-2',
171 '-dsaparam', '512' ])));
173 subtest "Generate: 512 bit X9.42 params, generator 5, PEM file" => sub {
174 plan tests => 1;
175 #Expected to fail - you cannot select a generator with '-dsaparam'
176 ok(!run(app([ 'openssl', 'dhparam', '-out', 'gen-x942-5-512.pem',
177 '-5', '-dsaparam', '512' ])));
179 subtest "Generate: 512 bit X9.42 params, generator 0, DER file" => sub {
181 ok(run(app([ 'openssl', 'dhparam', '-out', 'gen-x942-0-512.der',
182 '-dsaparam', '-outform', 'DER', '512' ])));
183 checkdhparams("gen-x942-0-512.der", "X9.42", 0, "DER", 512);
188 "checks", 4 if (disabled("fips") || disabled("fips-securitychecks"));
192 ok(!run(app(['openssl', 'dhparam', '-check', '512'])),
193 "Generating 512 bit DH params should fail in FIPS mode");
195 ok(run(app(['openssl', 'dhparam', '-provider', 'default', '-propquery',
196 '?fips!=yes', '-check', '512'])),
197 "Generating 512 bit DH params should succeed in FIPS mode using".
198 " non-FIPS property query");
203 ok(!run(app(['openssl', 'dhparam', '-dsaparam', '-check', '512'])),
204 "Generating 512 bit DSA-style DH params should fail in FIPS mode");
206 ok(run(app(['openssl', 'dhparam', '-provider', 'default', '-propquery',
207 '?fips!=yes', '-dsaparam', '-check', '512'])),
208 "Generating 512 bit DSA-style DH params should succeed in FIPS".
209 " mode using non-FIPS property query");
215 my $input = data_file("pkcs3-2-1024.pem");
216 ok(run(app(["openssl", "dhparam", "-noout", "-text"],
222 ok(run(app(['openssl', 'dhparam', '-in', $inout, '-out', $inout])),