#37820 [NEW]: Missing algorithm type in openssl_verify().

From: Date: Thu, 15 Jun 2006 18:30:36 +0000
Subject: #37820 [NEW]: Missing algorithm type in openssl_verify().
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-98400@lists.php.net to get a copy of this message
From:             php at lehis dot ru
Operating system: FreeBSD 6.1
PHP version:      5.1.4
PHP Bug Type:     OpenSSL related
Bug description:  Missing algorithm type in openssl_verify().

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 :(


-- 
Edit bug report at http://bugs.php.net/?id=37820&edit=1
-- 
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37820&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37820&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37820&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=37820&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=37820&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=37820&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=37820&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=37820&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=37820&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=37820&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=37820&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=37820&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=37820&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=37820&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=37820&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=37820&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=37820&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=37820&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=37820&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=37820&r=mysqlcfg


Thread (3 messages)

« previous php.bugs (#98400) next »