|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-02-28 18:15 UTC] w3ricardo-php at yahoo dot com
[2012-02-29 09:33 UTC] pajoye@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: ab
[2012-02-29 10:49 UTC] pajoye@php.net
[2012-02-29 10:49 UTC] pajoye@php.net
-Type: Bug
+Type: Documentation Problem
[2012-02-29 10:50 UTC] pajoye@php.net
-Assigned To: ab
+Assigned To:
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 16:00:02 2025 UTC |
Description: ------------ openssl_public_encrypt fails with the argument OPENSSL_NO_PADDING. Without it, it works fine. Test script: --------------- $configargs = array ("private_key_bits" => 4096, "private_key_type" => OPENSSL_KEYTYPE_RSA, "encrypt_key" => false); $key = openssl_pkey_new($configargs); $details = openssl_pkey_get_details($pubkey); $pubkey = $details['key']; $r = openssl_public_encrypt("This is a test", $crypted, $pubkey, OPENSSL_NO_PADDING); if ($r) { echo "encrypt no padding: true\n"; } else { echo "encrypt no padding: false\n"; $r = openssl_public_encrypt("This is a test", $crypted, $pubkey); if ($r) { echo "encrypt with padding: true\n"; } else { echo "encrypt with padding: false\n"; } } Expected result: ---------------- encrypt no padding: true Actual result: -------------- encrypt no padding: false encrypt with padding: true