Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenSK
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
koenigl2
OpenSK
Commits
a64d5d41
Commit
a64d5d41
authored
4 years ago
by
Fabian Kaczmarczyck
Browse files
Options
Downloads
Patches
Plain Diff
accept the algorithm identifier used by OpenSSH
parent
690db41d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ctap/data_formats.rs
+3
-1
3 additions, 1 deletion
src/ctap/data_formats.rs
with
3 additions
and
1 deletion
src/ctap/data_formats.rs
+
3
−
1
View file @
a64d5d41
...
...
@@ -462,6 +462,8 @@ pub struct CoseKey(pub BTreeMap<cbor::KeyType, cbor::Value>);
// here: https://www.iana.org/assignments/cose/cose.xhtml#algorithms
// In fact, this is just used for compatibility with older specification versions.
const
ECDH_ALGORITHM
:
i64
=
-
25
;
// This is the identifier used by OpenSSH. To be compatible, we accept both.
const
ES256_ALGORITHM
:
i64
=
-
7
;
const
EC2_KEY_TYPE
:
i64
=
2
;
const
P_256_CURVE
:
i64
=
1
;
...
...
@@ -497,7 +499,7 @@ impl TryFrom<CoseKey> for ecdh::PubKey {
return
Err
(
Ctap2StatusCode
::
CTAP2_ERR_UNSUPPORTED_ALGORITHM
);
}
let
algorithm
=
read_integer
(
ok_or_missing
(
cose_key
.0
.get
(
&
cbor_int!
(
3
)))
?
)
?
;
if
algorithm
!=
ECDH_ALGORITHM
{
if
algorithm
!=
ECDH_ALGORITHM
&&
algorithm
!=
ES256_ALGORITHM
{
return
Err
(
Ctap2StatusCode
::
CTAP2_ERR_UNSUPPORTED_ALGORITHM
);
}
let
curve
=
read_integer
(
ok_or_missing
(
cose_key
.0
.get
(
&
cbor_int!
(
-
1
)))
?
)
?
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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