Skip to content

Commit

Permalink
Merge pull request #157 from creative-commoners/pulls/5.1/broken-buil…
Browse files Browse the repository at this point in the history
…ds-51

FIX Pass AuthenticatorSelectionCriteria as argument to PublicKeyCredentialCreationOptions constructor
  • Loading branch information
GuySartorelli authored Sep 22, 2023
2 parents 251bef6 + 0075e3f commit 7cb3de8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/RegisterHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,9 @@ protected function getCredentialCreationOptions(
$this->getUserEntity($store->getMember()),
random_bytes(32),
[new PublicKeyCredentialParameters('public-key', Algorithms::COSE_ALGORITHM_ES256)],
40000
$this->getAuthenticatorSelectionCriteria()
);
$credentialOptions->setTimeout(40000);
$credentialOptions->setAuthenticatorSelection($this->getAuthenticatorSelectionCriteria());
$credentialOptions->setAttestation(PublicKeyCredentialCreationOptions::ATTESTATION_CONVEYANCE_PREFERENCE_NONE);

Expand Down
3 changes: 2 additions & 1 deletion src/VerifyHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ protected function getCredentialRequestOptions(
return $source->getPublicKeyCredentialDescriptor();
}, $validCredentials ?? []);

$options = new PublicKeyCredentialRequestOptions(random_bytes(32), 40000);
$options = new PublicKeyCredentialRequestOptions((string) random_bytes(32));
$options->setTimeout(40000);

$options->allowCredentials(...$descriptors);
$options->setUserVerification(PublicKeyCredentialRequestOptions::USER_VERIFICATION_REQUIREMENT_PREFERRED);
Expand Down

0 comments on commit 7cb3de8

Please sign in to comment.