@@ -414,7 +414,7 @@ |
||
| 414 | 414 | $keyObject = new Ec2Key($this->cborDecode(hex2bin($this->credential))); |
| 415 | 415 | $keyResource = openssl_pkey_get_public($keyObject->asPEM()); |
| 416 | 416 | if ($keyResource === false) { |
| 417 | - $this->fail("Unable to construct ECDSA public key resource from PEM."); |
|
| 417 | + $this->fail("Unable to construct ECDSA public key resource from PEM."); |
|
| 418 | 418 | }; |
| 419 | 419 | break; |
| 420 | 420 | case self::PK_ALGORITHM_RSA: |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public const PK_ALGORITHM_ECDSA = "-7"; |
| 27 | 27 | public const PK_ALGORITHM_RSA = "-257"; |
| 28 | - public const PK_ALGORITHM = [ self::PK_ALGORITHM_ECDSA, self::PK_ALGORITHM_RSA ]; |
|
| 28 | + public const PK_ALGORITHM = [self::PK_ALGORITHM_ECDSA, self::PK_ALGORITHM_RSA]; |
|
| 29 | 29 | public const AAGUID_ASSURANCE_LEVEL_NONE = 0; |
| 30 | 30 | public const AAGUID_ASSURANCE_LEVEL_SELF = 1; |
| 31 | 31 | public const AAGUID_ASSURANCE_LEVEL_BASIC = 2; |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | $keyDetails = openssl_pkey_get_details($keyResource); |
| 263 | 263 | if ( |
| 264 | 264 | $credentialDetails['bits'] != $keyDetails['bits'] || |
| 265 | - $credentialDetails['key'] != $keyDetails['key'] || |
|
| 265 | + $credentialDetails['key'] != $keyDetails['key'] || |
|
| 266 | 266 | $credentialDetails['type'] != $keyDetails['type'] |
| 267 | 267 | ) { |
| 268 | 268 | $this->fail( |
@@ -574,7 +574,7 @@ discard block |
||
| 574 | 574 | } |
| 575 | 575 | $extensions = substr($attData, 18 + $credIdLen + $credentialLength); |
| 576 | 576 | if (strlen($extensions) !== 0) { |
| 577 | - $this->pass("Found the following extensions (". strlen($extensions) ." bytes) during registration ceremony: " ); |
|
| 577 | + $this->pass("Found the following extensions (" . strlen($extensions) . " bytes) during registration ceremony: "); |
|
| 578 | 578 | } |
| 579 | 579 | |
| 580 | 580 | |
@@ -182,7 +182,7 @@ |
||
| 182 | 182 | return $this->credential; |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | - /** |
|
| 185 | + /** |
|
| 186 | 186 | * @return int |
| 187 | 187 | */ |
| 188 | 188 | public function getAlgo(): int |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | $config, |
| 46 | 46 | 'authsources[' . var_export($this->authId, true) . ']' |
| 47 | 47 | ); |
| 48 | - $this->authnContextClassRef = $this->authSourceConfig->getOptionalString("authncontextclassref",'urn:rsa:names:tc:SAML:2.0:ac:classes:FIDO'); |
|
| 48 | + $this->authnContextClassRef = $this->authSourceConfig->getOptionalString("authncontextclassref", 'urn:rsa:names:tc:SAML:2.0:ac:classes:FIDO'); |
|
| 49 | 49 | $moduleConfig = Configuration::getOptionalConfig('module_webauthn.php')->toArray(); |
| 50 | 50 | |
| 51 | 51 | $initialStateData = new StateData(); |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | |
| 210 | 210 | if ($debugEnabled) { |
| 211 | 211 | $response = new RunnableResponse( |
| 212 | - function (WebAuthnAuthenticationEvent $authObject, array $state) { |
|
| 212 | + function(WebAuthnAuthenticationEvent $authObject, array $state) { |
|
| 213 | 213 | echo $authObject->getDebugBuffer(); |
| 214 | 214 | echo $authObject->getValidateBuffer(); |
| 215 | 215 | echo "Debug mode, not continuing to " . ($state['FIDO2WantsRegister'] ? "credential registration page." : "destination."); |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | * In passwordless, we're on our own. The one thing we know is the |
| 234 | 234 | * username. |
| 235 | 235 | */ |
| 236 | - $state['Attributes'][$state['FIDO2AttributeStoringUsername']] = [ $state['FIDO2Username'] ]; |
|
| 236 | + $state['Attributes'][$state['FIDO2AttributeStoringUsername']] = [$state['FIDO2Username']]; |
|
| 237 | 237 | // now properly return our final state to the framework |
| 238 | 238 | Source::completeAuth($state); |
| 239 | 239 | } |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | |
| 178 | 178 | // did we get any client extensions? |
| 179 | 179 | $isResidentKey = 0; |
| 180 | - if (strlen($request->request->get('clientext')) > 0 && count(json_decode($request->request->get('clientext'), true)) > 0 ) { |
|
| 180 | + if (strlen($request->request->get('clientext')) > 0 && count(json_decode($request->request->get('clientext'), true)) > 0) { |
|
| 181 | 181 | $extensions = json_decode($request->request->get('clientext'), true); |
| 182 | 182 | if ($extensions['credProps']['rk'] === true) { |
| 183 | 183 | $isResidentKey = 1; |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $id = $this->authState::saveState($state, 'webauthn:request'); |
| 217 | 217 | if ($debugEnabled === true) { |
| 218 | 218 | $response = new RunnableResponse( |
| 219 | - function (WebAuthnRegistrationEvent $regObject, string $id) { |
|
| 219 | + function(WebAuthnRegistrationEvent $regObject, string $id) { |
|
| 220 | 220 | echo $regObject->getDebugBuffer(); |
| 221 | 221 | echo $regObject->getValidateBuffer(); |
| 222 | 222 | echo "<form id='regform' method='POST' action='" . |
@@ -216,7 +216,7 @@ |
||
| 216 | 216 | $this->db->write( |
| 217 | 217 | 'INSERT INTO credentials ' . |
| 218 | 218 | '(user_id, credentialId, credential, algo, presenceLevel, isResidentKey, signCounter, friendlyName, hashedId) VALUES ' |
| 219 | - . '(:userId,:credentialId,:credential,:algo,:presenceLevel,:isResidentKey,:signCounter,:friendlyName,:hashedId)', |
|
| 219 | + . '(:userId,:credentialId,:credential,:algo,:presenceLevel,:isResidentKey,:signCounter,:friendlyName,:hashedId)', |
|
| 220 | 220 | [ |
| 221 | 221 | 'userId' => $userId, |
| 222 | 222 | 'credentialId' => $credentialId, |
@@ -93,8 +93,8 @@ discard block |
||
| 93 | 93 | public static function loadState(string $id, string $stage, bool $allowMissing = false): ?array |
| 94 | 94 | { |
| 95 | 95 | return [ |
| 96 | - 'FIDO2AuthSuccessful' => true, |
|
| 97 | - 'FIDO2PasswordlessAuthMode' => false, |
|
| 96 | + 'FIDO2AuthSuccessful' => true, |
|
| 97 | + 'FIDO2PasswordlessAuthMode' => false, |
|
| 98 | 98 | ]; |
| 99 | 99 | } |
| 100 | 100 | }); |
@@ -154,8 +154,8 @@ discard block |
||
| 154 | 154 | public static function loadState(string $id, string $stage, bool $allowMissing = false): ?array |
| 155 | 155 | { |
| 156 | 156 | return [ |
| 157 | - 'FIDO2AuthSuccessful' => true, |
|
| 158 | - 'FIDO2PasswordlessAuthMode' => false, |
|
| 157 | + 'FIDO2AuthSuccessful' => true, |
|
| 158 | + 'FIDO2PasswordlessAuthMode' => false, |
|
| 159 | 159 | ]; |
| 160 | 160 | } |
| 161 | 161 | }); |
@@ -189,8 +189,8 @@ discard block |
||
| 189 | 189 | 'FIDO2AuthSuccessful' => false, |
| 190 | 190 | 'FIDO2Tokens' => [0 => "foo"], |
| 191 | 191 | 'FIDO2WantsRegister' => false, |
| 192 | - 'UseInflowRegistration' => false, |
|
| 193 | - 'FIDO2PasswordlessAuthMode' => false, |
|
| 192 | + 'UseInflowRegistration' => false, |
|
| 193 | + 'FIDO2PasswordlessAuthMode' => false, |
|
| 194 | 194 | ]; |
| 195 | 195 | } |
| 196 | 196 | }); |
@@ -85,8 +85,8 @@ |
||
| 85 | 85 | 'FIDO2Scope' => 'Ducktown', |
| 86 | 86 | 'FIDO2Tokens' => [], |
| 87 | 87 | 'FIDO2SignupChallenge' => 'abc123', |
| 88 | - 'FIDO2AuthSuccessful' => true, |
|
| 89 | - 'FIDO2PasswordlessAuthMode' => false, |
|
| 88 | + 'FIDO2AuthSuccessful' => true, |
|
| 89 | + 'FIDO2PasswordlessAuthMode' => false, |
|
| 90 | 90 | 'requestTokenModel' => 'something', |
| 91 | 91 | ]; |
| 92 | 92 | } |
@@ -53,11 +53,11 @@ discard block |
||
| 53 | 53 | 'simplesaml' |
| 54 | 54 | ); |
| 55 | 55 | |
| 56 | - $this->module_config = []; |
|
| 57 | - $this->module_config = Configuration::loadFromArray( |
|
| 58 | - [ |
|
| 59 | - 'registration' => ['use_inflow_registration' => true], |
|
| 60 | - ]); |
|
| 56 | + $this->module_config = []; |
|
| 57 | + $this->module_config = Configuration::loadFromArray( |
|
| 58 | + [ |
|
| 59 | + 'registration' => ['use_inflow_registration' => true], |
|
| 60 | + ]); |
|
| 61 | 61 | |
| 62 | 62 | $this->session = Session::getSessionFromRequest(); |
| 63 | 63 | |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | { |
| 67 | 67 | // do nothing |
| 68 | 68 | } |
| 69 | - }; |
|
| 69 | + }; |
|
| 70 | 70 | Configuration::setPreLoadedConfig($this->config, 'config.php'); |
| 71 | 71 | Configuration::setPreLoadedConfig($this->module_config, 'module_webauthn.php'); |
| 72 | 72 | } |
@@ -96,11 +96,11 @@ discard block |
||
| 96 | 96 | 'FIDO2Scope' => 'Ducktown', |
| 97 | 97 | 'FIDO2Tokens' => [0 => 'A1B2C3', 1 => 'D4E5F6'], |
| 98 | 98 | 'FIDO2SignupChallenge' => 'A1B2C3', |
| 99 | - 'FIDO2WantsRegister' => false, |
|
| 100 | - 'FIDO2PasswordlessAuthMode' => false, |
|
| 99 | + 'FIDO2WantsRegister' => false, |
|
| 100 | + 'FIDO2PasswordlessAuthMode' => false, |
|
| 101 | 101 | 'FIDO2AuthSuccessful' => false, |
| 102 | - 'requestTokenModel' => 'something', |
|
| 103 | - 'Source' => 'There is no real auth source in this test.', |
|
| 102 | + 'requestTokenModel' => 'something', |
|
| 103 | + 'Source' => 'There is no real auth source in this test.', |
|
| 104 | 104 | ]; |
| 105 | 105 | } |
| 106 | 106 | }); |