summaryrefslogtreecommitdiff
path: root/ext/openssl
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2012-04-06 14:37:49 +0200
committerOndřej Surý <ondrej@sury.org>2012-04-06 14:37:49 +0200
commit7b10b0041aa63c6f8990ceb3ccc190bdd9eea2b9 (patch)
tree01edb9389d7b7f6b277a57e2bce1d05f9748d609 /ext/openssl
parent096b2f823b2273e3ee707b3805feb78d1e4be61d (diff)
downloadphp-7b10b0041aa63c6f8990ceb3ccc190bdd9eea2b9.tar.gz
Imported Upstream version 5.4.1~rc1upstream/5.4.1_rc1
Diffstat (limited to 'ext/openssl')
-rw-r--r--ext/openssl/README2
-rw-r--r--ext/openssl/config.w322
-rw-r--r--ext/openssl/config0.m42
-rw-r--r--ext/openssl/openssl.c2
-rw-r--r--ext/openssl/php_openssl.h2
-rw-r--r--ext/openssl/tests/004.phpt4
-rw-r--r--ext/openssl/tests/021.phpt13
-rw-r--r--ext/openssl/tests/022.phpt7
-rw-r--r--ext/openssl/tests/bug28382.phpt9
-rw-r--r--ext/openssl/xp_ssl.c2
10 files changed, 27 insertions, 18 deletions
diff --git a/ext/openssl/README b/ext/openssl/README
index 232a046ce..20a38332f 100644
--- a/ext/openssl/README
+++ b/ext/openssl/README
@@ -1,6 +1,6 @@
OpenSSL extension for PHP
-$Id: README 242949 2007-09-26 15:44:16Z cvs2svn $
+$Id$
The functions implemented so far make it possible to seal and open data, and
also create and verify signatures.
diff --git a/ext/openssl/config.w32 b/ext/openssl/config.w32
index a691cd85b..49edb068a 100644
--- a/ext/openssl/config.w32
+++ b/ext/openssl/config.w32
@@ -1,4 +1,4 @@
-// $Id: config.w32 226663 2007-01-07 18:38:22Z iliaa $
+// $Id$
// vim:ft=javascript
ARG_WITH("openssl", "OpenSSL support", "no");
diff --git a/ext/openssl/config0.m4 b/ext/openssl/config0.m4
index 1a956666d..2c7f4fb69 100644
--- a/ext/openssl/config0.m4
+++ b/ext/openssl/config0.m4
@@ -1,5 +1,5 @@
dnl
-dnl $Id: config0.m4 309398 2011-03-18 18:47:09Z geissert $
+dnl $Id$
dnl
PHP_ARG_WITH(openssl, for OpenSSL support,
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 5601c89d0..7187a9601 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: openssl.c 323440 2012-02-23 01:26:46Z scottmac $ */
+/* $Id$ */
#ifdef HAVE_CONFIG_H
#include "config.h"
diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h
index 925a250f3..fc118dba1 100644
--- a/ext/openssl/php_openssl.h
+++ b/ext/openssl/php_openssl.h
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_openssl.h 321634 2012-01-01 13:15:04Z felipe $ */
+/* $Id$ */
#ifndef PHP_OPENSSL_H
#define PHP_OPENSSL_H
diff --git a/ext/openssl/tests/004.phpt b/ext/openssl/tests/004.phpt
index c6c7e874c..508ccabc8 100644
--- a/ext/openssl/tests/004.phpt
+++ b/ext/openssl/tests/004.phpt
@@ -9,12 +9,12 @@ $a = 1;
var_dump(openssl_csr_new(1,$a));
var_dump(openssl_csr_new(1,$a,1,1));
$a = array();
-var_dump(openssl_csr_new(array(), $a, array(), array()));
+var_dump(openssl_csr_new(array(), $a, array('config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf'), array()));
//this leaks
$a = array(1,2);
$b = array(1,2);
-var_dump(openssl_csr_new($a, $b));
+var_dump(openssl_csr_new($a, $b, array('config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf')));
echo "Done\n";
diff --git a/ext/openssl/tests/021.phpt b/ext/openssl/tests/021.phpt
index 00e2158f8..391b6a527 100644
--- a/ext/openssl/tests/021.phpt
+++ b/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)
diff --git a/ext/openssl/tests/022.phpt b/ext/openssl/tests/022.phpt
index cbdebece8..1fa84d9f4 100644
--- a/ext/openssl/tests/022.phpt
+++ b/ext/openssl/tests/022.phpt
@@ -5,6 +5,8 @@ openssl_csr_export() tests
--FILE--
<?php
$wrong = "wrong";
+$config = __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf';
+$config_arg = array('config' => $config);
$dn = array(
"countryName" => "BR",
@@ -18,10 +20,11 @@ $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_export($csr, $output));
var_dump(openssl_csr_export($wrong, $output));
diff --git a/ext/openssl/tests/bug28382.phpt b/ext/openssl/tests/bug28382.phpt
index 771fc932f..2bedeb2d6 100644
--- a/ext/openssl/tests/bug28382.phpt
+++ b/ext/openssl/tests/bug28382.phpt
@@ -10,6 +10,11 @@ if (OPENSSL_VERSION_NUMBER<0x009070af) die("skip");
$cert = file_get_contents(dirname(__FILE__) . "/bug28382cert.txt");
$ext = openssl_x509_parse($cert);
var_dump($ext['extensions']);
+/* openssl 1.0 prepends the string "Full Name:" to the crlDistributionPoints array key.
+ For now, as this is the one difference only between 0.9.x and 1.x, it's handled with
+ placeholders to not to duplicate the test. When more diffs come, a duplication would
+ be probably a better solution.
+*/
?>
--EXPECTF--
array(11) {
@@ -20,9 +25,7 @@ array(11) {
["nsCertType"]=>
string(30) "SSL Client, SSL Server, S/MIME"
["crlDistributionPoints"]=>
- string(65) "
-Full Name:
- URI:http://mobile.blue-software.ro:90/ca/crl.shtml
+ string(%d) "%AURI:http://mobile.blue-software.ro:90/ca/crl.shtml
"
["nsCaPolicyUrl"]=>
string(38) "http://mobile.blue-software.ro:90/pub/"
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index 446a30c7f..d03eb3ee8 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: xp_ssl.c 322785 2012-01-26 05:15:57Z scottmac $ */
+/* $Id$ */
#include "php.h"
#include "ext/standard/file.h"