Store errors in openssl_(public|private)_(en|de)crypt

This commit is contained in:
Jakub Zelenka 2016-02-01 18:42:42 +00:00
parent 32d8cea840
commit ceddf003a7

View File

@ -4828,6 +4828,8 @@ PHP_FUNCTION(openssl_private_encrypt)
ZVAL_NEW_STR(crypted, cryptedbuf);
cryptedbuf = NULL;
RETVAL_TRUE;
} else {
php_openssl_store_errors();
}
if (cryptedbuf) {
zend_string_release(cryptedbuf);
@ -4895,6 +4897,8 @@ PHP_FUNCTION(openssl_private_decrypt)
ZVAL_NEW_STR(crypted, cryptedbuf);
cryptedbuf = NULL;
RETVAL_TRUE;
} else {
php_openssl_store_errors();
}
if (keyresource == NULL) {
@ -4955,6 +4959,8 @@ PHP_FUNCTION(openssl_public_encrypt)
ZVAL_NEW_STR(crypted, cryptedbuf);
cryptedbuf = NULL;
RETVAL_TRUE;
} else {
php_openssl_store_errors();
}
if (keyresource == NULL) {
EVP_PKEY_free(pkey);
@ -5024,6 +5030,8 @@ PHP_FUNCTION(openssl_public_decrypt)
ZVAL_NEW_STR(crypted, cryptedbuf);
cryptedbuf = NULL;
RETVAL_TRUE;
} else {
php_openssl_store_errors();
}
if (cryptedbuf) {