Abstract attestation support
This commit is contained in:
@@ -12,8 +12,8 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use crate::api::key_store;
|
||||
use crate::api::user_presence::UserPresenceError;
|
||||
use crate::api::{attestation_store, key_store};
|
||||
|
||||
// CTAP specification (version 20190130) section 6.3
|
||||
// For now, only the CTAP2 codes are here, the CTAP1 are not included.
|
||||
@@ -100,3 +100,14 @@ impl From<key_store::Error> for Ctap2StatusCode {
|
||||
Self::CTAP2_ERR_VENDOR_INTERNAL_ERROR
|
||||
}
|
||||
}
|
||||
|
||||
impl From<attestation_store::Error> for Ctap2StatusCode {
|
||||
fn from(error: attestation_store::Error) -> Self {
|
||||
use attestation_store::Error;
|
||||
match error {
|
||||
Error::Storage => Self::CTAP2_ERR_VENDOR_HARDWARE_FAILURE,
|
||||
Error::Internal => Self::CTAP2_ERR_VENDOR_INTERNAL_ERROR,
|
||||
Error::NoSupport => Self::CTAP2_ERR_VENDOR_INTERNAL_ERROR,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user