From: Rob Richards Date: Fri, 19 Jan 2007 19:23:20 +0000 (+0000) Subject: fix accessing public key from x509 resource X-Git-Tag: RELEASE_1_0_0RC1~203 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e053dcc066bbee24bc080363dbb9d3cbc5d24f00;p=php fix accessing public key from x509 resource add test fix test under win32 --- diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 8865d9bd63..b5fdc348cc 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -1945,11 +1945,10 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char * /* got the key - return it */ return (EVP_PKEY*)what; } + } else { + /* other types could be used here - eg: file pointers and read in the data from them */ + TMP_CLEAN; } - - /* other types could be used here - eg: file pointers and read in the data from them */ - - TMP_CLEAN; } else { /* force it to be a string and check if it refers to a file */ /* passing non string values leaks, object uses toString, it returns NULL diff --git a/ext/openssl/tests/005.phpt b/ext/openssl/tests/005.phpt new file mode 100644 index 0000000000..069c94580c --- /dev/null +++ b/ext/openssl/tests/005.phpt @@ -0,0 +1,34 @@ +--TEST-- +openSSL: read public key from x.509 resource +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +Ok diff --git a/ext/openssl/tests/bug38261.phpt b/ext/openssl/tests/bug38261.phpt index e7d806083e..b06fa4f8fe 100644 --- a/ext/openssl/tests/bug38261.phpt +++ b/ext/openssl/tests/bug38261.phpt @@ -27,8 +27,8 @@ bool(false) bool(false) bool(false) -Warning: openssl_x509_parse() expects at least 1 parameter, 0 given in %s/bug38261.php on line %d +Warning: openssl_x509_parse() expects at least 1 parameter, 0 given in %sbug38261.php on line %d NULL bool(false) -Catchable fatal error: Object of class stdClass could not be converted to string in %s/bug38261.php on line %d +Catchable fatal error: Object of class stdClass could not be converted to string in %sbug38261.php on line %d