Passed
Pull Request — master (#39)
by Tim
03:06
created
templates/webauthn.tpl.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -9,21 +9,21 @@  discard block
 block discarded – undo
9 9
 
10 10
     <h1><?php echo htmlspecialchars($this->t('{webauthn:webauthn:heading1}')); ?></h1>
11 11
     <h2><?php echo htmlspecialchars($this->t('{webauthn:webauthn:accountEnabled}')); ?></h2>
12
-    <?php if((isset($this->data['FIDO2Tokens'])?((is_array($this->data['FIDO2Tokens']) || $this->data['FIDO2Tokens'] instanceof Countable)?count($this->data['FIDO2Tokens']):strlen($this->data['FIDO2Tokens'])):0) > 0): ?>
12
+    <?php if ((isset($this->data['FIDO2Tokens']) ? ((is_array($this->data['FIDO2Tokens']) || $this->data['FIDO2Tokens'] instanceof Countable) ?count($this->data['FIDO2Tokens']) : strlen($this->data['FIDO2Tokens'])) : 0) > 0) : ?>
13 13
         <div id="currentTokens">
14 14
             <span id='tokencaption'><?php echo htmlspecialchars($this->t('{webauthn:webauthn:tokenList}')); ?></span>
15 15
             <ul>
16
-                <?php foreach($this->data['FIDO2Tokens'] as $index => $this->data['token']): ?>
17
-                    <?php if($this->data['FIDO2AuthSuccessful'] == false or $this->data['FIDO2AuthSuccessful'] != $this->data['token'][0]): ?>
16
+                <?php foreach ($this->data['FIDO2Tokens'] as $index => $this->data['token']): ?>
17
+                    <?php if ($this->data['FIDO2AuthSuccessful'] == false or $this->data['FIDO2AuthSuccessful'] != $this->data['token'][0]): ?>
18 18
                         <li class='othertoken'><?php echo htmlspecialchars($this->data['token'][3]); ?></li>
19 19
                     <?php else: ?>
20 20
                         <li class='currenttoken'><?php echo htmlspecialchars($this->data['token'][3]); ?> <?php echo htmlspecialchars($this->t('{webauthn:webauthn:currentToken}')); ?></li>
21 21
                     <?php endif; ?>
22
-                <?php endforeach;?>
22
+                <?php endforeach; ?>
23 23
             </ul>
24 24
         </div>
25 25
     <?php endif; ?>
26
-    <?php if((isset($this->data['regURL'])?((is_array($this->data['regURL']) || $this->data['regURL'] instanceof Countable)?count($this->data['regURL']):strlen($this->data['regURL'])):0) > 0): ?>
26
+    <?php if ((isset($this->data['regURL']) ? ((is_array($this->data['regURL']) || $this->data['regURL'] instanceof Countable) ?count($this->data['regURL']) : strlen($this->data['regURL'])) : 0) > 0) : ?>
27 27
         <form id='regform' method='POST' action='<?php echo $this->data['regURL']; ?>'>
28 28
             <input type='hidden' id='resp' name='response_id' value='0'/>
29 29
             <input type='hidden' id='data' name='attestation_client_data_json' value='nix'/>
@@ -36,9 +36,9 @@  discard block
 block discarded – undo
36 36
                 value='<?php echo htmlspecialchars($this->t('{webauthn:webauthn:newTokenDefaultName}')); ?> <?php echo htmlspecialchars((new DateTime("now"))->format('Y-m-d')); ?>' />
37 37
         </form>
38 38
         <div class='space'></div>
39
-        <?php if((isset($this->data['FIDO2Tokens'])?((is_array($this->data['FIDO2Tokens']) || $this->data['FIDO2Tokens'] instanceof Countable)?count($this->data['FIDO2Tokens']):strlen($this->data['FIDO2Tokens'])):0) > 0): ?>
40
-            <?php foreach($this->data['FIDO2Tokens'] as $index => $this->data['token']): ?>
41
-                <?php if($this->data['FIDO2AuthSuccessful'] != $this->data['token'][0]): ?>
39
+        <?php if ((isset($this->data['FIDO2Tokens']) ? ((is_array($this->data['FIDO2Tokens']) || $this->data['FIDO2Tokens'] instanceof Countable) ?count($this->data['FIDO2Tokens']) : strlen($this->data['FIDO2Tokens'])) : 0) > 0) : ?>
40
+            <?php foreach ($this->data['FIDO2Tokens'] as $index => $this->data['token']): ?>
41
+                <?php if ($this->data['FIDO2AuthSuccessful'] != $this->data['token'][0]): ?>
42 42
                     <form class='deleteform' id='delete-<?php echo htmlspecialchars($index); ?>' method='POST' action='<?php echo $this->data['delURL']; ?>'>
43 43
                         <input type='hidden' id='credId-<?php echo htmlspecialchars($index); ?>' name='credId' value='<?php echo htmlspecialchars($this->data['token'][0]); ?>'/>
44 44
                         <button type='submit' id='submit-<?php echo htmlspecialchars($index); ?>' name='submit' value='DELETE'>
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
                         </button>
47 47
                     </form>
48 48
                 <?php endif; ?>
49
-            <?php endforeach;?>
49
+            <?php endforeach; ?>
50 50
             <div class='space'></div>
51 51
             <form id='nevermind' method='POST' action='<?php echo $this->data['delURL']; ?>'>
52 52
                 <button type='submit' id='submit-nevermind' name='submit' value='NEVERMIND'>
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
             </form>
56 56
         <?php endif; ?>
57 57
     <?php endif; ?>
58
-    <?php if((isset($this->data['authURL'])?((is_array($this->data['authURL']) || $this->data['authURL'] instanceof Countable)?count($this->data['authURL']):strlen($this->data['authURL'])):0) > 0): ?>
58
+    <?php if ((isset($this->data['authURL']) ? ((is_array($this->data['authURL']) || $this->data['authURL'] instanceof Countable) ?count($this->data['authURL']) : strlen($this->data['authURL'])) : 0) > 0) : ?>
59 59
         <form id='authform' method='POST' action='<?php echo $this->data['authURL']; ?>'>
60 60
             <input type='hidden' id='resp' name='response_id' value='0'/>
61 61
             <input type='hidden' id='data_raw_b64' name='client_data_raw' value='garnix'/>
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
             <input type='hidden' id='operation' name='operation' value='AUTH'/>
68 68
             <input type='checkbox' id='credentialChange' name='credentialChange'>
69 69
             <label for='credentialChange'>
70
-                <?php if((isset($this->data['FIDO2Tokens'])?((is_array($this->data['FIDO2Tokens']) || $this->data['FIDO2Tokens'] instanceof Countable)?count($this->data['FIDO2Tokens']):strlen($this->data['FIDO2Tokens'])):0) < 2): ?>
70
+                <?php if ((isset($this->data['FIDO2Tokens']) ? ((is_array($this->data['FIDO2Tokens']) || $this->data['FIDO2Tokens'] instanceof Countable) ?count($this->data['FIDO2Tokens']) : strlen($this->data['FIDO2Tokens'])) : 0) < 2) : ?>
71 71
                     <?php echo htmlspecialchars($this->t('{webauthn:webauthn:wantsAdd}')); ?>
72 72
                 <?php else: ?>
73 73
                     <?php echo htmlspecialchars($this->t('{webauthn:webauthn:wantsModification}')); ?>
Please login to merge, or discard this patch.
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,8 +16,11 @@  discard block
 block discarded – undo
16 16
                 <?php foreach($this->data['FIDO2Tokens'] as $index => $this->data['token']): ?>
17 17
                     <?php if($this->data['FIDO2AuthSuccessful'] == false or $this->data['FIDO2AuthSuccessful'] != $this->data['token'][0]): ?>
18 18
                         <li class='othertoken'><?php echo htmlspecialchars($this->data['token'][3]); ?></li>
19
-                    <?php else: ?>
20
-                        <li class='currenttoken'><?php echo htmlspecialchars($this->data['token'][3]); ?> <?php echo htmlspecialchars($this->t('{webauthn:webauthn:currentToken}')); ?></li>
19
+                    <?php else {
20
+    : ?>
21
+                        <li class='currenttoken'><?php echo htmlspecialchars($this->data['token'][3]);
22
+}
23
+?> <?php echo htmlspecialchars($this->t('{webauthn:webauthn:currentToken}')); ?></li>
21 24
                     <?php endif; ?>
22 25
                 <?php endforeach;?>
23 26
             </ul>
@@ -69,8 +72,11 @@  discard block
 block discarded – undo
69 72
             <label for='credentialChange'>
70 73
                 <?php if((isset($this->data['FIDO2Tokens'])?((is_array($this->data['FIDO2Tokens']) || $this->data['FIDO2Tokens'] instanceof Countable)?count($this->data['FIDO2Tokens']):strlen($this->data['FIDO2Tokens'])):0) < 2): ?>
71 74
                     <?php echo htmlspecialchars($this->t('{webauthn:webauthn:wantsAdd}')); ?>
72
-                <?php else: ?>
73
-                    <?php echo htmlspecialchars($this->t('{webauthn:webauthn:wantsModification}')); ?>
75
+                <?php else {
76
+    : ?>
77
+                    <?php echo htmlspecialchars($this->t('{webauthn:webauthn:wantsModification}'));
78
+}
79
+?>
74 80
                 <?php endif; ?>
75 81
             </label><br/>
76 82
             <button type='button' id='authformSubmit'><?php echo htmlspecialchars($this->t('{webauthn:webauthn:authTokenButton}')); ?></button>
Please login to merge, or discard this patch.
lib/Controller/WebAuthn.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -130,7 +130,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
lib/Controller/RegProcess.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@
 block discarded – undo
202 202
             'private'          => false,
203 203
         ]);
