From a7d0d82768ec0906cec99cc974f9d6d2eef386a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Deruss=C3=A9?= Date: Tue, 14 Jan 2020 13:04:40 +0100 Subject: [PATCH] Fix RememberMe with null password --- .../Http/RememberMe/TokenBasedRememberMeServices.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/Security/Http/RememberMe/TokenBasedRememberMeServices.php b/src/Symfony/Component/Security/Http/RememberMe/TokenBasedRememberMeServices.php index f11e1dc02f..33427517ca 100644 --- a/src/Symfony/Component/Security/Http/RememberMe/TokenBasedRememberMeServices.php +++ b/src/Symfony/Component/Security/Http/RememberMe/TokenBasedRememberMeServices.php @@ -91,12 +91,12 @@ class TokenBasedRememberMeServices extends AbstractRememberMeServices /** * Generates the cookie value. * - * @param int $expires The Unix timestamp when the cookie expires - * @param string $password The encoded password + * @param int $expires The Unix timestamp when the cookie expires + * @param string|null $password The encoded password * * @return string */ - protected function generateCookieValue(string $class, string $username, int $expires, string $password) + protected function generateCookieValue(string $class, string $username, int $expires, ?string $password) { // $username is encoded because it might contain COOKIE_DELIMITER, // we assume other values don't @@ -111,12 +111,12 @@ class TokenBasedRememberMeServices extends AbstractRememberMeServices /** * Generates a hash for the cookie to ensure it is not being tampered with. * - * @param int $expires The Unix timestamp when the cookie expires - * @param string $password The encoded password + * @param int $expires The Unix timestamp when the cookie expires + * @param string|null $password The encoded password * * @return string */ - protected function generateCookieHash(string $class, string $username, int $expires, string $password) + protected function generateCookieHash(string $class, string $username, int $expires, ?string $password) { return hash_hmac('sha256', $class.self::COOKIE_DELIMITER.$username.self::COOKIE_DELIMITER.$expires.self::COOKIE_DELIMITER.$password, $this->getSecret()); }