Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/private/Security/Crypto.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function encrypt($plaintext, $password = '') {
* @return string plaintext
* @throws \Exception If the HMAC does not match
*/
public function decrypt($authenticatedCiphertext, $password = '') {
public function decrypt(string $authenticatedCiphertext, string $password = ''): string {
if($password === '') {
$password = $this->config->getSystemValue('secret');
}
Expand Down
2 changes: 1 addition & 1 deletion lib/public/Security/ICrypto.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ public function encrypt($plaintext, $password = '');
* @throws \Exception If the HMAC does not match
* @since 8.0.0
*/
public function decrypt($authenticatedCiphertext, $password = '');
public function decrypt(string $authenticatedCiphertext, string $password = ''): string;
}
4 changes: 2 additions & 2 deletions tests/Core/Controller/LostControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -653,14 +653,14 @@ public function testSetPasswordExpiredTokenDueToLogin() {
public function testIsSetPasswordWithoutTokenFailing() {
$this->config->method('getUserValue')
->with('ValidTokenUser', 'core', 'lostpassword', null)
->will($this->returnValue(null));
->willReturn('aValidtoken');
$this->userManager->method('get')
->with('ValidTokenUser')
->willReturn($this->existingUser);

$this->crypto->method('decrypt')
->with(
$this->equalTo(''),
$this->equalTo('aValidtoken'),
$this->equalTo('test@example.comSECRET')
)->willThrowException(new \Exception());

Expand Down