204 204
         $response->setExpires(new DateTime('Thu, 19 Nov 1981 08:52:00 GMT'));
205
-        */
205
+         */
206 206
 
207 207
         return $response;
208 208
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@
 block discarded – undo
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='" .
Please login to merge, or discard this patch.
lib/Controller/ManageToken.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@
 block discarded – undo
202 202
             'private'          => false,
203 203
         ]);
204 204
         $response->setExpires(new DateTime('Thu, 19 Nov 1981 08:52:00 GMT'));
205
-        */
205
+         */
206 206
 
207 207
         return $response;
208 208
     }
Please login to merge, or discard this patch.
lib/WebAuthn/WebAuthnRegistrationEvent.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
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'])) {
@@ -197,7 +197,7 @@  discard block
 block discarded – undo
197 197
            !isset($certProps['extensions']['1.2.840.113635.100.8.2'])
198 198
            || empty($certProps['extensions']['1.2.840.113635.100.8.2'])
199 199
                 ) {
200
-                    $this->fail( "The required nonce value is not present in the OID." );
200
+                    $this->fail("The required nonce value is not present in the OID.");
201 201
                 }
202 202
 	$toCompare = substr($certProps['extensions']['1.2.840.113635.100.8.2'], 6);
203 203
 	if ($nonce != $toCompare) {
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
 	}
