mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
35e2a25d83
This function works in exactly the same way as openssl_cipher_iv_length but for a key length. This is especially useful to make sure that the right key length is provided to openssl_encrypt and openssl_decrypt. In addtion the change also updates implementation of openssl_cipher_iv_length and adds a test for it.
15 lines
222 B
PHP
15 lines
222 B
PHP
--TEST--
|
|
openssl_cipher_key_length() basic test
|
|
--EXTENSIONS--
|
|
openssl
|
|
--FILE--
|
|
<?php
|
|
|
|
var_dump(openssl_cipher_key_length('AES-128-CBC'));
|
|
var_dump(openssl_cipher_key_length('AES-256-CBC'));
|
|
|
|
?>
|
|
--EXPECT--
|
|
int(16)
|
|
int(32)
|