74929[TASK] Use unsafe but faster password hashing in `RecoveryCodeTest`
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Oliver Klee +1
- Markus Klein +1
- Stefan Bürk +1
- Oliver Hader +1
-
Verified V +2 Done
- Christian Kuhn +2
- Oliver Klee +1
- Stefan Bürk +1
- core-ci +1 CI
Issues 1
Files 2
Review log 2529
Show 34 earlier messages
-
Andreas Kienast uploaded patch set 1 06/17/22, 20:16
-
Markus Klein voted on patch set 1 CR +1 06/17/22, 20:23
-
core-ci voted on patch set 1 V +1 06/17/22, 20:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28165
-
Oliver Klee commented on patch set 1 V +1 CR +1 06/17/22, 21:19
Nice!
-
Christian Kuhn commented on patch set 1 06/18/22, 07:38
I get the idea. And yes, argon and it's variants are slow by design, and that's good. However, switching to (salted)md5 even for the tests isn't maybe the best option: We should deprecate salted-md5 sooner or later (it's not very secure, we made it up, and it's no standard), using it for tests is then an additional hurdle. May I ask you to try some of the other available ones instead? Maybe with reducing their cost-options? I'm pretty sure you'll find combinations that are very close to you current speedup. -
Christian Kuhn commented on patch set 1 06/18/22, 07:40
Reply
another option: add a dedicated test-fixture implementation that is a no-op we can use for tests (and for tests only, so make it a fixture). that would be clean, quick, and remove the dependency to any p/w-hash-implementation here. -
Andreas Kienast voted on patch set 1 CR -1 06/18/22, 07:55
-
Oliver Klee commented on patch set 1 06/18/22, 08:30
Ideas for names: - NullHash - NoopHash - DummyHash -
Andreas Kienast uploaded patch set 2 06/18/22, 10:45
-
core-ci voted on patch set 2 V -1 06/18/22, 10:54 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28171
-
Andreas Kienast uploaded patch set 3 06/18/22, 11:18
-
core-ci voted on patch set 3 V +1 06/18/22, 11:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28173
-
Markus Klein commented on patch set 3 CR -1 06/18/22, 14:20
RecoveryCodesTest.php:42nope. ;-) -
Markus Klein commented on patch set 4 06/18/22, 14:21
Published edit on patch set 3. -
Markus Klein commented on patch set 4 CR +1 06/18/22, 14:22
RecoveryCodesTest.php:42ReplyDone -
core-ci voted on patch set 4 V +1 06/18/22, 14:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28176
-
Oliver Klee commented on patch set 4 V +1 CR +1 06/18/22, 15:24
Reply
Done -
Simon Schaufelberger commented on patch set 4 06/18/22, 20:37
NoopPasswordHash.php:36do we want to use __CLASS__ or self::class? The core usually uses self::class I thinkNoopPasswordHash.php:54a noop hashing that still uses sha1? Why not just plain text here? -
Andreas Kienast commented on patch set 4 06/18/22, 20:51
NoopPasswordHash.php:36ReplyBoth is used within Core.NoopPasswordHash.php:54ReplyThat's what lolli suggested in Slack. We have some kind of hashing which is still cheap enough. -
Simon Schaufelberger commented on patch set 4 06/18/22, 20:53
NoopPasswordHash.php:54ReplyYeah but then I wouldn't call it Noop because it still does something instead of the expected "nothing". -
Simon Schaufelberger commented on patch set 4 06/18/22, 21:02
INoopPasswordHash.php:54ReplyI propose to leave out the prefix and just go with plaintext. Then we have indeed a noop hashing. -
Andreas Kienast commented on patch set 4 06/18/22, 21:37
NoopPasswordHash.php:54ReplyProbably the most important reason not to do this is to prevent database-related issues like charset or field length constraints. -
Oliver Klee commented on patch set 4 06/18/22, 21:43
According to https://stackoverflow.com/questions/3665247/fastest-hash-for-non-cryptographic-uses, CRC32 is (or was in 2010) the fastest hash algorithm in PHP. Maybe we can switch to that. -
Christian Kuhn commented on patch set 4 06/18/22, 23:59
Reply
guys. hashing a short string of a couple of chars is nanoseconds! that's essentially no-op in php-world. no matter if crc, sha1 / sha256 or md5. you want to have something here that can't produce special chars to not run into whatever quoting issues. a sha() is fine, imho. -
Christian Kuhn commented on patch set 4 V +1 CR +1 06/19/22, 00:08
NoopPasswordHash.php:36ReplyDoneNoopPasswordHash.php:54Replysee my other comment. -
Stefan Bürk voted on patch set 4 V +1 CR +1 06/19/22, 00:10
-
Christian Kuhn voted on patch set 4 V +2 CR +2 06/19/22, 00:21
-
Christian Kuhn merged patch set 5 06/19/22, 00:22
-
Oliver Hader voted on patch set 5 CR +1 06/28/22, 07:52