From 03dfbe40d8956e08c4ee82139a220099cd9f576a Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Sun, 27 Mar 2022 13:54:17 +0800 Subject: [PATCH] chroe: rename var --- src/fido.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fido.rs b/src/fido.rs index a98ed4d..655ca8d 100644 --- a/src/fido.rs +++ b/src/fido.rs @@ -64,20 +64,20 @@ pub struct U2fRegistrationData { impl U2fRegistrationData { pub fn from(app_id: &str, client_data: &str, register_result: RegisterResult) -> XResult { - let rr = opt_result!( + let registration = opt_result!( u2f::register::parse_registration(app_id.to_string(), client_data.as_bytes().to_vec(), register_result.0.to_vec()), "Parse registration data failed: {}"); Ok(Self { app_id: app_id.to_string(), device_info: U2FDeviceInfo::from(®ister_result), - device_name: rr.device_name, + device_name: registration.device_name, client_data: client_data.into(), registration_data: base64::encode(®ister_result.0), - attestation_cert_pem: rr.attestation_cert.map(|c| { + attestation_cert_pem: registration.attestation_cert.map(|c| { to_pem(&c, "CERTIFICATE", 64) }), - pub_key: hex::encode(rr.pub_key), - key_handle: hex::encode(rr.key_handle), + pub_key: hex::encode(registration.pub_key), + key_handle: hex::encode(registration.key_handle), }) } }