From dcc8cce28b3c47dd7f6c1684fdb0793102164fb2 Mon Sep 17 00:00:00 2001 From: Daniel Calviño Sánchez Date: Sun, 23 Apr 2017 19:04:06 +0200 Subject: Fix double hashing of shared link passwords MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The plain text password for a shared links was hashed and, then, the hashed password was hashed again and set as the final password. Due to this the password introduced in the "Authenticate" page for the shared link was always a wrong password, and thus the file could not be accessed. Signed-off-by: Daniel Calviño Sánchez --- tests/lib/Share20/ManagerTest.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests') diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php index 7de73421d3e..6a389fcdf9a 100644 --- a/tests/lib/Share20/ManagerTest.php +++ b/tests/lib/Share20/ManagerTest.php @@ -2520,6 +2520,12 @@ class ManagerTest extends \Test\TestCase { $manager->expects($this->once())->method('canShare')->willReturn(true); $manager->expects($this->once())->method('getShareById')->with('foo:42')->willReturn($originalShare); $manager->expects($this->once())->method('validateExpirationDate')->with($share); + $manager->expects($this->once())->method('verifyPassword')->with('password'); + + $this->hasher->expects($this->once()) + ->method('hash') + ->with('password') + ->willReturn('hashed'); $this->defaultProvider->expects($this->once()) ->method('update') -- cgit v1.2.3