Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
fusiondirectory
WebAuthn
Commits
e62a6615
Commit
e62a6615
authored
4 years ago
by
Lukas Buchs
Browse files
Options
Download
Patches
Plain Diff
Bugfix u2f
parent
40bbbc1b
master
v2.0.0-beta
v1.1.3
v1.1.2
v1.1.1
v1.1.0
v1.0.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/Attestation/Format/U2f.php
+3
-4
src/Attestation/Format/U2f.php
with
3 additions
and
4 deletions
+3
-4
src/Attestation/Format/U2f.php
+
3
−
4
View file @
e62a6615
...
...
@@ -7,7 +7,7 @@ use lbuchs\WebAuthn\WebAuthnException;
use
lbuchs\WebAuthn\Binary\ByteBuffer
;
class
U2f
extends
FormatBase
{
private
$_alg
;
private
$_alg
=
-
7
;
private
$_signature
;
private
$_x5c
;
...
...
@@ -17,8 +17,8 @@ class U2f extends FormatBase {
// check u2f data
$attStmt
=
$this
->
_attestationObject
[
'attStmt'
];
if
(
!
\
array_key_exists
(
'alg'
,
$attStmt
)
||
$this
->
_getCoseAlgorithm
(
$attStmt
[
'alg'
])
===
null
)
{
throw
new
WebAuthnException
(
'u
nsupported alg:
'
.
$attStmt
[
'alg'
],
WebAuthnException
::
INVALID_DATA
);
if
(
\
array_key_exists
(
'alg'
,
$attStmt
)
&&
$attStmt
[
'alg'
]
!==
$this
->
_alg
)
{
throw
new
WebAuthnException
(
'u
2f only accepts algorithm -7 ("ES256"), but got
'
.
$attStmt
[
'alg'
],
WebAuthnException
::
INVALID_DATA
);
}
if
(
!
\
array_key_exists
(
'sig'
,
$attStmt
)
||
!
\
is_object
(
$attStmt
[
'sig'
])
||
!
(
$attStmt
[
'sig'
]
instanceof
ByteBuffer
))
{
...
...
@@ -33,7 +33,6 @@ class U2f extends FormatBase {
throw
new
WebAuthnException
(
'invalid x5c certificate'
,
WebAuthnException
::
INVALID_DATA
);
}
$this
->
_alg
=
$attStmt
[
'alg'
];
$this
->
_signature
=
$attStmt
[
'sig'
]
->
getBinaryString
();
$this
->
_x5c
=
$attStmt
[
'x5c'
][
0
]
->
getBinaryString
();
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets