chroe: rename var

This commit is contained in:
2022-03-27 13:54:17 +08:00
parent dc64cf202c
commit 03dfbe40d8

View File

@@ -64,20 +64,20 @@ pub struct U2fRegistrationData {
impl U2fRegistrationData {
pub fn from(app_id: &str, client_data: &str, register_result: RegisterResult) -> XResult<Self> {
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(&register_result),
device_name: rr.device_name,
device_name: registration.device_name,
client_data: client_data.into(),
registration_data: base64::encode(&register_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),
})
}
}