Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix bug #61404 ext\openssl\tests\021.phpt fails

  • Loading branch information...
commit bd7bb973b1f4791f000a890b1c1387fcd28c65ee 1 parent bd928f0
@weltling weltling authored
Showing with 8 additions and 5 deletions.
  1. +8 −5 ext/openssl/tests/021.phpt
View
13 ext/openssl/tests/021.phpt
@@ -8,6 +8,8 @@ $cert = "file://" . dirname(__FILE__) . "/cert.crt";
$priv = "file://" . dirname(__FILE__) . "/private.key";
$wrong = "wrong";
$pub = "file://" . dirname(__FILE__) . "/public.key";
+$config = __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf';
+$config_arg = array('config' => $config);
$dn = array(
"countryName" => "BR",
@@ -21,14 +23,15 @@ $args = array(
"digest_alg" => "sha1",
"private_key_bits" => 2048,
"private_key_type" => OPENSSL_KEYTYPE_DSA,
- "encrypt_key" => true
+ "encrypt_key" => true,
+ "config" => $config
);
-$privkey = openssl_pkey_new();
+$privkey = openssl_pkey_new($config_arg);
$csr = openssl_csr_new($dn, $privkey, $args);
var_dump(openssl_csr_sign($csr, null, $privkey, 365, $args));
-var_dump(openssl_csr_sign($csr, null, $privkey, 365));
-var_dump(openssl_csr_sign($csr, $cert, $priv, 365));
+var_dump(openssl_csr_sign($csr, null, $privkey, 365, $config_arg));
+var_dump(openssl_csr_sign($csr, $cert, $priv, 365, $config_arg));
var_dump(openssl_csr_sign($csr, $wrong, $privkey, 365));
var_dump(openssl_csr_sign($csr, null, $wrong, 365));
var_dump(openssl_csr_sign($csr, null, $privkey, $wrong));
@@ -38,7 +41,7 @@ var_dump(openssl_csr_sign(array(), null, $privkey, 365));
var_dump(openssl_csr_sign($csr, array(), $privkey, 365));
var_dump(openssl_csr_sign($csr, null, array(), 365));
var_dump(openssl_csr_sign($csr, null, $privkey, array()));
-var_dump(openssl_csr_sign($csr, null, $privkey, 365, array()));
+var_dump(openssl_csr_sign($csr, null, $privkey, 365, $config_arg));
?>
--EXPECTF--
resource(%d) of type (OpenSSL X.509)
Please sign in to comment.
Something went wrong with that request. Please try again.