Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge release 4.7.0 into 5.0.x #463

Merged
merged 25 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
86647fd
BE and BS flags support (#424)
Spomky Jun 21, 2023
49b5bbc
BS and BE flags added to the Symfony Token (#425)
Spomky Jun 21, 2023
8714844
Fix bundle extension classname (#429)
Spomky Jul 2, 2023
c53f585
Update scorecards.yml (#430)
Spomky Jul 2, 2023
69c7a16
Merge pull request #431 from web-auth/4.6.x
Spomky Jul 2, 2023
c3eae17
return transports in attestation response pk credential source
Spomky Jul 15, 2023
ca754d8
Merge pull request #435 from joostdebruijn/fix/add-transports
Spomky Jul 15, 2023
fb38183
Fix typos (#433)
szepeviktor Jul 15, 2023
3db3259
Fix wrong EdDSA key encoding (#437)
Spomky Jul 15, 2023
7e89cde
Merge up 4.6.x to 4.7.x
Spomky Jul 15, 2023
c295998
Merge pull request #439 from web-auth/temporary-branchhFjDEmnd
Spomky Jul 15, 2023
7ef9b7b
Fix Rector+ECS
Spomky Jul 15, 2023
8e9167b
Merge pull request #440 from web-auth/cs/fix-all
Spomky Jul 15, 2023
697c84f
Ability to register users without username or displayName (#443)
Spomky Jul 23, 2023
9c83a3f
Fixed composer keywords (#444)
Spomky Jul 23, 2023
3eeb057
JS deps updated (#446)
Spomky Jul 24, 2023
c9e54b7
Doc files updated (#445)
Spomky Jul 24, 2023
52b2774
Minor corrections (#447)
Spomky Jul 24, 2023
0e945db
Previous fix for eddsa key fail at authentication (#449)
Gashmob Jul 26, 2023
e5adcb1
Bugs fixed (#451)
Spomky Jul 27, 2023
080b81d
Sonarcloud Github Action (#452)
Spomky Jul 27, 2023
5f1eefd
Code Coverage for Sonarcloud (#453)
Spomky Jul 27, 2023
b2c2321
Code Coverage for Sonarcloud (#454)
Spomky Jul 27, 2023
8d78f43
New exclusions (#455)
Spomky Jul 27, 2023
87895ca
Deprecate DTOs/ValueObjects getters/setters in favor of direct acces …
Spomky Jul 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
BE and BS flags support (#424)
BE and BS flags support
  • Loading branch information
Spomky authored Jun 21, 2023
commit 86647fdd5043c456c3480b9bb3b44a65943e9bda
18 changes: 13 additions & 5 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
use Rector\Core\ValueObject\PhpVersion;
use Rector\DeadCode\Rector\ClassMethod\RemoveUnusedPrivateMethodParameterRector;
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\Php81\Rector\Property\ReadOnlyPropertyRector;
use Rector\PHPUnit\Rector\Class_\PreferPHPUnitThisCallRector;
use Rector\PHPUnit\Set\PHPUnitLevelSetList;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Set\ValueObject\LevelSetList;
Expand All @@ -23,19 +25,25 @@
$config->import(SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES);
$config->import(DoctrineSetList::DOCTRINE_CODE_QUALITY);
$config->import(DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES);
$config->import(PHPUnitSetList::PHPUNIT_CODE_QUALITY);
$config->import(PHPUnitSetList::PHPUNIT_EXCEPTION);
$config->import(PHPUnitSetList::REMOVE_MOCKS);
$config->import(PHPUnitSetList::PHPUNIT_SPECIFIC_METHOD);
$config->import(PHPUnitSetList::ANNOTATIONS_TO_ATTRIBUTES);
$config->import(PHPUnitLevelSetList::UP_TO_PHPUNIT_100);
$config->import(PHPUnitSetList::PHPUNIT_YIELD_DATA_PROVIDER);
$config->paths([__DIR__ . '/src', __DIR__ . '/tests']);
$config->skip([
'src/symfony/src/DependencyInjection/Configuration.php',
'src/symfony/src/Routing/Loader.php',
'tests/symfony/config/routing.php',
__DIR__ . '/src/symfony/src/DependencyInjection/Configuration.php',
__DIR__ . '/src/symfony/src/Routing/Loader.php',
__DIR__ . '/tests/symfony/config/routing.php',
RemoveUnusedPrivateMethodParameterRector::class => [
__DIR__ . '*/DependencyInjection/Configuration.php',
__DIR__ . '/src/symfony/src/DependencyInjection/Configuration.php',
],
ReadOnlyPropertyRector::class => [
__DIR__ . '/src/metadata-service/src/Statement/MetadataStatement.php',
],
]);
$config->services()->remove(PreferPHPUnitThisCallRector::class);
$config->phpVersion(PhpVersion::PHP_81);
$config->parallel();
$config->importNames();
Expand Down
18 changes: 18 additions & 0 deletions src/webauthn/src/AuthenticatorData.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

/**
* @see https://www.w3.org/TR/webauthn/#sec-authenticator-data
* @see https://www.w3.org/TR/webauthn/#flags
*/
class AuthenticatorData
{
Expand All @@ -18,6 +19,13 @@ class AuthenticatorData

private const FLAG_UV = 0b00000100;

private const FLAG_BE = 0b00001000;

private const FLAG_BS = 0b00010000;

/**
* TODO: remove bits 3 and 4 as they have been assigned to BE and BS in Webauthn level 3.
*/
private const FLAG_RFU2 = 0b00111000;

private const FLAG_AT = 0b01000000;
Expand Down Expand Up @@ -54,6 +62,16 @@ public function isUserVerified(): bool
return 0 !== (ord($this->flags) & self::FLAG_UV);
}

public function isBackupEligible(): bool
{
return 0 !== (ord($this->flags) & self::FLAG_BE);
}

public function isBackedUp(): bool
{
return 0 !== (ord($this->flags) & self::FLAG_BS);
}

public function hasAttestedCredentialData(): bool
{
return 0 !== (ord($this->flags) & self::FLAG_AT);
Expand Down
2 changes: 2 additions & 0 deletions tests/library/Functional/AttestationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public function anAttestationSignedWithEcDSA521ShouldBeVerified(): void
);
static::assertTrue($authenticatorData->isUserPresent());
static::assertFalse($authenticatorData->isUserVerified());
static::assertFalse($authenticatorData->isBackupEligible());
static::assertFalse($authenticatorData->isBackedUp());
static::assertTrue($authenticatorData->hasAttestedCredentialData());
static::assertSame(0, $authenticatorData->getReservedForFutureUse1());
static::assertSame(0, $authenticatorData->getReservedForFutureUse2());
Expand Down