Skip to content

Commit cdce62b

Browse files
committed
Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3: Fix bug 61902 ext\phar\tests\phar_setsignaturealgo2.phpt falis
2 parents 6741949 + 69ed09a commit cdce62b

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

ext/phar/tests/files/openssl.cnf

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
[ req ]
2+
default_bits = 1024
3+
default_keyfile = privkey.pem
4+
distinguished_name = req_distinguished_name
5+
attributes = req_attributes
6+
x509_extensions = v3_ca # The extentions to add to the self signed cert
7+
string_mask = MASK:4294967295
8+
9+
10+
[ req_distinguished_name ]
11+
countryName = Country Name (2 letter code)
12+
countryName_default = AU
13+
countryName_min = 2
14+
countryName_max = 2
15+
stateOrProvinceName = State or Province Name (full name)
16+
stateOrProvinceName_default = Some-State
17+
localityName = Locality Name (eg, city)
18+
0.organizationName = Organization Name (eg, company)
19+
0.organizationName_default = Internet Widgits Pty Ltd
20+
organizationalUnitName = Organizational Unit Name (eg, section)
21+
commonName = Common Name (eg, YOUR name)
22+
commonName_max = 64
23+
emailAddress = Email Address
24+
emailAddress_max = 64
25+
26+
[ req_attributes ]
27+
challengePassword = A challenge password
28+
challengePassword_min = 4
29+
challengePassword_max = 20
30+
unstructuredName = An optional company name
31+
32+
[ v3_req ]
33+
basicConstraints = CA:FALSE
34+
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
35+
36+
[ v3_ca ]
37+
subjectKeyIdentifier=hash
38+
authorityKeyIdentifier=keyid:always,issuer:always
39+
basicConstraints = CA:true
40+
41+
[ usr_cert ]
42+
basicConstraints=CA:FALSE
43+

ext/phar/tests/phar_setsignaturealgo2.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ var_dump($p->getSignature());
3434
echo $e->getMessage();
3535
}
3636
try {
37+
$config = dirname(__FILE__) . '/files/openssl.cnf';
38+
$config_arg = array('config' => $config);
3739
$private = openssl_get_privatekey(file_get_contents(dirname(__FILE__) . '/files/private.pem'));
3840
$pkey = '';
39-
openssl_pkey_export($private, $pkey);
41+
openssl_pkey_export($private, $pkey, NULL, $config_arg);
4042
$p->setSignatureAlgorithm(Phar::OPENSSL, $pkey);
4143
var_dump($p->getSignature());
4244
} catch (Exception $e) {

0 commit comments

Comments
 (0)