[fido] Improve CtapDeviceResponseCode handling
Improve handling conversion between a byte and a CtapDeviceResponseCode: * Fix undefined behaviour from static_cast'ing a byte before verifying it's in the CtapDeviceResponseCode enum. * Log the byte we actually received when we get an error, instead of converting the response code back into a byte. This way, we log codes we don't know about and save me some emabarrassment when reporting bugs to authenticator vendors. * Convert the list of codes into a shiny new constexpr flat_set. Now we don't have to manually increase the array size to avoid the compiler yelling at us. * Add some missing CTAP codes. * Add a logging for bad GetInfo responses. Fixed: 1148479 Change-Id: Ic8966f4c881d4a6c7872ed8dc6cbf1a5fd05377a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2562973 Commit-Queue: Nina Satragno <nsatragno@chromium.org> Commit-Queue: Martin Kreichgauer <martinkr@google.com> Auto-Submit: Nina Satragno <nsatragno@chromium.org> Reviewed-by:Martin Kreichgauer <martinkr@google.com> Cr-Commit-Position: refs/heads/master@{#832121}
Showing
Please register or sign in to comment