com php-src: Test invalid auth tag length in encryption: ext/openssl/tests/openssl_encrypt_gcm.phpt

From: Date: Sat, 02 Jan 2016 17:01:54 +0000
Subject: com php-src: Test invalid auth tag length in encryption: ext/openssl/tests/openssl_encrypt_gcm.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-92477@lists.php.net to get a copy of this message
Commit: a866503bca8e9164ddd946f6465cc52e95768cdf Author: Jakub Zelenka <bukka@php.net> Sat, 2 Jan 2016 17:01:35 +0000 Parents: 52ffdf9fc3a97f52760b10bc15d825a1c12986e5 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a866503bca8e9164ddd946f6465cc52e95768cdf Log: Test invalid auth tag length in encryption Changed paths: M ext/openssl/tests/openssl_encrypt_gcm.phpt Diff: diff --git a/ext/openssl/tests/openssl_encrypt_gcm.phpt b/ext/openssl/tests/openssl_encrypt_gcm.phpt index 79dad7b..6c55404 100644 --- a/ext/openssl/tests/openssl_encrypt_gcm.phpt +++ b/ext/openssl/tests/openssl_encrypt_gcm.phpt @@ -21,8 +21,11 @@ foreach ($tests as $idx => $test) { var_dump($test['tag'] === $tag); } -echo "ERROR: IV\n"; +// Empty IV error var_dump(openssl_encrypt('data', $method, 'password', 0, NULL, $tag, '')); + +// Failing to retrieve tag (max is 16 bytes) +var_dump(openssl_encrypt('data', $method, 'password', 0, str_repeat('x', 32), $tag, '', 20)); ?> --EXPECTF-- TEST 0 @@ -43,7 +46,9 @@ bool(true) TEST 5 bool(true) bool(true) -ERROR: IV Warning: openssl_encrypt(): Setting of IV length for AEAD mode failed, the expected length is 12 bytes in %s on line %d bool(false) + +Warning: openssl_encrypt(): Retrieving verification tag failed in %s on line %d +string(8) "S6+N0w=="

« previous php.cvs (#92477) next »