Skip to content

Commit

Permalink
Use larger key size for DSA/DH tests
Browse files Browse the repository at this point in the history
OpenSSL 3 validates allowed sizes strictly, pick minimum sizes
that are supported.
  • Loading branch information
nikic committed Aug 5, 2021
1 parent ec4d926 commit 1cf4fb7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 0 additions & 3 deletions ext/openssl/tests/bug73711.cnf

This file was deleted.

11 changes: 8 additions & 3 deletions ext/openssl/tests/bug73711.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ Bug #73711: Segfault in openssl_pkey_new when generating DSA or DH key
openssl
--FILE--
<?php
$cnf = __DIR__ . DIRECTORY_SEPARATOR . 'bug73711.cnf';
var_dump(openssl_pkey_new(["private_key_type" => OPENSSL_KEYTYPE_DSA, 'config' => $cnf]));
var_dump(openssl_pkey_new(["private_key_type" => OPENSSL_KEYTYPE_DH, 'config' => $cnf]));
var_dump(openssl_pkey_new([
"private_key_type" => OPENSSL_KEYTYPE_DSA,
"private_key_bits" => 1024,
]));
var_dump(openssl_pkey_new([
"private_key_type" => OPENSSL_KEYTYPE_DH,
"private_key_bits" => 512,
]));
echo "DONE";
?>
--EXPECTF--
Expand Down

0 comments on commit 1cf4fb7

Please sign in to comment.