Review main Merged

65684[TASK] Fix phpstan checkFunctionArgumentTypes errors in ext:core Crypto

Sascha Egerer CR +2 V +2 Easy +4 −4 updated 10/06/20, 12:20

Commit message

This patch fixes incompatible type usage in function arguments
and is preparatory work for introducing native type hints and
strict mode in all core files.

Review

  • Code review CR +2 Done
    • Daniel Goerz +2
    • Alexander Schnitzler +1
  • Verified V +2 Done
    • Daniel Goerz +2
    • Alexander Schnitzler +1
    • TYPO3com +1 CI

Issues 1

Files 3

Review log 1620

  1. Sascha Egerer uploaded patch set 1 09/09/20, 17:17

  2. Sascha Egerer wrote 09/09/20, 17:20

    Topic set to phpstan
  3. Sascha Egerer updated the commit message in patch set 2 09/09/20, 17:20

  4. Oliver Klee voted on patch set 2 CR +1 09/09/20, 18:33

  5. Sascha Egerer commented on patch set 2 CR -1 09/10/20, 07:19

    BlowfishPasswordHash.php:216

    if (!strncmp(self::PREFIX, $salt, strlen(self::PREFIX))) { should be replaced by if (!strcmp(self::PREFIX, $salt)) {

    BlowfishPasswordHash.php:218

    This can end up in unexpected behavior again. First of all it should be checked if the $ does exist at all in the string. But this is again another topic and not part of this patch.

    Pbkdf2PasswordHash.php:71

    If getHashedPasswordInternal returns null we don't need to call hash_equals. $hashedPasswordInternal = $this->getHashedPasswordInternal($plainPW, $saltedHashPW); if ($hashedPasswordInternal === null) { return false; } return $this->isValidSalt($saltedHashPW) && hash_equals($hashedPasswordInternal, $saltedHashPW);

    Pbkdf2PasswordHash.php:238 Unresolved

    Same as in BlowfishPassword class

    PhpassPasswordHash.php:253 Unresolved

    Same as in BlowfishPassword class

    PhpassPasswordHash.php:255 Unresolved

    I'm not that deep in the topic but i wonder why it is "+ 2" here
  6. Daniel Goerz updated the commit message in patch set 3 09/10/20, 08:47

  7. TYPO3com voted on patch set 3 V +1 09/10/20, 09:36 Completed build in 36m 37s on Thu, 10 Sep, 09:36 AM Test Summary: 73173 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5474

  8. Oliver Klee commented on patch set 3 CR -1 09/26/20, 16:19

    Marking -1 so this does not get merged until the comments are addressed.
  9. Daniel Goerz commented on patch set 3 09/26/20, 16:25

    Thanks!
  10. Alexander Schnitzler uploaded patch set 4 10/06/20, 10:54

  11. Alexander Schnitzler uploaded patch set 5 10/06/20, 10:56

  12. TYPO3com voted on patch set 4 V -1 10/06/20, 11:07 Completed build in 12m 54s on Tue, 6 Oct, 11:07 AM Test Summary: 108 of 74270 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6264

  13. TYPO3com voted on patch set 5 V -1 10/06/20, 11:12 Completed build in 15m 27s on Tue, 6 Oct, 11:12 AM Test Summary: 108 of 74270 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6265

  14. Alexander Schnitzler uploaded patch set 6 10/06/20, 11:29

  15. Alexander Schnitzler commented on patch set 6 10/06/20, 11:32

    BlowfishPasswordHash.php:216 Reply

    This is not valid since we compare the prefix not the whole string.

    Pbkdf2PasswordHash.php:71 Reply

    Daniel and me decided to change this in a dedicated patch since the real fix would be to throw an InvalidArgumentException in getHashedPasswordInternal if the given password is an empty string.
  16. TYPO3com voted on patch set 6 V +1 10/06/20, 11:46 Completed build in 15m 59s on Tue, 6 Oct, 11:46 AM Test Summary: 73785 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6267

  17. Daniel Goerz voted on patch set 6 V +1 CR +1 10/06/20, 11:48

  18. Alexander Schnitzler voted on patch set 6 V +1 CR +1 10/06/20, 11:56

  19. Daniel Goerz voted on patch set 6 V +2 CR +2 10/06/20, 12:20

  20. Daniel Goerz merged patch set 7 10/06/20, 12:20