Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sharing): Set correct password context for share password validation #50255

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/private/Share20/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
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;
Expand Down Expand Up @@ -116,7 +117,8 @@ protected function verifyPassword($password) {

// 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);
Expand Down
Loading