@@ -11,8 +11,7 @@ discard block |
||
| 11 | 11 | * @class AuthenticatorSelection |
| 12 | 12 | * @package Platine\Webauthn\Entity |
| 13 | 13 | */ |
| 14 | -class AuthenticatorSelection implements JsonSerializable |
|
| 15 | -{ |
|
| 14 | +class AuthenticatorSelection implements JsonSerializable { |
|
| 16 | 15 | /** |
| 17 | 16 | * The authenticator attachment |
| 18 | 17 | * @var string |
@@ -145,8 +144,7 @@ discard block |
||
| 145 | 144 | * {@inheritdoc} |
| 146 | 145 | * @return mixed |
| 147 | 146 | */ |
| 148 | - public function jsonSerialize() |
|
| 149 | - { |
|
| 147 | + public function jsonSerialize() { |
|
| 150 | 148 | return get_object_vars($this); |
| 151 | 149 | } |
| 152 | 150 | } |
@@ -169,9 +169,9 @@ |
||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /** |
| 172 | - * {@inheritdoc} |
|
| 173 | - * @return mixed |
|
| 174 | - */ |
|
| 172 | + * {@inheritdoc} |
|
| 173 | + * @return mixed |
|
| 174 | + */ |
|
| 175 | 175 | public function jsonSerialize() |
| 176 | 176 | { |
| 177 | 177 | return get_object_vars($this); |
@@ -11,8 +11,7 @@ discard block |
||
| 11 | 11 | * @class AttestedCredentialData |
| 12 | 12 | * @package Platine\Webauthn\Entity |
| 13 | 13 | */ |
| 14 | -class AttestedCredentialData implements JsonSerializable |
|
| 15 | -{ |
|
| 14 | +class AttestedCredentialData implements JsonSerializable { |
|
| 16 | 15 | /** |
| 17 | 16 | * The AAGUID of the authenticator |
| 18 | 17 | * @var string |
@@ -42,8 +41,7 @@ discard block |
||
| 42 | 41 | * Create new instance |
| 43 | 42 | * @param string $binaryData |
| 44 | 43 | */ |
| 45 | - public function __construct(string $binaryData) |
|
| 46 | - { |
|
| 44 | + public function __construct(string $binaryData) { |
|
| 47 | 45 | if (strlen($binaryData) <= 55) { |
| 48 | 46 | throw new WebauthnException('Attested credential data should be present but is missing'); |
| 49 | 47 | } |
@@ -113,8 +111,7 @@ discard block |
||
| 113 | 111 | * {@inheritdoc} |
| 114 | 112 | * @return mixed |
| 115 | 113 | */ |
| 116 | - public function jsonSerialize() |
|
| 117 | - { |
|
| 114 | + public function jsonSerialize() { |
|
| 118 | 115 | return get_object_vars($this); |
| 119 | 116 | } |
| 120 | 117 | } |
@@ -169,9 +169,9 @@ |
||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /** |
| 172 | - * {@inheritdoc} |
|
| 173 | - * @return mixed |
|
| 174 | - */ |
|
| 172 | + * {@inheritdoc} |
|
| 173 | + * @return mixed |
|
| 174 | + */ |
|
| 175 | 175 | public function jsonSerialize() |
| 176 | 176 | { |
| 177 | 177 | return get_object_vars($this); |
@@ -14,8 +14,7 @@ discard block |
||
| 14 | 14 | * @class CredentialPublicKey |
| 15 | 15 | * @package Platine\Webauthn\Entity |
| 16 | 16 | */ |
| 17 | -class CredentialPublicKey implements JsonSerializable |
|
| 18 | -{ |
|
| 17 | +class CredentialPublicKey implements JsonSerializable { |
|
| 19 | 18 | /* |
| 20 | 19 | * Cose encoded keys |
| 21 | 20 | */ |
@@ -88,8 +87,7 @@ discard block |
||
| 88 | 87 | * @param int $offset |
| 89 | 88 | * @param int $endOffset |
| 90 | 89 | */ |
| 91 | - public function __construct(string $binaryData, int $offset, int &$endOffset) |
|
| 92 | - { |
|
| 90 | + public function __construct(string $binaryData, int $offset, int &$endOffset) { |
|
| 93 | 91 | $enc = CborDecoder::decodeInPlace($binaryData, $offset, $endOffset); |
| 94 | 92 | |
| 95 | 93 | // COSE key-encoded elliptic curve public key in EC2 format |
@@ -173,8 +171,7 @@ discard block |
||
| 173 | 171 | * {@inheritdoc} |
| 174 | 172 | * @return mixed |
| 175 | 173 | */ |
| 176 | - public function jsonSerialize() |
|
| 177 | - { |
|
| 174 | + public function jsonSerialize() { |
|
| 178 | 175 | return get_object_vars($this); |
| 179 | 176 | } |
| 180 | 177 | |
@@ -169,9 +169,9 @@ |
||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /** |
| 172 | - * {@inheritdoc} |
|
| 173 | - * @return mixed |
|
| 174 | - */ |
|
| 172 | + * {@inheritdoc} |
|
| 173 | + * @return mixed |
|
| 174 | + */ |
|
| 175 | 175 | public function jsonSerialize() |
| 176 | 176 | { |
| 177 | 177 | return get_object_vars($this); |
@@ -90,14 +90,14 @@ |
||
| 90 | 90 | */ |
| 91 | 91 | public function __construct(int $binaryFlag) |
| 92 | 92 | { |
| 93 | - $this->bit0 = !! ($binaryFlag & 1); |
|
| 94 | - $this->bit1 = !! ($binaryFlag & 2); |
|
| 95 | - $this->bit2 = !! ($binaryFlag & 4); |
|
| 96 | - $this->bit3 = !! ($binaryFlag & 8); |
|
| 97 | - $this->bit4 = !! ($binaryFlag & 16); |
|
| 98 | - $this->bit5 = !! ($binaryFlag & 32); |
|
| 99 | - $this->bit6 = !! ($binaryFlag & 64); |
|
| 100 | - $this->bit7 = !! ($binaryFlag & 128); |
|
| 93 | + $this->bit0 = !!($binaryFlag & 1); |
|
| 94 | + $this->bit1 = !!($binaryFlag & 2); |
|
| 95 | + $this->bit2 = !!($binaryFlag & 4); |
|
| 96 | + $this->bit3 = !!($binaryFlag & 8); |
|
| 97 | + $this->bit4 = !!($binaryFlag & 16); |
|
| 98 | + $this->bit5 = !!($binaryFlag & 32); |
|
| 99 | + $this->bit6 = !!($binaryFlag & 64); |
|
| 100 | + $this->bit7 = !!($binaryFlag & 128); |
|
| 101 | 101 | |
| 102 | 102 | $this->userPresent = $this->bit0; |
| 103 | 103 | $this->userVerified = $this->bit2; |
@@ -10,8 +10,7 @@ discard block |
||
| 10 | 10 | * @class Flag |
| 11 | 11 | * @package Platine\Webauthn\Entity |
| 12 | 12 | */ |
| 13 | -class Flag implements JsonSerializable |
|
| 14 | -{ |
|
| 13 | +class Flag implements JsonSerializable { |
|
| 15 | 14 | /** |
| 16 | 15 | * The bit 0 |
| 17 | 16 | * @var bool |
@@ -88,8 +87,7 @@ discard block |
||
| 88 | 87 | * Create new instance |
| 89 | 88 | * @param int $binaryFlag |
| 90 | 89 | */ |
| 91 | - public function __construct(int $binaryFlag) |
|
| 92 | - { |
|
| 90 | + public function __construct(int $binaryFlag) { |
|
| 93 | 91 | $this->bit0 = !! ($binaryFlag & 1); |
| 94 | 92 | $this->bit1 = !! ($binaryFlag & 2); |
| 95 | 93 | $this->bit2 = !! ($binaryFlag & 4); |
@@ -217,8 +215,7 @@ discard block |
||
| 217 | 215 | * {@inheritdoc} |
| 218 | 216 | * @return mixed |
| 219 | 217 | */ |
| 220 | - public function jsonSerialize() |
|
| 221 | - { |
|
| 218 | + public function jsonSerialize() { |
|
| 222 | 219 | return get_object_vars($this); |
| 223 | 220 | } |
| 224 | 221 | } |
@@ -169,9 +169,9 @@ |
||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /** |
| 172 | - * {@inheritdoc} |
|
| 173 | - * @return mixed |
|
| 174 | - */ |
|
| 172 | + * {@inheritdoc} |
|
| 173 | + * @return mixed |
|
| 174 | + */ |
|
| 175 | 175 | public function jsonSerialize() |
| 176 | 176 | { |
| 177 | 177 | return get_object_vars($this); |
@@ -11,8 +11,7 @@ discard block |
||
| 11 | 11 | * @class UserInfo |
| 12 | 12 | * @package Platine\Webauthn\Entity |
| 13 | 13 | */ |
| 14 | -class UserInfo implements JsonSerializable |
|
| 15 | -{ |
|
| 14 | +class UserInfo implements JsonSerializable { |
|
| 16 | 15 | /** |
| 17 | 16 | * The id |
| 18 | 17 | * @var ByteBuffer |
@@ -37,8 +36,7 @@ discard block |
||
| 37 | 36 | * @param string $name |
| 38 | 37 | * @param string $displayName |
| 39 | 38 | */ |
| 40 | - public function __construct($id, string $name, string $displayName) |
|
| 41 | - { |
|
| 39 | + public function __construct($id, string $name, string $displayName) { |
|
| 42 | 40 | if (is_string($id)) { |
| 43 | 41 | $id = new ByteBuffer($id); |
| 44 | 42 | } |
@@ -116,8 +114,7 @@ discard block |
||
| 116 | 114 | * {@inheritdoc} |
| 117 | 115 | * @return mixed |
| 118 | 116 | */ |
| 119 | - public function jsonSerialize() |
|
| 120 | - { |
|
| 117 | + public function jsonSerialize() { |
|
| 121 | 118 | return get_object_vars($this); |
| 122 | 119 | } |
| 123 | 120 | } |
@@ -169,9 +169,9 @@ |
||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /** |
| 172 | - * {@inheritdoc} |
|
| 173 | - * @return mixed |
|
| 174 | - */ |
|
| 172 | + * {@inheritdoc} |
|
| 173 | + * @return mixed |
|
| 174 | + */ |
|
| 175 | 175 | public function jsonSerialize() |
| 176 | 176 | { |
| 177 | 177 | return get_object_vars($this); |
@@ -10,8 +10,7 @@ discard block |
||
| 10 | 10 | * @class PublicKeyCredentialParam |
| 11 | 11 | * @package Platine\Webauthn\Entity |
| 12 | 12 | */ |
| 13 | -class PublicKeyCredentialParam implements JsonSerializable |
|
| 14 | -{ |
|
| 13 | +class PublicKeyCredentialParam implements JsonSerializable { |
|
| 15 | 14 | /** |
| 16 | 15 | * The type |
| 17 | 16 | * @var string |
@@ -28,8 +27,7 @@ discard block |
||
| 28 | 27 | * Create new instance |
| 29 | 28 | * @param int $alg |
| 30 | 29 | */ |
| 31 | - public function __construct(int $alg) |
|
| 32 | - { |
|
| 30 | + public function __construct(int $alg) { |
|
| 33 | 31 | $this->alg = $alg; |
| 34 | 32 | } |
| 35 | 33 | |
@@ -66,8 +64,7 @@ discard block |
||
| 66 | 64 | * {@inheritdoc} |
| 67 | 65 | * @return mixed |
| 68 | 66 | */ |
| 69 | - public function jsonSerialize() |
|
| 70 | - { |
|
| 67 | + public function jsonSerialize() { |
|
| 71 | 68 | return get_object_vars($this); |
| 72 | 69 | } |
| 73 | 70 | } |
@@ -169,9 +169,9 @@ |
||
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | /** |
| 172 | - * {@inheritdoc} |
|
| 173 | - * @return mixed |
|
| 174 | - */ |
|
| 172 | + * {@inheritdoc} |
|
| 173 | + * @return mixed |
|
| 174 | + */ |
|
| 175 | 175 | public function jsonSerialize() |
| 176 | 176 | { |
| 177 | 177 | return get_object_vars($this); |
@@ -332,9 +332,9 @@ discard block |
||
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | /** |
| 335 | - * Return the binary string |
|
| 336 | - * @return string |
|
| 337 | - */ |
|
| 335 | + * Return the binary string |
|
| 336 | + * @return string |
|
| 337 | + */ |
|
| 338 | 338 | public function getBinaryString(): string |
| 339 | 339 | { |
| 340 | 340 | return $this->data; |
@@ -361,9 +361,9 @@ discard block |
||
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | /** |
| 364 | - * {@inheritdoc} |
|
| 365 | - * @return mixed |
|
| 366 | - */ |
|
| 364 | + * {@inheritdoc} |
|
| 365 | + * @return mixed |
|
| 366 | + */ |
|
| 367 | 367 | public function jsonSerialize() |
| 368 | 368 | { |
| 369 | 369 | if ($this->useBase64UrlEncoding) { |
@@ -377,18 +377,18 @@ discard block |
||
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | /** |
| 380 | - * {@inheritdoc} |
|
| 381 | - * @return string|null |
|
| 382 | - */ |
|
| 380 | + * {@inheritdoc} |
|
| 381 | + * @return string|null |
|
| 382 | + */ |
|
| 383 | 383 | public function serialize(): ?string |
| 384 | 384 | { |
| 385 | 385 | return serialize($this->data); |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | /** |
| 389 | - * {@inheritdoc} |
|
| 390 | - * $param string $data |
|
| 391 | - */ |
|
| 389 | + * {@inheritdoc} |
|
| 390 | + * $param string $data |
|
| 391 | + */ |
|
| 392 | 392 | public function unserialize($data): void |
| 393 | 393 | { |
| 394 | 394 | $value = unserialize($data); |
@@ -40,7 +40,7 @@ |
||
| 40 | 40 | */ |
| 41 | 41 | public function __construct(string $binaryData) |
| 42 | 42 | { |
| 43 | - $this->data = (string)$binaryData; |
|
| 43 | + $this->data = (string) $binaryData; |
|
| 44 | 44 | $this->length = strlen($binaryData); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -38,8 +38,7 @@ discard block |
||
| 38 | 38 | * Create new instance |
| 39 | 39 | * @param string $binaryData |
| 40 | 40 | */ |
| 41 | - public function __construct(string $binaryData) |
|
| 42 | - { |
|
| 41 | + public function __construct(string $binaryData) { |
|
| 43 | 42 | $this->data = (string)$binaryData; |
| 44 | 43 | $this->length = strlen($binaryData); |
| 45 | 44 | } |
@@ -311,8 +310,7 @@ discard block |
||
| 311 | 310 | * @param int $options |
| 312 | 311 | * @return array<mixed>|object |
| 313 | 312 | */ |
| 314 | - public function getJson(int $options = 0) |
|
| 315 | - { |
|
| 313 | + public function getJson(int $options = 0) { |
|
| 316 | 314 | try { |
| 317 | 315 | $data = Json::decode($this->getBinaryString(), false, 512, $options); |
| 318 | 316 | } catch (Exception $ex) { |
@@ -364,8 +362,7 @@ discard block |
||
| 364 | 362 | * {@inheritdoc} |
| 365 | 363 | * @return mixed |
| 366 | 364 | */ |
| 367 | - public function jsonSerialize() |
|
| 368 | - { |
|
| 365 | + public function jsonSerialize() { |
|
| 369 | 366 | if ($this->useBase64UrlEncoding) { |
| 370 | 367 | return self::base64UrlEncode($this->data); |
| 371 | 368 | } |
@@ -413,8 +410,7 @@ discard block |
||
| 413 | 410 | * @param array<string, mixed> $data |
| 414 | 411 | * @return void |
| 415 | 412 | */ |
| 416 | - public function __unserialize(array $data) |
|
| 417 | - { |
|
| 413 | + public function __unserialize(array $data) { |
|
| 418 | 414 | if (isset($data['data'])) { |
| 419 | 415 | $value = unserialize($data['data']); |
| 420 | 416 | if ($value === false) { |
@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | * @class Webauthn |
| 26 | 26 | * @package Platine\Webauthn |
| 27 | 27 | */ |
| 28 | -class Webauthn |
|
| 29 | -{ |
|
| 28 | +class Webauthn { |
|
| 30 | 29 | /** |
| 31 | 30 | * The attestation data formats |
| 32 | 31 | * @var array<string> |
@@ -68,8 +67,7 @@ discard block |
||
| 68 | 67 | * @param WebauthnConfiguration $config |
| 69 | 68 | * @param array<string> $allowedFormats |
| 70 | 69 | */ |
| 71 | - public function __construct(WebauthnConfiguration $config, array $allowedFormats = []) |
|
| 72 | - { |
|
| 70 | + public function __construct(WebauthnConfiguration $config, array $allowedFormats = []) { |
|
| 73 | 71 | if (! function_exists('openssl_open')) { |
| 74 | 72 | throw new WebauthnException('OpenSSL module not installed in this platform'); |
| 75 | 73 | } |
@@ -178,15 +178,15 @@ discard block |
||
| 178 | 178 | ); |
| 179 | 179 | |
| 180 | 180 | $publicKey = (new PublicKey()) |
| 181 | - ->setUserInfo($userInfo) |
|
| 182 | - ->setRelyingParty($relyingParty) |
|
| 183 | - ->setAuthenticatorSelection($authenticatorSelection) |
|
| 184 | - ->setExcludeCredentials($excludeCredentials) |
|
| 185 | - ->setChallenge($this->createChallenge()) |
|
| 186 | - ->setTimeout($this->config->get('timeout')) |
|
| 187 | - ->setExtensions() |
|
| 188 | - ->addPublicKeys() |
|
| 189 | - ->setAttestation($attestation); |
|
| 181 | + ->setUserInfo($userInfo) |
|
| 182 | + ->setRelyingParty($relyingParty) |
|
| 183 | + ->setAuthenticatorSelection($authenticatorSelection) |
|
| 184 | + ->setExcludeCredentials($excludeCredentials) |
|
| 185 | + ->setChallenge($this->createChallenge()) |
|
| 186 | + ->setTimeout($this->config->get('timeout')) |
|
| 187 | + ->setExtensions() |
|
| 188 | + ->addPublicKeys() |
|
| 189 | + ->setAttestation($attestation); |
|
| 190 | 190 | |
| 191 | 191 | return $publicKey; |
| 192 | 192 | } |
@@ -215,11 +215,11 @@ discard block |
||
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | $publicKey = (new PublicKey()) |
| 218 | - ->setRelyingPartyId($this->relyingParty->getId()) |
|
| 219 | - ->setAllowCredentials($allowedCredentials) |
|
| 220 | - ->setChallenge($this->createChallenge()) |
|
| 221 | - ->setTimeout($this->config->get('timeout')) |
|
| 222 | - ->setUserVerificationType($userVerificationType); |
|
| 218 | + ->setRelyingPartyId($this->relyingParty->getId()) |
|
| 219 | + ->setAllowCredentials($allowedCredentials) |
|
| 220 | + ->setChallenge($this->createChallenge()) |
|
| 221 | + ->setTimeout($this->config->get('timeout')) |
|
| 222 | + ->setUserVerificationType($userVerificationType); |
|
| 223 | 223 | |
| 224 | 224 | return $publicKey; |
| 225 | 225 | } |
@@ -100,11 +100,11 @@ discard block |
||
| 100 | 100 | */ |
| 101 | 101 | public function __construct(WebauthnConfiguration $config, array $allowedFormats = []) |
| 102 | 102 | { |
| 103 | - if (! function_exists('openssl_open')) { |
|
| 103 | + if (!function_exists('openssl_open')) { |
|
| 104 | 104 | throw new WebauthnException('OpenSSL module not installed in this platform'); |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - if (! in_array('SHA256', array_map('strtoupper', openssl_get_md_methods()))) { |
|
| 107 | + if (!in_array('SHA256', array_map('strtoupper', openssl_get_md_methods()))) { |
|
| 108 | 108 | throw new WebauthnException('SHA256 is not supported by this OpenSSL installation'); |
| 109 | 109 | } |
| 110 | 110 | |
@@ -263,7 +263,7 @@ discard block |
||
| 263 | 263 | ): array { |
| 264 | 264 | $clientDataHash = hash('sha256', $clientDataJson, true); |
| 265 | 265 | if (is_string($challenge)) { |
| 266 | - $challenge = new ByteBuffer($challenge); |
|
| 266 | + $challenge = new ByteBuffer($challenge); |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | // security: https://www.w3.org/TR/webauthn/#registering-a-new-credential |
@@ -276,21 +276,21 @@ discard block |
||
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | // 3. Verify that the value of C.type is webauthn.create. |
| 279 | - if (! isset($clientData->type) || $clientData->type !== 'webauthn.create') { |
|
| 279 | + if (!isset($clientData->type) || $clientData->type !== 'webauthn.create') { |
|
| 280 | 280 | throw new WebauthnException('Invalid client type provided'); |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | // 4. Verify that the value of C.challenge matches the challenge that was |
| 284 | 284 | // sent to the authenticator in the create() call. |
| 285 | 285 | if ( |
| 286 | - ! isset($clientData->challenge) || |
|
| 286 | + !isset($clientData->challenge) || |
|
| 287 | 287 | ByteBuffer::fromBase64Url($clientData->challenge)->getBinaryString() !== $challenge->getBinaryString() |
| 288 | 288 | ) { |
| 289 | 289 | throw new WebauthnException('Invalid challenge provided'); |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | // 5. Verify that the value of C.origin matches the Relying Party's origin. |
| 293 | - if (! isset($clientData->origin) || $this->checkOrigin($clientData->origin) === false) { |
|
| 293 | + if (!isset($clientData->origin) || $this->checkOrigin($clientData->origin) === false) { |
|
| 294 | 294 | throw new WebauthnException('Invalid origin provided'); |
| 295 | 295 | } |
| 296 | 296 | |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | bool $requireUserPresent = true |
| 380 | 380 | ): bool { |
| 381 | 381 | if (is_string($challenge)) { |
| 382 | - $challenge = new ByteBuffer($challenge); |
|
| 382 | + $challenge = new ByteBuffer($challenge); |
|
| 383 | 383 | } |
| 384 | 384 | $clientDataHash = hash('sha256', $clientDataJson, true); |
| 385 | 385 | $authenticator = $this->createAuthenticatorData($authenticatorData); |
@@ -407,21 +407,21 @@ discard block |
||
| 407 | 407 | // -> TO BE LOOKED UP BY IMPLEMENTATION |
| 408 | 408 | |
| 409 | 409 | // 7. Verify that the value of C.type is the string webauthn.get. |
| 410 | - if (! isset($clientData->type) || $clientData->type !== 'webauthn.get') { |
|
| 410 | + if (!isset($clientData->type) || $clientData->type !== 'webauthn.get') { |
|
| 411 | 411 | throw new WebauthnException('Invalid client type provided'); |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | // 8. Verify that the value of C.challenge matches the challenge that was sent to the |
| 415 | 415 | // authenticator in the PublicKeyCredentialRequestOptions passed to the get() call. |
| 416 | 416 | if ( |
| 417 | - ! isset($clientData->challenge) || |
|
| 417 | + !isset($clientData->challenge) || |
|
| 418 | 418 | ByteBuffer::fromBase64Url($clientData->challenge)->getBinaryString() !== $challenge->getBinaryString() |
| 419 | 419 | ) { |
| 420 | 420 | throw new WebauthnException('Invalid challenge provided'); |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | // 9. Verify that the value of C.origin matches the Relying Party's origin. |
| 424 | - if (! isset($clientData->origin) || $this->checkOrigin($clientData->origin) === false) { |
|
| 424 | + if (!isset($clientData->origin) || $this->checkOrigin($clientData->origin) === false) { |
|
| 425 | 425 | throw new WebauthnException('Invalid origin provided'); |
| 426 | 426 | } |
| 427 | 427 | |
@@ -530,7 +530,7 @@ discard block |
||
| 530 | 530 | // The origin's scheme must be https and not be ignored/whitelisted |
| 531 | 531 | $url = new Uri($origin); |
| 532 | 532 | if ( |
| 533 | - ! in_array($this->relyingParty->getId(), $this->config->get('ignore_origins')) && |
|
| 533 | + !in_array($this->relyingParty->getId(), $this->config->get('ignore_origins')) && |
|
| 534 | 534 | $url->getScheme() !== 'https' |
| 535 | 535 | ) { |
| 536 | 536 | return false; |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | return $supportedFormats; |
| 568 | 568 | } |
| 569 | 569 | |
| 570 | - $desiredFormats = array_filter($formats, function ($entry) use ($supportedFormats) { |
|
| 570 | + $desiredFormats = array_filter($formats, function($entry) use ($supportedFormats) { |
|
| 571 | 571 | return in_array($entry, $supportedFormats); |
| 572 | 572 | }); |
| 573 | 573 | |
@@ -8,8 +8,7 @@ |
||
| 8 | 8 | * @class KeyFormat |
| 9 | 9 | * @package Platine\Webauthn\Enum |
| 10 | 10 | */ |
| 11 | -class KeyFormat extends BaseEnum |
|
| 12 | -{ |
|
| 11 | +class KeyFormat extends BaseEnum { |
|
| 13 | 12 | public const ANDROID_KEY = 'android-key'; |
| 14 | 13 | public const ANDROID_SAFETYNET = 'android-safetynet'; |
| 15 | 14 | public const APPLE = 'apple'; |