@@ -106,8 +106,8 @@ |
||
| 106 | 106 | { |
| 107 | 107 | $path = SSPConfig::getConfigDir().'/'.self::AAGUID_CONFIG_FILE; |
| 108 | 108 | if (!file_exists($path)) { |
| 109 | - Logger::warning('Missing "webauthn_tokens.json" configuration file. No device will be recognized.'); |
|
| 110 | - return []; |
|
| 109 | + Logger::warning('Missing "webauthn_tokens.json" configuration file. No device will be recognized.'); |
|
| 110 | + return []; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | $data = file_get_contents($path); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | private function loadAAGUIDTable() |
| 106 | 106 | { |
| 107 | - $path = SSPConfig::getConfigDir().'/'.self::AAGUID_CONFIG_FILE; |
|
| 107 | + $path = SSPConfig::getConfigDir() . '/' . self::AAGUID_CONFIG_FILE; |
|
| 108 | 108 | if (!file_exists($path)) { |
| 109 | 109 | Logger::warning('Missing "webauthn_tokens.json" configuration file. No device will be recognized.'); |
| 110 | 110 | return []; |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $json = json_decode($data, true); |
| 115 | 115 | if (!is_array($json)) { |
| 116 | 116 | // there was probably an error decoding the config, log the error and pray for the best |
| 117 | - Logger::warning('Broken configuration file "'.$path.'": could not JSON-decode it.'); |
|
| 117 | + Logger::warning('Broken configuration file "' . $path . '": could not JSON-decode it.'); |
|
| 118 | 118 | return []; |
| 119 | 119 | } |
| 120 | 120 | return $json; |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require_once(dirname(dirname(dirname(__DIR__))).'/vendor/autoload.php'); |
|
| 3 | +require_once(dirname(dirname(dirname(__DIR__))) . '/vendor/autoload.php'); |
|
| 4 | 4 | |
| 5 | 5 | use Lcobucci\JWT\Parser; |
| 6 | 6 | use SimpleSAML\Utils\Config as SSPConfig; |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | ); |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | -$toc = file_get_contents('https://mds2.fidoalliance.org/?token='.$argv[1]); |
|
| 15 | +$toc = file_get_contents('https://mds2.fidoalliance.org/?token=' . $argv[1]); |
|
| 16 | 16 | |
| 17 | 17 | const YUBICO_CA = "MIIDHjCCAgagAwIBAgIEG0BT9zANBgkqhkiG9w0BAQsFADAuMSwwKgYDVQQDEyNZdWJpY28gVTJGIFJvb3QgQ0EgU2VyaWFsIDQ1NzIwMDYzMTAgFw0xNDA4MDEwMDAwMDBaGA8yMDUwMDkwNDAwMDAwMFowLjEsMCoGA1UEAxMjWXViaWNvIFUyRiBSb290IENBIFNlcmlhbCA0NTcyMDA2MzEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC/jwYuhBVlqaiYWEMsrWFisgJ+PtM91eSrpI4TK7U53mwCIawSDHy8vUmk5N2KAj9abvT9NP5SMS1hQi3usxoYGonXQgfO6ZXyUA9a+KAkqdFnBnlyugSeCOep8EdZFfsaRFtMjkwz5Gcz2Py4vIYvCdMHPtwaz0bVuzneueIEz6TnQjE63Rdt2zbwnebwTG5ZybeWSwbzy+BJ34ZHcUhPAY89yJQXuE0IzMZFcEBbPNRbWECRKgjq//qT9nmDOFVlSRCt2wiqPSzluwn+v+suQEBsUjTGMEd25tKXXTkNW21wIWbxeSyUoTXwLvGS6xlwQSgNpk2qXYwf8iXg7VWZAgMBAAGjQjBAMB0GA1UdDgQWBBQgIvz0bNGJhjgpToksyKpP9xv9oDAPBgNVHRMECDAGAQH/AgEAMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAQEAjvjuOMDSa+JXFCLyBKsycXtBVZsJ4Ue3LbaEsPY4MYN/hIQ5ZM5p7EjfcnMG4CtYkNsfNHc0AhBLdq45rnT87q/6O3vUEtNMafbhU6kthX7Y+9XFN9NpmYxr+ekVY5xOxi8h9JDIgoMP4VB1uS0aunL1IGqrNooL9mmFnL2kLVVee6/VR6C5+KSTCMCWppMuJIZII2v9o4dkoZ8Y7QRjQlLfYzd3qGtKbw7xaF1UsG/5xUb/Btwb2X2g4InpiB/yt/3CpQXpiWX/K4mBvUKiGn05ZsqeY1gx4g0xLBqcU9psmyPzK+Vsgw2jeRQ5JlKDyqE0hebfC1tvFu0CCrJFcw=="; |
| 18 | 18 | |
@@ -20,13 +20,13 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | $res = []; |
| 22 | 22 | foreach ($token->getClaim('entries') as $oneEntryObject) { |
| 23 | - $thisUrl = $oneEntryObject->url."?token=".$argv[1]; |
|
| 23 | + $thisUrl = $oneEntryObject->url . "?token=" . $argv[1]; |
|
| 24 | 24 | $mdB64 = file_get_contents($thisUrl); |
| 25 | 25 | $mdArray = json_decode(base64_decode($mdB64), true); |
| 26 | 26 | if (isset($mdArray['aaguid']) && isset($mdArray['attestationRootCertificates'][0])) { |
| 27 | 27 | $compressedAaguid = strtolower(str_replace('-', '', $mdArray['aaguid'])); |
| 28 | 28 | // we need C and O values for the attestation certificates. Extract those from the first root |
| 29 | - $x509 = openssl_x509_parse("-----BEGIN CERTIFICATE-----\n".$mdArray['attestationRootCertificates'][0]."\n-----END CERTIFICATE-----"); |
|
| 29 | + $x509 = openssl_x509_parse("-----BEGIN CERTIFICATE-----\n" . $mdArray['attestationRootCertificates'][0] . "\n-----END CERTIFICATE-----"); |
|
| 30 | 30 | // print_r($x509); |
| 31 | 31 | if (isset($x509['subject']['C']) && isset($x509['subject']['O'])) { |
| 32 | 32 | $res[$compressedAaguid] = [ |
@@ -91,6 +91,6 @@ discard block |
||
| 91 | 91 | ]; |
| 92 | 92 | |
| 93 | 93 | file_put_contents( |
| 94 | - SSPConfig::getConfigDir().'/'.WebAuthnRegistrationEvent::AAGUID_CONFIG_FILE, |
|
| 94 | + SSPConfig::getConfigDir() . '/' . WebAuthnRegistrationEvent::AAGUID_CONFIG_FILE, |
|
| 95 | 95 | json_encode($res, JSON_PRETTY_PRINT) |
| 96 | 96 | ); |