Bug #80337 [Csd]: win7
| From: | cmb@php.net | Date: | Sun, 08 Nov 2020 16:13:41 +0000 |
| Subject: | Bug #80337 [Csd]: win7 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-230196@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80337&edit=1
ID: 80337
Updated by: cmb@php.net
Reported by: malacca42 at gmail dot com
Summary: win7
Status: Closed
Type: Bug
Package: OpenSSL related
Operating System: windows
PHP Version: 7.4.12
Assigned To: nikic
Block user comment: N
Private report: N
New Comment:
Also, the script needs to use the $tag parameters, and should not
assume that the $key matches the $str.
Previous Comments:
------------------------------------------------------------------------
[2020-11-08 16:05:13] nikic@php.net
OCB support has been added in PHP 7.4.13.
------------------------------------------------------------------------
[2020-11-08 16:01:06] malacca42 at gmail dot com
Description:
------------
openssl cipher methods aes-128-ocb / aes-192-ocb / aes-256-ocb not working
Test script:
---------------
--TEST--
Test aes-128-ocb / aes-192-ocb / aes-256-ocb
--FILE--
<?php
function testDecrypt($method)
{
$str = 'foo';
$key = 'key';
$len = openssl_cipher_iv_length($method);
$iv = openssl_random_pseudo_bytes($len);
$encode = openssl_encrypt($str, $method, $key, 0, $iv);
$decode = openssl_decrypt($encode, $method, $key, 0, $iv);
var_dump($decode === $key);
}
testDecrypt('aes-128-ocb');
testDecrypt('aes-192-ocb');
testDecrypt('aes-256-ocb');
?>
--EXPECTF--
bool(true)
bool(true)
bool(true)
Expected result:
----------------
bool(true)
bool(true)
bool(true)
Actual result:
--------------
bool(false)
bool(false)
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80337&edit=1