-
Notifications
You must be signed in to change notification settings - Fork 152
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
Allow multiple cred pub key types during credential creation #722
base: main
Are you sure you want to change the base?
Conversation
… creation Add a member of type `fido_blob_t` named `type_winhello` to `fido_cred_t`. Add `fido_cred_set_type_winhello` which takes a pointer to an array of 32 bit signed integers and length. The old `type` member of `fido_cred_t` is set to the first element of this array of public key types. It is stored as a `fido_blob_t`. Create a copy of `decode_attcred` as `decode_attcred_multiple_cose` to handle using the list of key types. Create a copy of `cbor_decode_cred_authdata` as `cbor_decode_cred_authdata_multiple_cose` to handle using the array of key types.
Seems like my warnings generated more warnings. Will fix and get it building properly first. |
I hadn't paid attention to the open issues, but this should partially resolve the issue #140 for the windows hello case |
Hi, Thank you for your contribution. This does seem like a use-case we want to support. As you have found out already, there is an open issue on the same topic and I'd probably want to see an API which would suit all of our transport layers rather than something Having briefly thought about this, maybe it'd be sufficient to apart from the above:
You may see that this bears a lot of similarities with the approach you've already implemented but would allow for us to drop the (duplicated) What do you think about such an approach? |
Hi @LDVG, Thank you for the feedback on my implementation. In my haste to implement this functionality I tried to ensure the existing mechanism for setting the credential type was not touched at all, which is why I went with adding a second field and API set. For a proper implementation though I agree with your approach, this would allow the existing uses of the public API I haven't looked too much at the usages of the |
…owershell Invoke-WebRequest commandlet
Hi @LDVG , |
Actually, looks like I forgot the new setter on |
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.
Thanks for the update! This looks similar to what I had in mind. I've left a couple of high-level comments that may warrant some discussion:
add fido_int_array_contains() fix check in u2f.c initialize fido_int_array_t in touch.c remove len field, only use count and compute len as needed. return attested credential type in fido_cred_get_type() fix an issue with creating only an array of 1 elements in cbor.c
(body = cbor_new_definite_map(2)) == NULL || | ||
cose_alg > -1 || cose_alg < INT16_MIN) | ||
goto fail; | ||
if ((item = cbor_new_definite_array(cose_alg_array->count)) == NULL) |
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.
Might be good to check the length of cose_alg_array
and error out if it's zero before creating these structs in libcbor
Add a member of type
fido_blob_t
namedtype_winhello
tofido_cred_t
.Add
fido_cred_set_type_winhello
which takes a pointer to an array of 32 bit signed integers and length. The oldtype
member offido_cred_t
is set to the first element of this array of public key types. It is stored as afido_blob_t
.Create a copy of
decode_attcred
asdecode_attcred_multiple_cose
to handle using the list of key types.Create a copy of
cbor_decode_cred_authdata
ascbor_decode_cred_authdata_multiple_cose
to handle using the array of key types.When translating back from windows hello to libfido2 cred, set the existing cred type field to the type that was returned.
This is work that was done to support using Windows Hello face/pin and common USB authenticators in a single call to
fido_dev_make_cred
instead of having to call it once for each type.What I found in practice is that RP's that request both RS256 and ES256 required me to pick which one to try. Windows Hello face/pin only supports RS256, but most of the USB authenticators I tried only supported ES256. When setting the cred type to only ES256, Windows Hello gave me the option for face/pin but failed. When setting to only RS256, face/pin works but USB keys failed. By setting both and passing that along to Windows Webauthn API's, either one works and the credential is returned with the actual type that was used. This also helps avoid a situation where if you specify only RS256 you get a Windows Hello prompt, but if you cancel then it still seems to ask if you want to use USB authenticators, and it gets stuck into an infinite cycle where you can input pin/touch the key and then get prompted to input pin/touch key repeatedly unless you cancel, most likely due to the USB authenticator not supporting RS256.