Passed
Push — master ( 14ac2c...66a8f3 )
by Tim
02:14
created
lib/WebAuthn/WebAuthnRegistrationEvent.php 1 patch
Spacing   +6 added lines, -6 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'])) {
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
               . " - "
Please login to merge, or discard this patch.