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

From: Date: Mon, 13 Jul 2020 12:42:19 +0000
Subject: Bug #79847 [Com]: crypt/sha512 with rounds<1000 returns failure
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228002@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79847&edit=1 ID: 79847 Comment by: sjon@php.net Reported by: sjon@php.net Summary: crypt/sha512 with rounds<1000 returns failure Status: Open Type: Bug Package: *Encryption and hash functions Operating System: archLinux PHP Version: 8.0.0alpha2 Block user comment: N Private report: N New Comment: this isn't necessarily rounds related, for example https://3v4l.org/mrEHA also fails Previous Comments: ------------------------------------------------------------------------ [2020-07-13 12:00:54] sjon@php.net 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 this bug report at https://bugs.php.net/bug.php?id=79847&edit=1

« previous php.bugs (#228002) next »