aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2025-01-21 16:26:05 +0100
committerGitHub <noreply@github.com>2025-01-21 16:26:05 +0100
commit83a9ed4c445e6502f4c6b8970c2875fdc8dea7b8 (patch)
treeaa611bc6ec401684a8171469c39c82d39943e402
parent250549cd031c6b62fd5728c531fed2bdc219e565 (diff)
parentfb8802a7838b05fc390808325f358316f8e58838 (diff)
downloadnextcloud-server-83a9ed4c445e6502f4c6b8970c2875fdc8dea7b8.tar.gz
nextcloud-server-83a9ed4c445e6502f4c6b8970c2875fdc8dea7b8.zip
Merge pull request #50255 from nextcloud/fix/password-validation
fix(sharing): Set correct password context for share password validation
-rw-r--r--lib/private/Share20/Manager.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index 3300a5d2e67..5911882e808 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -35,6 +35,7 @@ use OCP\Mail\IMailer;
use OCP\Security\Events\ValidatePasswordPolicyEvent;
use OCP\Security\IHasher;
use OCP\Security\ISecureRandom;
+use OCP\Security\PasswordContext;
use OCP\Share;
use OCP\Share\Events\BeforeShareDeletedEvent;
use OCP\Share\Events\ShareAcceptedEvent;
@@ -116,7 +117,8 @@ class Manager implements IManager {
// Let others verify the password
try {
- $this->dispatcher->dispatchTyped(new ValidatePasswordPolicyEvent($password));
+ $event = new ValidatePasswordPolicyEvent($password, PasswordContext::SHARING);
+ $this->dispatcher->dispatchTyped($event);
} catch (HintException $e) {
/* Wrap in a 400 bad request error */
throw new HintException($e->getMessage(), $e->getHint(), 400, $e);