diff options
| author | Wez Furlong <wez@php.net> | 2002-03-26 00:03:11 +0000 |
|---|---|---|
| committer | Wez Furlong <wez@php.net> | 2002-03-26 00:03:11 +0000 |
| commit | 74749ad642989c0ab31ac99ce9d9c3724696f7fe (patch) | |
| tree | 3cf562db8636f2a8a61c70f02dc6f39025b67a99 /ext/openssl/openssl.c | |
| parent | f4736c72eae677750ba27de608bef4f30b0f3aea (diff) | |
| download | php-git-74749ad642989c0ab31ac99ce9d9c3724696f7fe.tar.gz | |
Fix regular openssl_pkey_get_private($content, $phrase) syntax and
add test case.
This stuff should be merged into the 4.2 branch.
Diffstat (limited to 'ext/openssl/openssl.c')
| -rw-r--r-- | ext/openssl/openssl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index fb95b14cfd..e3d92a4ec9 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -140,6 +140,9 @@ static int le_csr; static void php_pkey_free(zend_rsrc_list_entry *rsrc TSRMLS_DC) { EVP_PKEY *pkey = (EVP_PKEY *)rsrc->ptr; + + assert(pkey != NULL); + EVP_PKEY_free(pkey); } @@ -1684,7 +1687,7 @@ static EVP_PKEY * php_openssl_evp_from_zval(zval ** val, int public_key, char * X509_free(cert); if (key && makeresource && resourceval) { - *resourceval = zend_list_insert(key, le_key); + *resourceval = ZEND_REGISTER_RESOURCE(NULL, key, le_key); } return key; } @@ -1911,7 +1914,7 @@ PHP_FUNCTION(openssl_pkey_get_private) return; Z_TYPE_P(return_value) = IS_RESOURCE; - pkey = php_openssl_evp_from_zval(&cert, 0, NULL, 1, &Z_LVAL_P(return_value) TSRMLS_CC); + pkey = php_openssl_evp_from_zval(&cert, 0, passphrase, 1, &Z_LVAL_P(return_value) TSRMLS_CC); if (pkey == NULL) { RETURN_FALSE; |
