mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Fix migration to non-empty secret
Add a fallback for empty keys Signed-off-by: Carl Schwan <carl@carlschwan.eu>
This commit is contained in:
parent
4196bf81e6
commit
754cb58b12
2 changed files with 8 additions and 2 deletions
|
|
@ -60,7 +60,10 @@ class RSA extends AuthMechanism {
|
|||
$auth = new RSACrypt();
|
||||
$auth->setPassword($this->config->getSystemValue('secret', ''));
|
||||
if (!$auth->loadKey($storage->getBackendOption('private_key'))) {
|
||||
throw new \RuntimeException('unable to load private key');
|
||||
$auth->setPassword('');
|
||||
if (!$auth->loadKey($storage->getBackendOption('private_key'))) {
|
||||
throw new \RuntimeException('unable to load private key');
|
||||
}
|
||||
}
|
||||
$storage->setBackendOption('public_key_auth', $auth);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,10 @@ class RSAPrivateKey extends AuthMechanism {
|
|||
$auth = new RSACrypt();
|
||||
$auth->setPassword($this->config->getSystemValue('secret', ''));
|
||||
if (!$auth->loadKey($storage->getBackendOption('private_key'))) {
|
||||
throw new \RuntimeException('unable to load private key');
|
||||
$auth->setPassword('');
|
||||
if (!$auth->loadKey($storage->getBackendOption('private_key'))) {
|
||||
throw new \RuntimeException('unable to load private key');
|
||||
}
|
||||
}
|
||||
$storage->setBackendOption('public_key_auth', $auth);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue