Skip to content

Commit

Permalink
bug #35343 [Security] Fix RememberMe with null password (jderusse)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.4 branch.

Discussion
----------

[Security] Fix RememberMe with null password

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | yes
| Tickets       | NA
| License       | MIT
| Doc PR        | NA

From `UserInterface` the method getPassword may return null, while generateCookieHash requires a string.
This PR changes the signature of the methods to allows null password

Similar to #35335 for branch 3.4

Commits
-------

820eb35 Fix RememberMe with null password
  • Loading branch information
chalasr committed Jan 16, 2020
2 parents db3134e + 820eb35 commit 6cc377f
Showing 1 changed file with 8 additions and 8 deletions.
Expand Up @@ -89,10 +89,10 @@ protected function onLoginSuccess(Request $request, Response $response, TokenInt
/**
* Generates the cookie value.
*
* @param string $class
* @param string $username The username
* @param int $expires The Unix timestamp when the cookie expires
* @param string $password The encoded password
* @param string $class
* @param string $username The username
* @param int $expires The Unix timestamp when the cookie expires
* @param string|null $password The encoded password
*
* @return string
*/
Expand All @@ -111,10 +111,10 @@ protected function generateCookieValue($class, $username, $expires, $password)
/**
* Generates a hash for the cookie to ensure it is not being tampered with.
*
* @param string $class
* @param string $username The username
* @param int $expires The Unix timestamp when the cookie expires
* @param string $password The encoded password
* @param string $class
* @param string $username The username
* @param int $expires The Unix timestamp when the cookie expires
* @param string|null $password The encoded password
*
* @return string
*/
Expand Down

0 comments on commit 6cc377f

Please sign in to comment.