Skip to content

Commit

Permalink
Base64Decode fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Spomky committed Mar 18, 2022
1 parent 8571981 commit 2dc9ce5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/webauthn/src/PublicKeyCredentialLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private function createResponse(array $response): AuthenticatorResponse
$response['clientDataJSON']
), $attestationObject);
case array_key_exists('authenticatorData', $response) && array_key_exists('signature', $response):
$authData = Base64::decode($response['authenticatorData']);
$authData = Base64UrlSafe::decode($response['authenticatorData']);

$authDataStream = new StringStream($authData);
$rp_id_hash = $authDataStream->read(32);
Expand Down Expand Up @@ -178,7 +178,7 @@ private function createResponse(array $response): AuthenticatorResponse
return new AuthenticatorAssertionResponse(
CollectedClientData::createFormJson($response['clientDataJSON']),
$authenticatorData,
Base64::decode($response['signature']),
Base64UrlSafe::decode($response['signature']),
$response['userHandle'] ?? null
);
default:
Expand Down

0 comments on commit 2dc9ce5

Please sign in to comment.