From 272832ab9247fe89e5fc487e826cc3940f86bfe4 Mon Sep 17 00:00:00 2001 From: HikariLan Date: Sun, 26 Nov 2023 17:30:39 +0800 Subject: [PATCH] feat: add more attestation statements and public-key algorithms, fix #3 --- extend.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/extend.php b/extend.php index fa7d1ea..4b2af9d 100644 --- a/extend.php +++ b/extend.php @@ -13,12 +13,18 @@ use Cose\Algorithm\Manager; use Cose\Algorithm\Signature\ECDSA\ES256; +use Cose\Algorithm\Signature\RSA\RS256; use Flarum\Extend; use Illuminate\Container\Container; +use Lcobucci\Clock\SystemClock; +use Webauthn\AttestationStatement\AndroidKeyAttestationStatementSupport; +use Webauthn\AttestationStatement\AppleAttestationStatementSupport; use Webauthn\AttestationStatement\AttestationObjectLoader; use Webauthn\AttestationStatement\AttestationStatementSupportManager; +use Webauthn\AttestationStatement\FidoU2FAttestationStatementSupport; use Webauthn\AttestationStatement\NoneAttestationStatementSupport; use Webauthn\AttestationStatement\PackedAttestationStatementSupport; +use Webauthn\AttestationStatement\TPMAttestationStatementSupport; use Webauthn\AuthenticationExtensions\ExtensionOutputCheckerHandler; use Webauthn\AuthenticatorAssertionResponseValidator; use Webauthn\AuthenticatorAttestationResponseValidator; @@ -26,10 +32,15 @@ $algorithmManager = Manager::create(); $algorithmManager->add(new ES256()); +$algorithmManager->add(new RS256()); $attestationStatementSupportManager = AttestationStatementSupportManager::create(); $attestationStatementSupportManager->add(new NoneAttestationStatementSupport()); $attestationStatementSupportManager->add(new PackedAttestationStatementSupport($algorithmManager)); +$attestationStatementSupportManager->add(new FidoU2FAttestationStatementSupport()); +$attestationStatementSupportManager->add(new TPMAttestationStatementSupport(SystemClock::fromSystemTimezone())); +$attestationStatementSupportManager->add(new AppleAttestationStatementSupport()); +$attestationStatementSupportManager->add(new AndroidKeyAttestationStatementSupport()); $extensionOutputCheckerHandler = ExtensionOutputCheckerHandler::create();