NobGit
public nobgit read

NobMail

Based on mailcow: dockerized

Languages

Repository composition by tracked source files.

PHP
PHP 49% JavaScript 35% HTML 9% CSS 4% Shell 2% Python 1% Lua 0% Perl 0% Ruby 0% SCSS 0%
Create file Wiki Documentation
Clone
https://nobgit.com/orgs/nobgit/nobmail.git
ssh://[email protected]:2222/orgs/nobgit/nobmail.git

Trace

data/web/inc/lib/WebAuthn/Attestation/Format/Apple.php

Trace helps you understand code history line by line. See who changed each line, when it changed, and which commit introduced it.

Apple.php on main
Author Date Commit Line Code
andryyy over 5 years ago 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
1
<?php
Open commit View diff
1 <?php
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
2
Open commit View diff
2
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
3
Open commit View diff
3
FreddlePat over 4 years ago d1d1340

migrating from u2f-api.js to webauthn

Full commit hash
d1d134038ffa2bde66ccfafd842dcafe5eb3ea11
Author
FreddlePat <[email protected]>
Date
over 4 years ago
Selected line
4
namespace lbuchs\WebAuthn\Attestation\Format;
Open commit View diff
4 namespace lbuchs\WebAuthn\Attestation\Format;
same change d1d1340

migrating from u2f-api.js to webauthn

Full commit hash
d1d134038ffa2bde66ccfafd842dcafe5eb3ea11
Author
FreddlePat <[email protected]>
Date
over 4 years ago
Selected line
5
use lbuchs\WebAuthn\Attestation\AuthenticatorData;
Open commit View diff
5 use lbuchs\WebAuthn\Attestation\AuthenticatorData;
same change d1d1340

migrating from u2f-api.js to webauthn

Full commit hash
d1d134038ffa2bde66ccfafd842dcafe5eb3ea11
Author
FreddlePat <[email protected]>
Date
over 4 years ago
Selected line
6
use lbuchs\WebAuthn\WebAuthnException;
Open commit View diff
6 use lbuchs\WebAuthn\WebAuthnException;
same change d1d1340

migrating from u2f-api.js to webauthn

