summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Zelenka <bukka@php.net>2015-10-25 17:53:39 +0000
committerJakub Zelenka <bukka@php.net>2015-10-25 17:53:39 +0000
commit2ee99f89544ae0ef7fded6daca6f8ba27c52f319 (patch)
tree497714dd005c80cda5f5fd716d23177d44b75228
parentac58d21aa38ca00ab9698cecfa05c8e0ff1e8d4a (diff)
downloadphp-git-2ee99f89544ae0ef7fded6daca6f8ba27c52f319.tar.gz
Check EVP_SealFinal return code
This can be done since we no longer support OpenSSL 0.9.6
-rw-r--r--ext/openssl/openssl.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index a2bf8042c6..b2ae5fcaff 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -4963,15 +4963,14 @@ PHP_FUNCTION(openssl_seal)
EVP_CIPHER_CTX_cleanup(&ctx);
if (!EVP_SealInit(&ctx, cipher, eks, eksl, &iv_buf[0], pkeys, nkeys) ||
- !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, (int)data_len)) {
+ !EVP_SealUpdate(&ctx, buf, &len1, (unsigned char *)data, (int)data_len) ||
+ !EVP_SealFinal(&ctx, buf + len1, &len2)) {
RETVAL_FALSE;
efree(buf);
EVP_CIPHER_CTX_cleanup(&ctx);
goto clean_exit;
}
- EVP_SealFinal(&ctx, buf + len1, &len2);
-
if (len1 + len2 > 0) {
zval_dtor(sealdata);
buf[len1 + len2] = '\0';