Skip to content

Commit eef29a8

Browse files
authored
fix issue when there is more than one U2F key registered
1 parent 87c1bbf commit eef29a8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/U2FServer.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ public static function register(RegistrationRequest $request, $response, $attest
196196
public static function makeAuthentication(array $registrations, $appId)
197197
{
198198
$signatures = [];
199+
$challenge = static::createChallenge();
199200
foreach ($registrations as $reg) {
200201
if( !is_object( $reg ) ) {
201202
throw new \InvalidArgumentException('$registrations of makeAuthentication() method only accepts array of object.');
@@ -204,7 +205,7 @@ public static function makeAuthentication(array $registrations, $appId)
204205
$signatures[] = new SignRequest([
205206
'appId' => $appId,
206207
'keyHandle' => $reg->keyHandle,
207-
'challenge' => static::createChallenge(),
208+
'challenge' => $challenge,
208209
]);
209210
}
210211
return $signatures;
@@ -425,4 +426,4 @@ private static function fixSignatureUnusedBits($cert)
425426
return $cert;
426427
}
427428

428-
}
429+
}

0 commit comments

Comments
 (0)