Full commit hash
d1d134038ffa2bde66ccfafd842dcafe5eb3ea11
Author
FreddlePat <[email protected]>
Date
over 4 years ago
Selected line
7
use lbuchs\WebAuthn\Binary\ByteBuffer;
Open commit View diff
7 use lbuchs\WebAuthn\Binary\ByteBuffer;
andryyy over 5 years ago 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
8
Open commit View diff
8
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
9
class Apple extends FormatBase {
Open commit View diff
9 class Apple extends FormatBase {
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
10
    private $_x5c;
Open commit View diff
10 private $_x5c;
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
11
Open commit View diff
11
FreddlePat over 4 years ago d1d1340

migrating from u2f-api.js to webauthn

Full commit hash
d1d134038ffa2bde66ccfafd842dcafe5eb3ea11
Author
FreddlePat <[email protected]>
Date
over 4 years ago
Selected line
12
    public function __construct($AttestionObject, AuthenticatorData $authenticatorData) {
Open commit View diff
12 public function __construct($AttestionObject, AuthenticatorData $authenticatorData) {
andryyy over 5 years ago 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
13
        parent::__construct($AttestionObject, $authenticatorData);
Open commit View diff
13 parent::__construct($AttestionObject, $authenticatorData);
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
14
Open commit View diff
14
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
15
        // check packed data
Open commit View diff
15 // check packed data
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
16
        $attStmt = $this->_attestationObject['attStmt'];
Open commit View diff
16 $attStmt = $this->_attestationObject['attStmt'];
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
17
Open commit View diff
17
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
18
Open commit View diff
18
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
19
        // certificate for validation
Open commit View diff
19 // certificate for validation
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
20
        if (\array_key_exists('x5c', $attStmt) && \is_array($attStmt['x5c']) && \count($attStmt['x5c']) > 0) {
Open commit View diff
20 if (\array_key_exists('x5c', $attStmt) && \is_array($attStmt['x5c']) && \count($attStmt['x5c']) > 0) {
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
21
Open commit View diff
21
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
22
            // The attestation certificate attestnCert MUST be the first element in the array
Open commit View diff
22 // The attestation certificate attestnCert MUST be the first element in the array
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
23
            $attestnCert = array_shift($attStmt['x5c']);
Open commit View diff
23 $attestnCert = array_shift($attStmt['x5c']);
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
24
Open commit View diff
24
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
25
            if (!($attestnCert instanceof ByteBuffer)) {
Open commit View diff
25 if (!($attestnCert instanceof ByteBuffer)) {
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
26
                throw new WebAuthnException('invalid x5c certificate', WebAuthnException::INVALID_DATA);
Open commit View diff
26 throw new WebAuthnException('invalid x5c certificate', WebAuthnException::INVALID_DATA);
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
27
            }
Open commit View diff
27 }
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
28
Open commit View diff
28
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
29
            $this->_x5c = $attestnCert->getBinaryString();
Open commit View diff
29 $this->_x5c = $attestnCert->getBinaryString();
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
30
Open commit View diff
30
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
31
            // certificate chain
Open commit View diff
31 // certificate chain
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
32
            foreach ($attStmt['x5c'] as $chain) {
Open commit View diff
32 foreach ($attStmt['x5c'] as $chain) {
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
33
                if ($chain instanceof ByteBuffer) {
Open commit View diff
33 if ($chain instanceof ByteBuffer) {
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
34
                    $this->_x5c_chain[] = $chain->getBinaryString();
Open commit View diff
34 $this->_x5c_chain[] = $chain->getBinaryString();
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
35
                }
Open commit View diff
35 }
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
36
            }
Open commit View diff
36 }
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
37
        } else {
Open commit View diff
37 } else {
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
38
            throw new WebAuthnException('invalid Apple attestation statement: missing x5c', WebAuthnException::INVALID_DATA);
Open commit View diff
38 throw new WebAuthnException('invalid Apple attestation statement: missing x5c', WebAuthnException::INVALID_DATA);
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
39
        }
Open commit View diff
39 }
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
40
    }
Open commit View diff
40 }
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
41
Open commit View diff
41
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
42
Open commit View diff
42
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
43
    /*
Open commit View diff
43 /*
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
44
     * returns the key certificate in PEM format
Open commit View diff
44 * returns the key certificate in PEM format
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
45
     * @return string|null
Open commit View diff
45 * @return string|null
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
46
     */
Open commit View diff
46 */
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
47
    public function getCertificatePem() {
Open commit View diff
47 public function getCertificatePem() {
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
48
        return $this->_createCertificatePem($this->_x5c);
Open commit View diff
48 return $this->_createCertificatePem($this->_x5c);
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
49
    }
Open commit View diff
49 }
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
50
Open commit View diff
50
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
51
    /**
Open commit View diff
51 /**
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
52
     * @param string $clientDataHash
Open commit View diff
52 * @param string $clientDataHash
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
53
     */
Open commit View diff
53 */
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
54
    public function validateAttestation($clientDataHash) {
Open commit View diff
54 public function validateAttestation($clientDataHash) {
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
55
        return $this->_validateOverX5c($clientDataHash);
Open commit View diff
55 return $this->_validateOverX5c($clientDataHash);
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
56
    }
Open commit View diff
56 }
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
57
Open commit View diff
57
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
58
    /**
Open commit View diff
58 /**
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
59
     * validates the certificate against root certificates
Open commit View diff
59 * validates the certificate against root certificates
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
60
     * @param array $rootCas
Open commit View diff
60 * @param array $rootCas
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
61
     * @return boolean
Open commit View diff
61 * @return boolean
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
62
     * @throws WebAuthnException
Open commit View diff
62 * @throws WebAuthnException
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
63
     */
Open commit View diff
63 */
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
64
    public function validateRootCertificate($rootCas) {
Open commit View diff
64 public function validateRootCertificate($rootCas) {
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
65
        $chainC = $this->_createX5cChainFile();
Open commit View diff
65 $chainC = $this->_createX5cChainFile();
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
66
        if ($chainC) {
Open commit View diff
66 if ($chainC) {
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
67
            $rootCas[] = $chainC;
Open commit View diff
67 $rootCas[] = $chainC;
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
68
        }
Open commit View diff
68 }
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
69
Open commit View diff
69
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
70
        $v = \openssl_x509_checkpurpose($this->getCertificatePem(), -1, $rootCas);
Open commit View diff
70 $v = \openssl_x509_checkpurpose($this->getCertificatePem(), -1, $rootCas);
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
71
        if ($v === -1) {
Open commit View diff
71 if ($v === -1) {
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
72
            throw new WebAuthnException('error on validating root certificate: ' . \openssl_error_string(), WebAuthnException::CERTIFICATE_NOT_TRUSTED);
Open commit View diff
72 throw new WebAuthnException('error on validating root certificate: ' . \openssl_error_string(), WebAuthnException::CERTIFICATE_NOT_TRUSTED);
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
73
        }
Open commit View diff
73 }
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
74
        return $v;
Open commit View diff
74 return $v;
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
75
    }
Open commit View diff
75 }
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
76
Open commit View diff
76
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
77
    /**
Open commit View diff
77 /**
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
78
     * validate if x5c is present
Open commit View diff
78 * validate if x5c is present
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
79
     * @param string $clientDataHash
Open commit View diff
79 * @param string $clientDataHash
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
80
     * @return bool
Open commit View diff
80 * @return bool
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
81
     * @throws WebAuthnException
Open commit View diff
81 * @throws WebAuthnException
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
82
     */
Open commit View diff
82 */
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
83
    protected function _validateOverX5c($clientDataHash) {
Open commit View diff
83 protected function _validateOverX5c($clientDataHash) {
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
84
        $publicKey = \openssl_pkey_get_public($this->getCertificatePem());
Open commit View diff
84 $publicKey = \openssl_pkey_get_public($this->getCertificatePem());
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
85
Open commit View diff
85
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
86
        if ($publicKey === false) {
Open commit View diff
86 if ($publicKey === false) {
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
87
            throw new WebAuthnException('invalid public key: ' . \openssl_error_string(), WebAuthnException::INVALID_PUBLIC_KEY);
Open commit View diff
87 throw new WebAuthnException('invalid public key: ' . \openssl_error_string(), WebAuthnException::INVALID_PUBLIC_KEY);
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
88
        }
Open commit View diff
88 }
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
89
Open commit View diff
89
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
90
        // Concatenate authenticatorData and clientDataHash to form nonceToHash.
Open commit View diff
90 // Concatenate authenticatorData and clientDataHash to form nonceToHash.
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
91
        $nonceToHash = $this->_authenticatorData->getBinary();
Open commit View diff
91 $nonceToHash = $this->_authenticatorData->getBinary();
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
92
        $nonceToHash .= $clientDataHash;
Open commit View diff
92 $nonceToHash .= $clientDataHash;
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
93
Open commit View diff
93
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
94
        // Perform SHA-256 hash of nonceToHash to produce nonce
Open commit View diff
94 // Perform SHA-256 hash of nonceToHash to produce nonce
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
95
        $nonce = hash('SHA256', $nonceToHash, true);
Open commit View diff
95 $nonce = hash('SHA256', $nonceToHash, true);
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
96
Open commit View diff
96
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
97
        $credCert = openssl_x509_read($this->getCertificatePem());
Open commit View diff
97 $credCert = openssl_x509_read($this->getCertificatePem());
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
98
        if ($credCert === false) {
Open commit View diff
98 if ($credCert === false) {
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
99
            throw new WebAuthnException('invalid x5c certificate: ' . \openssl_error_string(), WebAuthnException::INVALID_DATA);
Open commit View diff
99 throw new WebAuthnException('invalid x5c certificate: ' . \openssl_error_string(), WebAuthnException::INVALID_DATA);
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
100
        }
Open commit View diff
100 }
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
101
Open commit View diff
101
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
102
        $keyData = openssl_pkey_get_details(openssl_pkey_get_public($credCert));
Open commit View diff
102 $keyData = openssl_pkey_get_details(openssl_pkey_get_public($credCert));
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
103
        $key = is_array($keyData) && array_key_exists('key', $keyData) ? $keyData['key'] : null;
Open commit View diff
103 $key = is_array($keyData) && array_key_exists('key', $keyData) ? $keyData['key'] : null;
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
104
Open commit View diff
104
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
105
Open commit View diff
105
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
106
        // Verify that nonce equals the value of the extension with OID ( 1.2.840.113635.100.8.2 ) in credCert.
Open commit View diff
106 // Verify that nonce equals the value of the extension with OID ( 1.2.840.113635.100.8.2 ) in credCert.
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
107
        $parsedCredCert = openssl_x509_parse($credCert);
Open commit View diff
107 $parsedCredCert = openssl_x509_parse($credCert);
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
108
        $nonceExtension = isset($parsedCredCert['extensions']['1.2.840.113635.100.8.2']) ? $parsedCredCert['extensions']['1.2.840.113635.100.8.2'] : '';
Open commit View diff
108 $nonceExtension = isset($parsedCredCert['extensions']['1.2.840.113635.100.8.2']) ? $parsedCredCert['extensions']['1.2.840.113635.100.8.2'] : '';
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
109
Open commit View diff
109
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
110
        // nonce padded by ASN.1 string: 30 24 A1 22 04 20
Open commit View diff
110 // nonce padded by ASN.1 string: 30 24 A1 22 04 20
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
111
        // 30     — type tag indicating sequence
Open commit View diff
111 // 30 — type tag indicating sequence
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
112
        // 24     — 36 byte following
Open commit View diff
112 // 24 — 36 byte following
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
113
        //   A1   — Enumerated [1]
Open commit View diff
113 // A1 — Enumerated [1]
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
114
        //   22   — 34 byte following
Open commit View diff
114 // 22 — 34 byte following
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
115
        //     04 — type tag indicating octet string
Open commit View diff
115 // 04 — type tag indicating octet string
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
116
        //     20 — 32 byte following
Open commit View diff
116 // 20 — 32 byte following
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
117
Open commit View diff
117
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
118
        $asn1Padding = "\x30\x24\xA1\x22\x04\x20";
Open commit View diff
118 $asn1Padding = "\x30\x24\xA1\x22\x04\x20";
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
119
        if (substr($nonceExtension, 0, strlen($asn1Padding)) === $asn1Padding) {
Open commit View diff
119 if (substr($nonceExtension, 0, strlen($asn1Padding)) === $asn1Padding) {
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
120
            $nonceExtension = substr($nonceExtension, strlen($asn1Padding));
Open commit View diff
120 $nonceExtension = substr($nonceExtension, strlen($asn1Padding));
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
121
        }
Open commit View diff
121 }
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
122
Open commit View diff
122
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
123
        if ($nonceExtension !== $nonce) {
Open commit View diff
123 if ($nonceExtension !== $nonce) {
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
124
            throw new WebAuthnException('nonce doesn\'t equal the value of the extension with OID 1.2.840.113635.100.8.2', WebAuthnException::INVALID_DATA);
Open commit View diff
124 throw new WebAuthnException('nonce doesn\'t equal the value of the extension with OID 1.2.840.113635.100.8.2', WebAuthnException::INVALID_DATA);
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
125
        }
Open commit View diff
125 }
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
126
Open commit View diff
126
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
127
        // Verify that the credential public key equals the Subject Public Key of credCert.
Open commit View diff
127 // Verify that the credential public key equals the Subject Public Key of credCert.
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
128
        $authKeyData = openssl_pkey_get_details(openssl_pkey_get_public($this->_authenticatorData->getPublicKeyPem()));
Open commit View diff
128 $authKeyData = openssl_pkey_get_details(openssl_pkey_get_public($this->_authenticatorData->getPublicKeyPem()));
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
129
        $authKey = is_array($authKeyData) && array_key_exists('key', $authKeyData) ? $authKeyData['key'] : null;
Open commit View diff
129 $authKey = is_array($authKeyData) && array_key_exists('key', $authKeyData) ? $authKeyData['key'] : null;
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
130
Open commit View diff
130
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
131
        if ($key === null || $key !== $authKey) {
Open commit View diff
131 if ($key === null || $key !== $authKey) {
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
132
            throw new WebAuthnException('credential public key doesn\'t equal the Subject Public Key of credCert', WebAuthnException::INVALID_DATA);
Open commit View diff
132 throw new WebAuthnException('credential public key doesn\'t equal the Subject Public Key of credCert', WebAuthnException::INVALID_DATA);
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
133
        }
Open commit View diff
133 }
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
134
Open commit View diff
134
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
135
        return true;
Open commit View diff
135 return true;
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
136
    }
Open commit View diff
136 }
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
137
Open commit View diff
137
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
138
}
Open commit View diff
138 }
same change 46643af

[Web] FIDO2: Add Face ID via Apple

Full commit hash
46643af00c8a8612081b933e027541838245b578
Author
andryyy <[email protected]>
Date
over 5 years ago
Selected line
139
Open commit View diff
139