From 93a973ea40315ce896fa8d116587fec883440d5d Mon Sep 17 00:00:00 2001 From: Daniel Seifert Date: Wed, 25 Jan 2023 21:35:14 +0100 Subject: [PATCH] extend credential id field length because of insufficient length for Solo 2 key --- src/Application/Controller/Admin/d3user_webauthn.php | 1 + src/Application/Model/Credential/PublicKeyCredential.php | 6 +++--- src/Application/Model/Webauthn.php | 1 + src/Setup/Actions.php | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Application/Controller/Admin/d3user_webauthn.php b/src/Application/Controller/Admin/d3user_webauthn.php index 73ecd5e..0d0605a 100755 --- a/src/Application/Controller/Admin/d3user_webauthn.php +++ b/src/Application/Controller/Admin/d3user_webauthn.php @@ -108,6 +108,7 @@ class d3user_webauthn extends AdminDetailsController $credential = Registry::getRequest()->getRequestEscapedParameter('credential'); if (strlen((string) $credential)) { + /** @var Webauthn $webauthn */ $webauthn = d3GetOxidDIC()->get(Webauthn::class); $webauthn->saveAuthn($credential, Registry::getRequest()->getRequestEscapedParameter('keyname')); } diff --git a/src/Application/Model/Credential/PublicKeyCredential.php b/src/Application/Model/Credential/PublicKeyCredential.php index 606448b..69eed8d 100755 --- a/src/Application/Model/Credential/PublicKeyCredential.php +++ b/src/Application/Model/Credential/PublicKeyCredential.php @@ -135,9 +135,9 @@ class PublicKeyCredential extends BaseModel public function saveCredentialSource(PublicKeyCredentialSource $publicKeyCredentialSource, string $keyName = null): void { // item exist already - if (d3GetOxidDIC()->get(PublicKeyCredentialList::class) - ->findOneByCredentialId($publicKeyCredentialSource->getPublicKeyCredentialId()) - ) { + /** @var PublicKeyCredentialList $pkcl */ + $pkcl = d3GetOxidDIC()->get(PublicKeyCredentialList::class); + if ($pkcl->findOneByCredentialId($publicKeyCredentialSource->getPublicKeyCredentialId())) { return; } diff --git a/src/Application/Model/Webauthn.php b/src/Application/Model/Webauthn.php index 31158cf..5777a37 100644 --- a/src/Application/Model/Webauthn.php +++ b/src/Application/Model/Webauthn.php @@ -196,6 +196,7 @@ class Webauthn $serverRequest ); + /** @var PublicKeyCredential $pkCredential */ $pkCredential = d3GetOxidDIC()->get(PublicKeyCredential::class); $pkCredential->saveCredentialSource($publicKeyCredentialSource, $keyName); } diff --git a/src/Setup/Actions.php b/src/Setup/Actions.php index bc58bc9..0a1143b 100644 --- a/src/Setup/Actions.php +++ b/src/Setup/Actions.php @@ -56,7 +56,7 @@ class Actions `OXUSERID` char(32) NOT NULL, `OXSHOPID` int(11) NOT NULL, `NAME` varchar(100) NOT NULL, - `CREDENTIALID` char(128) NOT NULL, + `CREDENTIALID` varchar(512) NOT NULL, `CREDENTIAL` varchar(2000) NOT NULL, `OXTIMESTAMP` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), PRIMARY KEY (`OXID`),