summaryrefslogtreecommitdiff
path: root/ext/openssl/tests/openssl_decrypt_ccm.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/tests/openssl_decrypt_ccm.phpt')
-rw-r--r--ext/openssl/tests/openssl_decrypt_ccm.phpt22
1 files changed, 14 insertions, 8 deletions
diff --git a/ext/openssl/tests/openssl_decrypt_ccm.phpt b/ext/openssl/tests/openssl_decrypt_ccm.phpt
index a5f01b87ce..08ef5bb7b7 100644
--- a/ext/openssl/tests/openssl_decrypt_ccm.phpt
+++ b/ext/openssl/tests/openssl_decrypt_ccm.phpt
@@ -10,14 +10,16 @@ if (!in_array('aes-256-ccm', openssl_get_cipher_methods()))
--FILE--
<?php
require_once __DIR__ . "/cipher_tests.inc";
-$method = 'aes-256-ccm';
-$tests = openssl_get_cipher_tests($method);
+$methods = ['aes-128-ccm', 'aes-256-ccm'];
-foreach ($tests as $idx => $test) {
- echo "TEST $idx\n";
- $pt = openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA,
- $test['iv'], $test['tag'], $test['aad']);
- var_dump($test['pt'] === $pt);
+foreach ($methods as $method) {
+ $tests = openssl_get_cipher_tests($method);
+ foreach ($tests as $idx => $test) {
+ echo "$method - TEST $idx\n";
+ $pt = openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA,
+ $test['iv'], $test['tag'], $test['aad']);
+ var_dump($test['pt'] === $pt);
+ }
}
// no IV
@@ -32,7 +34,11 @@ var_dump(openssl_decrypt($test['ct'], $method, $test['key'], OPENSSL_RAW_DATA,
?>
--EXPECTF--
-TEST 0
+aes-128-ccm - TEST 0
+bool(true)
+aes-128-ccm - TEST 1
+bool(true)
+aes-256-ccm - TEST 0
bool(true)
Warning: openssl_decrypt(): Setting of IV length for AEAD mode failed in %s on line %d