Skip to content

Commit

Permalink
Merge pull request #2 from mbarbey/master
Browse files Browse the repository at this point in the history
fix issue when there is more than one U2F key registered
  • Loading branch information
Samyoul committed Oct 26, 2018
2 parents 87c1bbf + eef29a8 commit 0625202
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/U2FServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ public static function register(RegistrationRequest $request, $response, $attest
public static function makeAuthentication(array $registrations, $appId)
{
$signatures = [];
$challenge = static::createChallenge();
foreach ($registrations as $reg) {
if( !is_object( $reg ) ) {
throw new \InvalidArgumentException('$registrations of makeAuthentication() method only accepts array of object.');
Expand All @@ -204,7 +205,7 @@ public static function makeAuthentication(array $registrations, $appId)
$signatures[] = new SignRequest([
'appId' => $appId,
'keyHandle' => $reg->keyHandle,
'challenge' => static::createChallenge(),
'challenge' => $challenge,
]);
}
return $signatures;
Expand Down Expand Up @@ -425,4 +426,4 @@ private static function fixSignatureUnusedBits($cert)
return $cert;
}

}
}

0 comments on commit 0625202

Please sign in to comment.