Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Finish deprecation of all U2F-specific classes #36

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
Test login with incorrect signature
  • Loading branch information
Firehed committed Oct 27, 2021
commit d09d9948697ce4cc4e725ac935abbdf19944316a
11 changes: 5 additions & 6 deletions tests/ServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -556,16 +556,15 @@ public function testAuthenticateThrowsIfNoRequestMatchesKeyHandle(): void

public function testValidateLoginThrowsIfSignatureIsInvalid(): void
{
$challenge = $this->getDefaultLoginChallenge();
$response = $this->getDefaultLoginResponse([
'getSignature' => 'some-other-signature',
]);
$registration = $this->getDefaultRegistration();
$request = $this->getDefaultSignRequest();
// Trimming a byte off the signature to cause a mismatch
$data = $this->readJsonFile('sign_response.json');
$data['signatureData'] = substr($data['signatureData'], 0, -1);
$response = SignResponse::fromJson($this->safeEncode($data));

$this->expectException(SecurityException::class);
$this->expectExceptionCode(SecurityException::SIGNATURE_INVALID);
$this->server->validateLogin($request, $response, [$registration]);
$this->server->validateLogin($challenge, $response, [$registration]);
}

/**
Expand Down