1--TEST-- 2openssl_cms_decrypt() and invalid parameters 3--SKIPIF-- 4<?php if (!extension_loaded("openssl")) print "skip"; ?> 5--FILE-- 6<?php 7 8function myErrorHandler($errno, $errstr, $errfile, $errline) { 9 var_dump($errstr); 10} 11set_error_handler("myErrorHandler"); 12 13$a = 1; 14$b = 1; 15$c = new stdclass; 16$d = new stdclass; 17 18try { 19 var_dump(openssl_cms_decrypt($a, $b, $c, $d)); 20} catch (Error $e) { 21 echo $e->getMessage(), "\n"; 22} 23var_dump($c); 24 25var_dump(openssl_cms_decrypt($b, $b, $b, $b)); 26var_dump(openssl_cms_decrypt($a, $b, "", "")); 27var_dump(openssl_cms_decrypt($a, $b, true, false)); 28var_dump(openssl_cms_decrypt($a, $b, 0, 0)); 29 30echo "Done\n"; 31?> 32--EXPECT-- 33Object of class stdClass could not be converted to string 34object(stdClass)#1 (0) { 35} 36string(60) "openssl_cms_decrypt(): X.509 Certificate cannot be retrieved" 37bool(false) 38string(60) "openssl_cms_decrypt(): X.509 Certificate cannot be retrieved" 39bool(false) 40string(60) "openssl_cms_decrypt(): X.509 Certificate cannot be retrieved" 41bool(false) 42string(60) "openssl_cms_decrypt(): X.509 Certificate cannot be retrieved" 43bool(false) 44Done 45