File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
openssl /
tests /
bug38255.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:47:59 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
openssl key from zval leaks
--SKIPIF--
<?php
if (!extension_loaded("openssl")) die("skip");
?>
--FILE--
<?php
$pub_key_id = false;
$signature = '';
$ok = openssl_verify("foo", $signature, $pub_key_id, OPENSSL_ALGO_MD5);
class test {
function __toString() {
return "test object";
}
}
$t = new test;
var_dump(openssl_verify("foo", $signature, $pub_key_id, OPENSSL_ALGO_MD5));
var_dump(openssl_verify("foo", $t, $pub_key_id, OPENSSL_ALGO_MD5));
var_dump(openssl_verify("foo", new stdClass, $pub_key_id, OPENSSL_ALGO_MD5));
var_dump(openssl_verify("foo", new stdClass, array(), OPENSSL_ALGO_MD5));
var_dump(openssl_verify("foo", array(), array(), OPENSSL_ALGO_MD5));
var_dump(openssl_verify());
var_dump(openssl_verify(new stdClass, new stdClass, array(), 10000));
echo "Done\n";
?>
--EXPECTF--
Warning: openssl_verify(): supplied key param cannot be coerced into a public key in %s on line %d
Warning: openssl_verify(): supplied key param cannot be coerced into a public key in %s on line %d
bool(false)
Warning: openssl_verify(): supplied key param cannot be coerced into a public key in %s on line %d
bool(false)
Warning: openssl_verify() expects parameter 2 to be string, object given in %s on line %d
NULL
Warning: openssl_verify() expects parameter 2 to be string, object given in %s on line %d
NULL
Warning: openssl_verify() expects parameter 2 to be string, array given in %s on line %d
NULL
Warning: openssl_verify() expects at least 3 parameters, 0 given in %s on line %d
NULL
Warning: openssl_verify() expects parameter 1 to be string, object given in %s on line %d
NULL
Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>