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
Add additional signature mismatch test
  • Loading branch information
Firehed committed Oct 27, 2021
commit 80874ad8b40d29d3b83613a371f850964ae74ff4
13 changes: 13 additions & 0 deletions tests/ServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,19 @@ public function testValidateLoginThrowsIfSignatureIsInvalid(): void
$this->server->validateLogin($challenge, $response, [$registration]);
}

public function testValidateLoginThrowsIfWrongDataIsSigned(): void
{
$challenge = $this->getDefaultLoginChallenge();
$response = $this->getDefaultLoginResponse([
'getSignedData' => 'some other signed data',
]);
$registration = $this->getDefaultRegistration();

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

/**
* Arguably the most important authentication test: ensure that
* a perfectly-valid signature is rejected if it's not actually from the
Expand Down