Skip to content

Stop if there is no encrypted token - #16782

Merged
blizzz merged 3 commits into
masterfrom
fix/16729/stop-if-encrypted-token-null
Aug 21, 2019
Merged

Stop if there is no encrypted token#16782
blizzz merged 3 commits into
masterfrom
fix/16729/stop-if-encrypted-token-null

Conversation

@kesselb

Copy link
Copy Markdown
Contributor

Fix#16729

Argument 1 passed to OC\Security\Crypto::decrypt() must be of the type string, null given

Fix Argument 1 passed to OC\Security\Crypto::decrypt() must be of the type string, null given
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselbkesselb added this to the Nextcloud 17 milestone Aug 18, 2019
@rullzerrullzer mentioned this pull request Aug 18, 2019

@rullzerrullzer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@kesselb

Copy link
Copy Markdown
ContributorAuthor

image

Looks unrelated to me.

$user = $this->createMock(IUser::class);
$user->expects($this->any())
->method('isEnabled')
->willReturn(false);
$user->expects($this->never())
->method('setPassword');
$this->config->method('getUserValue')
->with('ValidTokenUser', 'core', 'lostpassword', null)
->willReturn('encryptedData');
$this->userManager->method('get')
->with('DisabledUser')
->willReturn($this->existingUser);

We should return $user instead of $this->existingUser here. Not sure why this is going to break now 🙈

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
@rullzer

Copy link
Copy Markdown
Member

O lol. So the test was wrong. We just never noticed because we catched \Exception.
Good stuff

@rullzer
rullzer requested a review from blizzzAugust 19, 2019 14:16

@blizzzblizzz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

@blizzz
blizzz merged commit 6d20876 into masterAug 21, 2019
@blizzz
blizzz deleted the fix/16729/stop-if-encrypted-token-null branch August 21, 2019 10:31
@rullzer

Copy link
Copy Markdown
Member

/backport to stable16

@backportbot-nextcloud

Copy link
Copy Markdown

backport to stable16 in #17648

@solracsf

Copy link
Copy Markdown
Member

@kesselb still facing same issue on NC 17.0.2.

[cron] Error: TypeError: Argument 1 passed to OC\Security\Crypto::decrypt() must be of the type string, bool given,
called in /srv/lib/private/Security/IdentityProof/Manager.php on line 113 at <<closure>>
0. /srv/lib/private/Security/IdentityProof/Manager.php line 113
OC\Security\Crypto->decrypt("*** sensitive parameters replaced ***")
1. /srv/lib/private/Security/IdentityProof/Manager.php line 130
OC\Security\IdentityProof\Manager->retrieveKey("user-u221218")
2. /srv/lib/private/Security/IdentityProof/Signer.php line 62
OC\Security\IdentityProof\Manager->getKey(OC\User\User {})
3. /srv/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php line 142
OC\Security\IdentityProof\Signer->sign("lookupserver", {federationId: " ... "}, OC\User\User {})
4. /srv/lib/public/BackgroundJob/Job.php line 77
OCA\LookupServerConnector\BackgroundJobs\RetryJob->run({userId: "u221218"})
5. /srv/apps/lookup_server_connector/lib/BackgroundJobs/RetryJob.php line 105
OCP\BackgroundJob\Job->execute(OC\BackgroundJob\JobList {}, OC\Log {})
6. /srv/cron.php line 124
OCA\LookupServerConnector\BackgroundJobs\RetryJob->execute(OC\BackgroundJob\JobList {}, OC\Log {})

@kesselb

Copy link
Copy Markdown
ContributorAuthor

still facing same issue on NC 17.0.2.

Trace is different to: #16729 (comment). Please create a new issue.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Internal Server Error with stack trace when trying to change password twice from forgot-password email

5 participants

@kesselb@rullzer@solracsf@nickvergessen@blizzz