Bug #79847 [NEW]: crypt/sha512 with rounds<1000 returns failure

From: Date: Mon, 13 Jul 2020 12:00:55 +0000
Subject: Bug #79847 [NEW]: crypt/sha512 with rounds<1000 returns failure
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-227995@lists.php.net to get a copy of this message
From:             sjon
Operating system: archLinux
PHP version:      8.0.0alpha2
Package:          *Encryption and hash functions
Bug Type:         Bug
Bug description:crypt/sha512 with rounds<1000 returns failure

Description:
------------
running crypt using sha512 with rounds<1000 (the minimum) is documented
(and previously would) as being equal to specifying rounds=1000.
However, starting with alpha2 it instead returns the error string *0

Originally found as https://3v4l.org/o5qVS

Test script:
---------------
echo 'SHA-512:      ' . crypt('salasana',
'$6$rounds=10$qNElXs2yMnL2.GNS3kiM7DqmGbFLdQfIwu2691aJgT3xgJazPLtw7RPKz3Dp8RIc4b5fmJ7qvlq/mPN8a.rE40')
. "\n";


Expected result:
----------------
SHA-512:     
$6$rounds=1000$qNElXs2yMnL2.GNS$/q7trYkbKkoJernsumbObt2IysdXGRx/ytFaG0HBC97rHHhYRQvUcyEuRHP6h5yj8V.fH7XKEw5hjofVmYONw1

Actual result:
--------------
SHA-512:      *0

-- 
Edit bug report at https://bugs.php.net/bug.php?id=79847&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=79847&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=79847&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=79847&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=79847&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=79847&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=79847&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=79847&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=79847&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=79847&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=79847&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79847&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=79847&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=79847&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=79847&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=79847&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=79847&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=79847&r=mysqlcfg


Thread (3 messages)

« previous php.bugs (#227995) next »