libfido2-util: Refactor pre-flight failure handling
authorPeter Cai <peter@typeblog.net>
Wed, 23 Nov 2022 13:43:22 +0000 (08:43 -0500)
committerPeter Cai <peter@typeblog.net>
Sat, 10 Dec 2022 20:28:49 +0000 (15:28 -0500)
commit2a469016e392159d435c1f0afed3740fe784a8b3
treedee80faf88057511b1024a4469d5248de79e7616
parent5d2c1ce4e4c9f903b5c064f67a59c2e0b0dbd037
libfido2-util: Refactor pre-flight failure handling

`fido2_is_cred_in_specific_token()` should simply not return error codes
for non-fatal errors. For example, `-ENODEV` can be safely translated to
a `false` return value. When the pre-flight request is not supported, we
should simply return true to instruct the caller to attempt to use the
device anyway.

All error codes returned by the funtion should now be fatal and logged
at error level. Non-fatal errors should only appear in debug logs.
src/shared/libfido2-util.c