|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-07-29 21:57 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 05:00:01 2025 UTC |
Description: ------------ Can't change algorythm type in openssl_verify(). So, if data signs by MD5, openssl_verify() always returns FALSE. It is caused by openssl_verify() always using the SHA1 algorythm, so I think it can be improved by adding the 4th parameter (algorythm to use) to this function, for example, like this: openssl_verify($data, $signature, $pubkeyid, [, int signature_alg]); Reproduce code: --------------- openssl_sign($data, $signature, $priv_key_id, OPENSSL_ALGO_MD5); $ok = openssl_verify($data, $signature, $pub_key_id); if ($ok == 1) { echo "good"; } elseif ($ok == 0) { echo "bad"; } This returns always "bad". Expected result: ---------------- "ok", but it's impossible :(