206 206
 
207 207
 	// chain validation first
208
-	foreach ( $stmtDecoded['x5c'] as $runIndex => $runCert ) {
208
+	foreach ($stmtDecoded['x5c'] as $runIndex => $runCert) {
209 209
 		if (isset($stmtDecoded['x5c'][$runIndex + 1])) { // there is a next cert, so follow the chain
210 210
 			$certResource = openssl_x509_read(Utils\Crypto::der2pem($runCert));
211 211
 			$signerPubKey = openssl_pkey_get_public(Utils\Crypto::der2pem($stmtDecoded['x5c'][$runIndex + 1]));
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
 			$certResource = openssl_x509_read(Utils\Crypto::der2pem($runCert));
220 220
 			$signerPubKey = openssl_pkey_get_public($APPLE_WEBAUTHN_ROOT_CA);
221 221
 			if (openssl_x509_verify($certResource, $signerPubKey) != 1) {
222
-                                $this->fail("Error during root CA validation of the attestation chain certificate, which is ".Utils\Crypto::der2pem($runCert));
222
+                                $this->fail("Error during root CA validation of the attestation chain certificate, which is " . Utils\Crypto::der2pem($runCert));
223 223
                         }
224 224
 		}
225 225
 	}
@@ -251,9 +251,9 @@  discard block
 block discarded – undo
251 251
 	// § 8.8 Bullet 5
252 252
 	$credentialDetails = openssl_pkey_get_details($credentialResource);
253 253
 	$keyDetails = openssl_pkey_get_details($keyResource);
254
-	if ( $credentialDetails['bits'] != $keyDetails['bits'] ||
255
-             $credentialDetails['key']  != $keyDetails['key']  ||
256
-             $credentialDetails['type'] != $keyDetails['type'] ) { 
254
+	if ($credentialDetails['bits'] != $keyDetails['bits'] ||
255
+             $credentialDetails['key'] != $keyDetails['key'] ||
256
+             $credentialDetails['type'] != $keyDetails['type']) { 
257 257
 		$this->fail("The credential public key does not match the certificate public key in attestationData. ("
258 258
               . $credentialDetails['key'] 
259 259
               . " - "
Please login to merge, or discard this patch.
Indentation   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -119,9 +119,9 @@  discard block
 block discarded – undo
119 119
             case "android-safetynet":
120 120
                 $this->validateAttestationFormatAndroidSafetyNet($attestationArray);
121 121
                 break;
122
-	    case "apple":
123
-		$this->validateAttestationFormatApple($attestationArray);
124
-		break;
122
+        case "apple":
123
+        $this->validateAttestationFormatApple($attestationArray);
124
+        break;
125 125
             case "tpm":
126 126
             case "android-key":
127 127
                 $this->fail("Attestation format " . $attestationArray['fmt'] . " validation not supported right now.");
@@ -158,9 +158,9 @@  discard block
 block discarded – undo
158 158
     private function validateAttestationFormatApple(array $attestationArray): void
159 159
     {
160 160
 
161
-	// found at: https://www.apple.com/certificateauthority/private/
161
+    // found at: https://www.apple.com/certificateauthority/private/
162 162
 
163
-	$APPLE_WEBAUTHN_ROOT_CA = "-----BEGIN CERTIFICATE-----
163
+    $APPLE_WEBAUTHN_ROOT_CA = "-----BEGIN CERTIFICATE-----
164 164
 MIICEjCCAZmgAwIBAgIQaB0BbHo84wIlpQGUKEdXcTAKBggqhkjOPQQDAzBLMR8w
165 165
 HQYDVQQDDBZBcHBsZSBXZWJBdXRobiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJ
166 166
 bmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMB4XDTIwMDMxODE4MjEzMloXDTQ1MDMx
@@ -175,66 +175,66 @@  discard block
 block discarded – undo
175 175
 1bWeT0vT
176 176
 -----END CERTIFICATE-----";
177 177
         // § 8.8 Bullet 1 of the draft spec at https://pr-preview.s3.amazonaws.com/alanwaketan/webauthn/pull/1491.html#sctn-apple-anonymous-attestation
178
-	// draft implemented in state of 11 Feb 2021
178
+    // draft implemented in state of 11 Feb 2021
179 179
 
180
-	// I can't help but notice that the verification procedure does NOTHING with CA certs from the chain, nor is there a root to validate to!
181
-	// Found the root CA with Google, see above, and will perform chain validation even if the spec doesn't say so.
180
+    // I can't help but notice that the verification procedure does NOTHING with CA certs from the chain, nor is there a root to validate to!
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
-	// first, clear the openssl error backlog. We might need error data in case things go sideways.
184
-	while(openssl_error_string() !== false);
183
+    // first, clear the openssl error backlog. We might need error data in case things go sideways.
184
+    while(openssl_error_string() !== false);
185 185
 
186 186
         $stmtDecoded = $attestationArray['attStmt'];
187
-	if (!isset($stmtDecoded['x5c'])) {
188
-		$this->fail("Apple attestation statement does not contain an x5c attestation statement!");
189
-	}
190
-	// § 8.8 Bullet 2
187
+    if (!isset($stmtDecoded['x5c'])) {
188
+        $this->fail("Apple attestation statement does not contain an x5c attestation statement!");
189
+    }
190
+    // § 8.8 Bullet 2
191 191
         $nonceToHash = $attestationArray['authData'] . $this->clientDataHash;
192
-	// § 8.8 Bullet 3
193
-	$nonce = hash("sha256", $nonceToHash, TRUE); // does raw_output have to be FALSE or TRUE?
192
+    // § 8.8 Bullet 3
193
+    $nonce = hash("sha256", $nonceToHash, TRUE); // does raw_output have to be FALSE or TRUE?
194 194
         $certProps = openssl_x509_parse(Utils\Crypto::der2pem($stmtDecoded['x5c'][0]));	
195
-	// § 8.8 Bullet 4
195
+    // § 8.8 Bullet 4
196 196
         if (
197
-           !isset($certProps['extensions']['1.2.840.113635.100.8.2'])
197
+            !isset($certProps['extensions']['1.2.840.113635.100.8.2'])
198 198
            || empty($certProps['extensions']['1.2.840.113635.100.8.2'])
199 199
                 ) {
200 200
                     $this->fail( "The required nonce value is not present in the OID." );
201 201
                 }
202
-	$toCompare = substr($certProps['extensions']['1.2.840.113635.100.8.2'], 6);
203
-	if ($nonce != $toCompare) {
204
-		$this->fail("There is a mismatch between the nonce and the OID (XXX $nonce XXX , XXX $toCompare XXX ).");
205
-	}
202
+    $toCompare = substr($certProps['extensions']['1.2.840.113635.100.8.2'], 6);
203
+    if ($nonce != $toCompare) {
204
+        $this->fail("There is a mismatch between the nonce and the OID (XXX $nonce XXX , XXX $toCompare XXX ).");
205
+    }
206 206
 
207
-	// chain validation first
208
-	foreach ( $stmtDecoded['x5c'] as $runIndex => $runCert ) {
209
-		if (isset($stmtDecoded['x5c'][$runIndex + 1])) { // there is a next cert, so follow the chain
210
-			$certResource = openssl_x509_read(Utils\Crypto::der2pem($runCert));
211
-			$signerPubKey = openssl_pkey_get_public(Utils\Crypto::der2pem($stmtDecoded['x5c'][$runIndex + 1]));
212
-			if (openssl_x509_verify($certResource, $signerPubKey) != 1) {
213
-				$this->fail("Error during chain validation of the attestation certificate (while validating cert #$runIndex, which is "
207
+    // chain validation first
208
+    foreach ( $stmtDecoded['x5c'] as $runIndex => $runCert ) {
209
+        if (isset($stmtDecoded['x5c'][$runIndex + 1])) { // there is a next cert, so follow the chain
210
+            $certResource = openssl_x509_read(Utils\Crypto::der2pem($runCert));
211
+            $signerPubKey = openssl_pkey_get_public(Utils\Crypto::der2pem($stmtDecoded['x5c'][$runIndex + 1]));
212
+            if (openssl_x509_verify($certResource, $signerPubKey) != 1) {
213
+                $this->fail("Error during chain validation of the attestation certificate (while validating cert #$runIndex, which is "
214 214
                                     . Utils\Crypto::der2pem($runCert)
215 215
                                     . "; next cert was "
216 216
                                     . Utils\Crypto::der2pem($stmtDecoded['x5c'][$runIndex + 1]));
217
-			}
218
-		} else { // last cert, compare to the root
219
-			$certResource = openssl_x509_read(Utils\Crypto::der2pem($runCert));
220
-			$signerPubKey = openssl_pkey_get_public($APPLE_WEBAUTHN_ROOT_CA);
221
-			if (openssl_x509_verify($certResource, $signerPubKey) != 1) {
217
+            }
218
+        } else { // last cert, compare to the root
219
+            $certResource = openssl_x509_read(Utils\Crypto::der2pem($runCert));
220
+            $signerPubKey = openssl_pkey_get_public($APPLE_WEBAUTHN_ROOT_CA);
221
+            if (openssl_x509_verify($certResource, $signerPubKey) != 1) {
222 222
                                 $this->fail("Error during root CA validation of the attestation chain certificate, which is ".Utils\Crypto::der2pem($runCert));
223 223
                         }
224
-		}
225
-	}
224
+        }
225
+    }
226 226
 
227 227
         $keyResource = openssl_pkey_get_public(Utils\Crypto::der2pem($stmtDecoded['x5c'][0]));
228 228
         if ($keyResource === FALSE) {
229
-		$this->fail("Did not get a parseable X.509 structure out of the Apple attestation statement - x5c nr. 0 statement was: XXX "
229
+        $this->fail("Did not get a parseable X.509 structure out of the Apple attestation statement - x5c nr. 0 statement was: XXX "
230 230
                     . $stmtDecoded['x5c'][0]
231 231
                     . " XXX; PEM equivalent is "
232 232
                     . Utils\Crypto::der2pem($stmtDecoded['x5c'][0])
233 233
                     . ". OpenSSL error: "
234 234
                     . openssl_error_string()
235 235
                     );
236
-	}
237
-	// $this->credential is a public key in CBOR, not "PEM". We need to convert it first.
236
+    }
237
+    // $this->credential is a public key in CBOR, not "PEM". We need to convert it first.
238 238
         $keyArray = $this->cborDecode(hex2bin($this->credential));
239 239
         $keyObject = new Ec2Key($keyArray);
240 240
         $credentialResource = openssl_pkey_get_public($keyObject->asPEM());
@@ -248,20 +248,20 @@  discard block
 block discarded – undo
248 248
                     . openssl_error_string()
249 249
                     );
250 250
         }
251
-	// § 8.8 Bullet 5
252
-	$credentialDetails = openssl_pkey_get_details($credentialResource);
253
-	$keyDetails = openssl_pkey_get_details($keyResource);
254
-	if ( $credentialDetails['bits'] != $keyDetails['bits'] ||
251
+    // § 8.8 Bullet 5
252
+    $credentialDetails = openssl_pkey_get_details($credentialResource);
253
+    $keyDetails = openssl_pkey_get_details($keyResource);
254
+    if ( $credentialDetails['bits'] != $keyDetails['bits'] ||
255 255
              $credentialDetails['key']  != $keyDetails['key']  ||
256 256
              $credentialDetails['type'] != $keyDetails['type'] ) { 
257
-		$this->fail("The credential public key does not match the certificate public key in attestationData. ("
258
-              . $credentialDetails['key'] 
259
-              . " - "
260
-              . $keyDetails['key'] 
261
-              . ")");
262
-	}
263
-	$this->pass("Apple attestation format verification passed.");
264
-	return;
257
+        $this->fail("The credential public key does not match the certificate public key in attestationData. ("
258
+                . $credentialDetails['key'] 
259
+                . " - "
260
+                . $keyDetails['key'] 
261
+                . ")");
262
+    }
263
+    $this->pass("Apple attestation format verification passed.");
264
+    return;
265 265
     }
266 266
 
267 267
     /**
Please login to merge, or discard this patch.
templates/authentication.tpl.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 <?php $this->includeAtTemplateBase('includes/header.php'); ?>
8 8
 
9 9
     <h1><?php echo htmlspecialchars($this->t('{webauthn:webauthn:heading1}')); ?></h1>
10
-    <?php if((isset($this->data['authURL'])?((is_array($this->data['authURL']) || $this->data['authURL'] instanceof Countable)?count($this->data['authURL']):strlen($this->data['authURL'])):0) > 0): ?>
10
+    <?php if ((isset($this->data['authURL']) ? ((is_array($this->data['authURL']) || $this->data['authURL'] instanceof Countable) ?count($this->data['authURL']) : strlen($this->data['authURL'])) : 0) > 0) : ?>
11 11
         <form id='authform' method='POST' action='<?php echo $this->data['authURL']; ?>'>
12 12
             <input type='hidden' id='resp' name='response_id' value='0'/>
13 13
             <input type='hidden' id='data' name='attestation_client_data_json' value='nix'/>
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,11 @@
 block discarded – undo
18 18
             <input type='hidden' id='operation' name='operation' value='AUTH'/>
19 19
             <button type='button' id='authformSubmit'><?php echo htmlspecialchars($this->t('{webauthn:webauthn:authTokenButton}')); ?></button>
20 20
         </form>
21
-    <?php else: ?>
22
-        <p>Please first register your token on the <a href="<?php echo htmlspecialchars(SimpleSAML\Module::getModuleURL('webauthn/registration.php')); ?>">registration page</a> before continuing.
21
+    <?php else {
22
+    : ?>
23
+        <p>Please first register your token on the <a href="<?php echo htmlspecialchars(SimpleSAML\Module::getModuleURL('webauthn/registration.php'));
24
+}
25
+?>">registration page</a> before continuing.
23 26
     <?php endif; ?>
24 27
     <script src="<?php echo htmlspecialchars(SimpleSAML\Module::getModuleUrl('webauthn/')); ?>assets/js/webauthn.js"></script>
25 28
     <script src="<?php echo htmlspecialchars(SimpleSAML\Module::getModuleUrl('webauthn/')); ?>assets/js/authentication.js"></script>
Please login to merge, or discard this patch.
lib/Controller/AuthProcess.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -149,10 +149,10 @@  discard block
 block discarded – undo
149 149
         /**
150 150
          * §7.2 STEP 18 : detect physical object cloning on the token
151 151
          */
152
-	$counter = $authObject->getCounter();
153
-	if ($previousCounter == 0 && $counter == 0) {
152
+    $counter = $authObject->getCounter();
153
+    if ($previousCounter == 0 && $counter == 0) {
154 154
                 // no cloning check, it is a brand new token
155
-	} elseif ($counter > $previousCounter) {
155
+    } elseif ($counter > $previousCounter) {
156 156
             // Signature counter was incremented compared to last time, good
157 157
             $store = $state['webauthn:store'];
158 158
             $store->updateSignCount($oneToken[0], $counter);
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
             'private'          => false,
209 209
         ]);
210 210
         $response->setExpires(new DateTime('Thu, 19 Nov 1981 08:52:00 GMT'));
211
-        */
211
+         */
212 212
 
213 213
         return $response;
214 214
     }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -176,7 +176,7 @@
 block discarded – undo
176 176
 
177 177
         if ($debugEnabled) {
178 178
             $response = new RunnableResponse(;
179
-                function ($authObject, $state) {
179
+                function($authObject, $state) {
180 180
                     echo $authObject->getDebugBuffer();
181 181
                     echo $authObject->getValidateBuffer();
182 182
                     echo "Debug mode, not continuing to " . ($state['FIDO2WantsRegister'] ? "credential registration page." : "destination.");
Please login to merge, or discard this patch.