function_entry openssl_functions[] = {
- PHP_FE(openssl_read_privatekey, NULL)
+ PHP_FE(openssl_get_privatekey, NULL)
PHP_FE(openssl_get_publickey, NULL)
PHP_FE(openssl_free_key, NULL)
#if 0
"OpenSSL X.509",
module_number);
#endif
+ OpenSSL_add_all_ciphers();
return SUCCESS;
}
php_info_print_table_end();
}
+PHP_MSHUTDOWN_FUNCTION(openssl)
+{
+ EVP_cleanup();
+ return SUCCESS;
+}
+
/* {{{ proto int openssl_get_privatekey(string key)
- Read private key */
-PHP_FUNCTION(openssl_read_privatekey)
+ Get private key */
+PHP_FUNCTION(openssl_get_privatekey)
{
zval **key;
BIO *b;
}
convert_to_string_ex(key);
- b = BIO_new_mem_buf(Z_STRVAL_PP(key), -1);
+ b = BIO_new_mem_buf(Z_STRVAL_PP(key), Z_STRLEN_PP(key));
if (b == NULL) {
RETURN_FALSE;
}
pkey = (EVP_PKEY *) PEM_ASN1_read_bio((char *(*)())d2i_PrivateKey,
- PEM_STRING_EVP_PKEY, b,
- NULL, NULL, NULL);
+ PEM_STRING_EVP_PKEY, b,
+ NULL, NULL, NULL);
BIO_free(b);
if (pkey == NULL) {
#define phpext_openssl_ptr &openssl_module_entry
PHP_MINIT_FUNCTION(openssl);
+PHP_MSHUTDOWN_FUNCTION(openssl);
PHP_MINFO_FUNCTION(openssl);
-PHP_FUNCTION(openssl_read_privatekey);
+PHP_FUNCTION(openssl_get_privatekey);
PHP_FUNCTION(openssl_get_publickey);
PHP_FUNCTION(openssl_free_key);
#if 0