FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=16521&edit=1

ID: 16521
Updated by: hm2k@php.net
Reported By: revulon at gmail dot com
Summary: Support for hash_hmac() function
Status: Open
Type: Feature/Change Request
Package: PHP_Compat
Package Version: 1.6.0a2
PHP Version: Irrelevant
Roadmap Versions:
New Comment:

I feel we need to address why PHP_Compat cannot support the same algos
as the Message Digest (hash) engine.

What is here is a good start, but I think more can be done.


Previous Comments:
------------------------------------------------------------------------

[2010-08-21 08:32:53] revulo

I made an updated version of my patch that renamed the file
"_sha256.php".
http://download.revulo.com/PHP/PHP_Compat_Hash-20100821.zip

If you point out the remaining work concretely, then I would update my
patch again.

------------------------------------------------------------------------

[2010-08-16 12:31:48] aidan

-Status: Suspended
+Status: Open
I agree that hash_algos should only return the supported algorithms.
What needs to
be done to get this patch included in our next release?

------------------------------------------------------------------------

[2010-08-06 09:06:57] hm2k

-Status: Analyzed
+Status: Suspended
The issue is not exclusive to the hash_algos function.

There is work to be carried out before this is committed.

------------------------------------------------------------------------

[2010-08-06 03:41:01] revulo

hash_algos() is a function that lists SUPPORTED algorithms as is
documented in PHP manual. Users use this function to check preliminarily
whether the algorithm is supported or not. After confirming that the
algorithm is supported, the user calls hash() function without any
worries.

Thus, that's an unexpected result for the user if the above code reports
an error, even if we alter the error message to "Not Implemented".

If my opinion is not accepted, I will drop the submission of my
hash_algos.php. Please commit the code after removing my hash_algos.php
and hash_algos.phpt.

------------------------------------------------------------------------

[2010-08-05 22:03:29] hm2k

The error is that the algorithm is not implemented, not that it is
unknown.

Not displaying the error does not mean there is no error.

If a user calls an algorithm that they expect to work and it does not,
an error is expected.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://pear.php.net/bugs/bug.php?id=16521

Search Discussions

  • Revulon at Sep 18, 2010 at 2:51 am
    Edit report at http://pear.php.net/bugs/bug.php?id=16521&edit=1

    ID: 16521
    Comment by: revulon@gmail.com
    Reported By: revulon at gmail dot com
    Summary: Support for hash_hmac() function
    Status: Open
    Type: Feature/Change Request
    Package: PHP_Compat
    Package Version: 1.6.0a2
    PHP Version: Irrelevant
    Roadmap Versions:
    New Comment:

    I think the error message "hash(): Unknown hashing algorithm: ..."
    sufficiently explains that php_compat_hash() doesn't support the
    algorithm yet.

    If you say so, however, how about adding the following code to
    hash.php?

    switch ($algo) {
    case 'md2':
    case 'md4':
    ......
    case 'haval256,5':
    user_error('hash(): Not yet implemented: ' . $algo,
    E_USER_WARNING);
    return false;

    ......
    }


    Previous Comments:
    ------------------------------------------------------------------------

    [2010-09-16 13:45:49] hm2k

    I feel we need to address why PHP_Compat cannot support the same algos
    as the Message Digest (hash) engine.

    What is here is a good start, but I think more can be done.

    ------------------------------------------------------------------------

    [2010-08-21 08:32:53] revulo

    I made an updated version of my patch that renamed the file
    "_sha256.php".
    http://download.revulo.com/PHP/PHP_Compat_Hash-20100821.zip

    If you point out the remaining work concretely, then I would update my
    patch again.

    ------------------------------------------------------------------------

    [2010-08-16 12:31:48] aidan

    -Status: Suspended
    +Status: Open
    I agree that hash_algos should only return the supported algorithms.
    What needs to
    be done to get this patch included in our next release?

    ------------------------------------------------------------------------

    [2010-08-06 09:06:57] hm2k

    -Status: Analyzed
    +Status: Suspended
    The issue is not exclusive to the hash_algos function.

    There is work to be carried out before this is committed.

    ------------------------------------------------------------------------

    [2010-08-06 03:41:01] revulo

    hash_algos() is a function that lists SUPPORTED algorithms as is
    documented in PHP manual. Users use this function to check preliminarily
    whether the algorithm is supported or not. After confirming that the
    algorithm is supported, the user calls hash() function without any
    worries.

    Thus, that's an unexpected result for the user if the above code reports
    an error, even if we alter the error message to "Not Implemented".

    If my opinion is not accepted, I will drop the submission of my
    hash_algos.php. Please commit the code after removing my hash_algos.php
    and hash_algos.phpt.

    ------------------------------------------------------------------------

    The remainder of the comments for this report are too long. To view
    the rest of the comments, please view the bug report online at
    http://pear.php.net/bugs/bug.php?id=16521

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedSep 16, '10 at 1:45p
activeSep 18, '10 at 2:51a
posts2
users2
websitepear.php.net

2 users in discussion

Hm2k: 1 post Revulon: 1 post

People

Translate

site design / logo © 2022 Grokbase