-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fido2 follow up continued #18663
base: master
Are you sure you want to change the base?
Fido2 follow up continued #18663
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm splitting review into multiple stages as that's a relatively large number of files for a subsystem with few major contributors. For this round, I'm only looking at changes visible outside the module, including the removed ztimer64 use.
Minor comments inline; one larger here:
There are several incompatible changes to the public fido2 API. Please prepare, ideally in the top post of the PR, a note that can then be placed in the release notes. It should describe to users of the API what they need to change in their applications, with emphasis on changes that might go undetected by the compiler and alter the program's meaning (such as when fido2_ctap_handle_request
returns a status code rather than a length, which the compiler may cast implicitly).
96cb0a4
to
9f341f9
Compare
9f341f9
to
a823a46
Compare
With #18637 having been merged a while a go, I would like to get this in as well. Rebased on latest master. |
@chrysn Can we get this in ? |
73e1053
to
1b20cb7
Compare
link to #19559 native is using file backed mtd |
68b8994
to
4e1b12d
Compare
4e1b12d
to
c2e5d68
Compare
i think one of the test application is "copied" ( old copy should be deleted) to the new path structure I am not sure how many users of this module are out there, this changes a lot of api from return the size of data to return an error code (misinterpretation might not be nice). |
Ah yes, I missed the directory structure changes. Will fix
Currently I don't think very many. I personally don't know of anybody. One reason for this was (at least the last time I checked) that many applications lacked FIDO2 support and only support FIDO U2F, which is not implemented in RIOT currently. I am planning to put some more work into the FIDO2 implementation in order to get a fully working RIOT security key at some point :) Either way, I don't think the API change will affect many people. |
c2e5d68
to
c11569c
Compare
please add a "cleanup" commit that fixes longlines ( >100 chars) and consecutive empty lines if possible |
sys/fido2/ctap/ctap_mem.c
Outdated
@@ -28,16 +28,22 @@ | |||
#define ENABLE_DEBUG (0) | |||
#include "debug.h" | |||
|
|||
#ifdef BOARD_NATIVE | |||
#include "mtd_default.h" | |||
// native mtd is file backed => Start address of flash is 0. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style : single line comment is too modern for RIOT
content: is that always the case
(e.g. if something else is build into the same application and is using the mtd)
or is there always a dedicated file for fido?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having a specific mtd configuration seems application specific -> ?better in test app?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is only needed when running the fido2 layer natively (for testing). In this case I set the mtd_default
because that is the only one that works correctly natively if I remember correctly.
Fixed for every location that is not a structure documentation |
@@ -47,78 +46,80 @@ static int _sig_to_der_format(uint8_t *r, uint8_t *s, uint8_t *sig, | |||
*/ | |||
static int _RNG(uint8_t *dest, unsigned size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that line is no longer needed ( since you moved the function that used that declaration)
Contribution description
This PR adds changes to make the FIDO2 API usable without a transport layer as
well as improve the overall usability. With this come changes specific to the native
target, to account for the fact that mtd flash handling is file backed in this case.
This also includes breaking changes to the public API:
ctap_status_code_t
instead of the size of the response.ctap_resp_t
.Users of the FIDO2 API need to adjust their applications to now expect a status
code as the return value of functions such as
fido2_ctap_handle_request
andexpect the length of the response in
resp->len
.To test the usability of FIDO2 without a transport layer, this PR also adds
another test module which tests the CTAP implementation without transport layer.
With the new test module being added, the old tests are renamed to
sys_fido2_ctap_hid
to highlight the fact that they test the CTAP2 implementationusing CTAPHID as transport binding.
Furthermore, this PR removes the dependency of
ctap_hid
forztimer64
ashaving 64 bit timestamps is not required.
Testing procedure
tests/sys_fido2_ctap
tests/sys_fido2_ctap_hid
Issues/PRs references
Depends on PR #18637
Issue regarding file backed flash memory on native: #19559