-
Notifications
You must be signed in to change notification settings - Fork 159
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
Change attstmt to handle x5c array/list #781
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.
Thank you for the contribution! This looks very close to what we had in mind. I left a few comments in-line.
@LDVG do note this is my first PR, ever. Also, am usually not good at naming functions/variables (still learning). So, feel free to correct them :) |
We'll ponder on what to call them as the dust settles. FWIW, I think the current naming is fine. :-)
The code that this PR touches is common for all platforms that we support, so that should be fine. P.S.: I think |
Ah, my bad, got missed when adding. Pushed now.. |
d22b809
to
138bd1c
Compare
I added a couple of minor tweaks on top of your commits. For some reason, this caused GitHub's UI to not recognize your account authoring them anymore, despite the commits having the same SHA as previously (maybe it doesn't recognize your author email address?). If this is important to you and you want to correct this, you can feel free to squash your commits and my tweaks down to one commit. :-) |
@LDVG I dont see any option other than using git rebase or reset and doing a commit again, but I dont know what side effects it might have. So, is it possible for you to squash them? |
Adds explicit checks that the target array is empty when we parse the CBOR map. This triggers a failure for malformed responses with duplicate keys.
138bd1c
to
2e2d5c8
Compare
I went ahead and squashed them, by rebasing. :-) This looks good to me, thanks for your contribution and congratulations on your first GitHub PR! |
Thank you @LDVG . Appreciate your guidance, certainly learned new things from you. |
According to webauthn spec the x5c object under attStmt is of array type. But current code stores only the leaf certificate and discards the other certificates - reported as #749. This patch attempts to fix that.
Summary of changes,
x5c
object underfido_attstmt
isfido_blob_array_t
type.decode_x5c
andfido_cred_set_x509
is updated to store as array.fido_cred_x5c_ptr
andfido_cred_x5c_len
are updated to retain backward compatibility; they now work with first certificate in the list.fido_cred_x5c_list_count
added to return number of certificates in the x5c.fido_cred_x5c_list_ptr
added to return requested certificate data in the x5c.fido_cred_x5c_list_len
added to return byte length of requested certificate in the x5c.