Return Result instead of Option

This commit is contained in:
Julien Cretin
2022-07-01 13:26:35 +02:00
parent 30a3205fa7
commit ecb98b0f58
4 changed files with 24 additions and 27 deletions

View File

@@ -93,9 +93,7 @@ fn enumerate_credentials_response(
key_id: credential_id,
transports: None, // You can set USB as a hint here.
};
let public_key = private_key
.get_pub_key(env)
.ok_or(Ctap2StatusCode::CTAP2_ERR_VENDOR_INTERNAL_ERROR)?;
let public_key = private_key.get_pub_key(env)?;
Ok(AuthenticatorCredentialManagementResponse {
user: Some(user),
credential_id: Some(credential_id),