@@ -130,7 +130,7 @@ |
||
| 130 | 130 | $frontendData = []; |
| 131 | 131 | $frontendData['challengeEncoded'] = $challengeEncoded; |
| 132 | 132 | $frontendData['state'] = []; |
| 133 | - foreach (['Source', 'FIDO2Scope','FIDO2Username','FIDO2Displayname','requestTokenModel'] as $stateItem) { |
|
| 133 | + foreach (['Source', 'FIDO2Scope', 'FIDO2Username', 'FIDO2Displayname', 'requestTokenModel'] as $stateItem) { |
|
| 134 | 134 | $frontendData['state'][$stateItem] = $state[$stateItem]; |
| 135 | 135 | } |
| 136 | 136 | |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | // Found the root CA with Google, see above, and will perform chain validation even if the spec doesn't say so. |
| 182 | 182 | |
| 183 | 183 | // first, clear the openssl error backlog. We might need error data in case things go sideways. |
| 184 | - while(openssl_error_string() !== false); |
|
| 184 | + while (openssl_error_string() !== false); |
|
| 185 | 185 | |
| 186 | 186 | $stmtDecoded = $attestationArray['attStmt']; |
| 187 | 187 | if (!isset($stmtDecoded['x5c'])) { |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | !isset($certProps['extensions']['1.2.840.113635.100.8.2']) |
| 199 | 199 | || empty($certProps['extensions']['1.2.840.113635.100.8.2']) |
| 200 | 200 | ) { |
| 201 | - $this->fail( "The required nonce value is not present in the OID." ); |
|
| 201 | + $this->fail("The required nonce value is not present in the OID."); |
|
| 202 | 202 | } |
| 203 | 203 | $toCompare = substr($certProps['extensions']['1.2.840.113635.100.8.2'], 6); |
| 204 | 204 | if ($nonce != $toCompare) { |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | // chain validation first |
| 209 | - foreach ( $stmtDecoded['x5c'] as $runIndex => $runCert ) { |
|
| 209 | + foreach ($stmtDecoded['x5c'] as $runIndex => $runCert) { |
|
| 210 | 210 | if (isset($stmtDecoded['x5c'][$runIndex + 1])) { // there is a next cert, so follow the chain |
| 211 | 211 | $certResource = openssl_x509_read($cryptoUtils->der2pem($runCert)); |
| 212 | 212 | $signerPubKey = openssl_pkey_get_public($cryptoUtils->der2pem($stmtDecoded['x5c'][$runIndex + 1])); |
@@ -252,9 +252,9 @@ discard block |
||
| 252 | 252 | // § 8.8 Bullet 5 |
| 253 | 253 | $credentialDetails = openssl_pkey_get_details($credentialResource); |
| 254 | 254 | $keyDetails = openssl_pkey_get_details($keyResource); |
| 255 | - if ( $credentialDetails['bits'] != $keyDetails['bits'] || |
|
| 256 | - $credentialDetails['key'] != $keyDetails['key'] || |
|
| 257 | - $credentialDetails['type'] != $keyDetails['type'] ) { |
|
| 255 | + if ($credentialDetails['bits'] != $keyDetails['bits'] || |
|
| 256 | + $credentialDetails['key'] != $keyDetails['key'] || |
|
| 257 | + $credentialDetails['type'] != $keyDetails['type']) { |
|
| 258 | 258 | $this->fail("The credential public key does not match the certificate public key in attestationData. (" |
| 259 | 259 | . $credentialDetails['key'] |
| 260 | 260 | . " - " |
@@ -196,7 +196,7 @@ |
||
| 196 | 196 | $id = $this->authState::saveState($state, 'webauthn:request'); |
| 197 | 197 | if ($debugEnabled === true) { |
| 198 | 198 | $response = new RunnableResponse( |
| 199 | - function ($regObject, $id) { |
|
| 199 | + function($regObject, $id) { |
|
| 200 | 200 | echo $regObject->getDebugBuffer(); |
| 201 | 201 | echo $regObject->getValidateBuffer(); |
| 202 | 202 | echo "<form id='regform' method='POST' action='" . |
@@ -172,7 +172,7 @@ |
||
| 172 | 172 | |
| 173 | 173 | if ($debugEnabled) { |
| 174 | 174 | $response = new RunnableResponse( |
| 175 | - function ($authObject, $state) { |
|
| 175 | + function($authObject, $state) { |
|
| 176 | 176 | echo $authObject->getDebugBuffer(); |
| 177 | 177 | echo $authObject->getValidateBuffer(); |
| 178 | 178 | echo "Debug mode, not continuing to " . ($state['FIDO2WantsRegister'] ? "credential registration page." : "destination."); |