Fix double hashing of shared link passwords
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 <danxuliu@gmail.com>
This commit is contained in:
parent
153d053ee7
commit
dcc8cce28b
|
@ -734,7 +734,7 @@ class Manager implements IManager {
|
|||
}
|
||||
|
||||
$plainTextPassword = null;
|
||||
if ($share->getShareType() === \OCP\Share::SHARE_TYPE_LINK || $share->getShareType() === \OCP\Share::SHARE_TYPE_EMAIL) {
|
||||
if ($share->getShareType() === \OCP\Share::SHARE_TYPE_EMAIL) {
|
||||
// Password updated.
|
||||
if ($share->getPassword() !== $originalShare->getPassword()) {
|
||||
//Verify the password
|
||||
|
|
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue