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
Migrate to new tool
  • Loading branch information
Firehed committed Oct 27, 2021
commit 38434c17c81ea4a859f55129629952a1b74e6cdc
16 changes: 8 additions & 8 deletions tests/ServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@ public function testLegacyRegistration(): void

public function testRegistration(): void
{
$request = $this->getDefaultRegisterRequest();
$challenge = $this->getDefaultRegistrationChallenge();
$response = $this->getDefaultRegistrationResponse();

$registration = $this->server
->validateRegistration($request, $response);
->validateRegistration($challenge, $response);
$this->assertInstanceOf(
RegistrationInterface::class,
$registration,
Expand Down Expand Up @@ -279,7 +279,7 @@ public function testRegistration(): void

public function testRegisterDefaultsToTryingEmptyCAList(): void
{
$request = $this->getDefaultRegisterRequest();
$challenge = $this->getDefaultRegistrationChallenge();
$response = $this->getDefaultRegistrationResponse();

$this->expectException(SecurityException::class);
Expand All @@ -288,7 +288,7 @@ public function testRegisterDefaultsToTryingEmptyCAList(): void
// meaning that an exception should be thrown unless either a)
// a matching CA is provided or b) verification is explicitly disabled
$server = new Server(self::APP_ID);
$server->validateRegistration($request, $response);
$server->validateRegistration($challenge, $response);
}

public function testRegisterThrowsIfChallengeDoesNotMatch(): void
Expand All @@ -306,7 +306,7 @@ public function testRegisterThrowsIfChallengeDoesNotMatch(): void

public function testRegisterThrowsWithUntrustedDeviceIssuerCertificate(): void
{
$request = $this->getDefaultRegisterRequest();
$challenge = $this->getDefaultRegistrationChallenge();
$response = $this->getDefaultRegistrationResponse();

$this->server->setTrustedCAs([
Expand All @@ -316,12 +316,12 @@ public function testRegisterThrowsWithUntrustedDeviceIssuerCertificate(): void
]);
$this->expectException(SecurityException::class);
$this->expectExceptionCode(SecurityException::NO_TRUSTED_CA);
$this->server->validateRegistration($request, $response);
$this->server->validateRegistration($challenge, $response);
}

public function testRegisterWorksWithCAList(): void
{
$request = $this->getDefaultRegisterRequest();
$challenge = $this->getDefaultRegistrationChallenge();
$response = $this->getDefaultRegistrationResponse();
// This contains the actual trusted + verified certificates which are
// good to use in production. The messages in these tests were
Expand All @@ -332,7 +332,7 @@ public function testRegisterWorksWithCAList(): void
$this->server->setTrustedCAs($CAs);

try {
$reg = $this->server->validateRegistration($request, $response);
$reg = $this->server->validateRegistration($challenge, $response);
} catch (SecurityException $e) {
if ($e->getCode() === SecurityException::NO_TRUSTED_CA) {
$this->fail('CA Verification should have succeeded');
Expand Down