Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/twofactor_u2f.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2018-10-01 16:58:56 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2018-10-01 16:58:56 +0300
commit3afdfe856cd1754aa07f5afdade29e93f558964a (patch)
tree375b08f5f643109f6dd44fb84832788c9d6d9a43 /lib
parent645afb1dcf19a1f4c50c17ed5af61937a221a20a (diff)
Fix authentication/login registration id missing property
As of https://github.com/Yubico/php-u2flib-server/commit/af674fec3f077c3f447e51696656c6b8ea3b293e, the passed registrations array is stripped and only u2f properties are returned. Hence, the `id` prop gets removed and we have to look it up in the original data instead. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib')
-rw-r--r--lib/Service/U2FManager.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Service/U2FManager.php b/lib/Service/U2FManager.php
index 4c47444..c2d11b1 100644
--- a/lib/Service/U2FManager.php
+++ b/lib/Service/U2FManager.php
@@ -154,7 +154,10 @@ class U2FManager {
return false;
}
- $registration = $this->mapper->findRegistration($user, $reg->id);
+ $origReg = reset(array_filter($registrations, function(object $registration) use ($reg) {
+ return $registration->keyHandle === $reg->keyHandle;
+ }));
+ $registration = $this->mapper->findRegistration($user, $origReg->id);
$registration->setCounter($reg->counter);
$this->mapper->update($registration);
return true;