summaryrefslogtreecommitdiff
path: root/ext/openssl/openssl.c
diff options
context:
space:
mode:
authorJakub Zelenka <bukka@php.net>2016-01-04 14:07:19 +0000
committerJakub Zelenka <bukka@php.net>2016-01-04 14:07:19 +0000
commit5897256d0405592d6629a25d0ca0b77cfaa741fe (patch)
tree46754a001114b8413bd3ec4d585aca8fff7c74a8 /ext/openssl/openssl.c
parent8daecc59eb62516e2f6b703150c4d3e78ab55b75 (diff)
downloadphp-git-5897256d0405592d6629a25d0ca0b77cfaa741fe.tar.gz
Fix and test OpenSSL CCM encryption
Diffstat (limited to 'ext/openssl/openssl.c')
-rw-r--r--ext/openssl/openssl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index a6abcb927e..d87d9b931f 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -5354,6 +5354,11 @@ static int php_openssl_cipher_update(const EVP_CIPHER *cipher_type,
{
int i = 0;
+ if (mode->is_single_run_aead && !EVP_EncryptUpdate(cipher_ctx, NULL, &i, NULL, (int)data_len)) {
+ php_error_docref(NULL, E_WARNING, "Setting of data length failed");
+ return FAILURE;
+ }
+
if (mode->is_aead && !EVP_CipherUpdate(cipher_ctx, NULL, &i, (unsigned char *)aad, (int)aad_len)) {
php_error_docref(NULL, E_WARNING, "Setting of additional application data failed");
return FAILURE;