1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 01:02:25 +01:00
Files
archived-php-src/ext/openssl/tests/bug38255.phpt
Máté Kocsis d1764ca330 Make error messages more consistent by fixing capitalization
Closes GH-5066 As a first step, let's capitalize their initial letter when it is applicable.
2020-01-17 14:52:46 +01:00

36 lines
830 B
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));
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)
Done