Download src/php/php-src/ext/openssl/tests/bug60632.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 749 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/openssl/tests/bug60632.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/openssl/tests/bug60632.phpt
-
curl -L -o bug60632.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/openssl/tests/bug60632.phpt
749 Bytes
| --TEST-- | |
| Bug #60632: openssl_seal fails with AES | |
| --EXTENSIONS-- | |
| openssl | |
| --FILE-- | |
| $pkey = openssl_pkey_new(array( | |
| 'digest_alg' => 'sha256', | |
| 'private_key_bits' => 1024, | |
| 'private_key_type' => OPENSSL_KEYTYPE_RSA, | |
| 'encrypt_key' => false, | |
| 'config' => __DIR__ . DIRECTORY_SEPARATOR . 'openssl.cnf', | |
| )); | |
| $details = openssl_pkey_get_details($pkey); | |
| $test_pubkey = $details['key']; | |
| $pubkey = openssl_pkey_get_public($test_pubkey); | |
| $encrypted = null; | |
| $ekeys = array(); | |
| try { | |
| $result = openssl_seal('test phrase', $encrypted, $ekeys, array($pubkey), 'AES-256-CBC'); | |
| } catch (\ValueError $e) { | |
| echo $e->getMessage() . \PHP_EOL; | |
| } | |
| --EXPECT-- | |
| openssl_seal(): Argument #6 ($iv) cannot be null for the chosen cipher algorithm | |