Lines Matching refs:e
71 let mut session = Session::new(Port::TamperProof, true).map_err(|e| { in new()
72 km_err!(SecureHwCommunicationFailed, "couldn't create storage session: {:?}", e) in new()
74 let secure_file = session.open_file(file_name, OpenMode::Create).map_err(|e| { in new()
75 km_err!(SecureHwCommunicationFailed, "couldn't create file {}: {:?}", file_name, e) in new()
91 session.write_all(file, data).map_err(|e| { in write_all()
92 km_err!(SecureHwCommunicationFailed, "failed to write data; received error: {:?}", e) in write_all()
130 let serialized_buffer = attestation_key_data.write_to_bytes().map_err(|e| { in write_protobuf_to_attestation_key_file()
131 km_err!(SecureHwCommunicationFailed, "couldn't serialize attestationKey: {:?}", e) in write_protobuf_to_attestation_key_file()
134 file.write_all(&serialized_buffer).map_err(|e| { in write_protobuf_to_attestation_key_file()
135 km_err!(SecureHwCommunicationFailed, "failed to provision attestation key file: {:?}", e) in write_protobuf_to_attestation_key_file()
270 let serialized_buffer = attestation_ids.write_to_bytes().map_err(|e| { in provision_attestation_id_file()
271 km_err!(SecureHwCommunicationFailed, "couldn't serialize attestationIds: {:?}", e) in provision_attestation_id_file()
274 file.write_all(&serialized_buffer).map_err(|e| { in provision_attestation_id_file()
275 km_err!(SecureHwCommunicationFailed, "failed to provision attestation IDs file: {:?}", e) in provision_attestation_id_file()
283 let mut session = Session::new(Port::TamperProof, true).map_err(|e| { in delete_attestation_ids()
284 km_err!(SecureHwCommunicationFailed, "failed to connect to storage port: {:?}", e) in delete_attestation_ids()
286 session.remove(KM_ATTESTATION_ID_FILENAME).map_err(|e| { in delete_attestation_ids()
287 km_err!(SecureHwCommunicationFailed, "failed to delete attestation IDs file: {:?}", e) in delete_attestation_ids()
294 let mut session = Session::new(Port::TamperProof, true).map_err(|e| { in get_file_contents()
295 km_err!(SecureHwCommunicationFailed, "failed to connect to storage port: {:?}", e) in get_file_contents()
302 Err(e) => { in get_file_contents()
307 e in get_file_contents()
311 let size = session.get_size(&file).map_err(|e| { in get_file_contents()
312 km_err!(SecureHwCommunicationFailed, "failed to get size for '{}': {:?}", file_name, e) in get_file_contents()
315 let content = session.read_all(&file, buffer.as_mut_slice()).map_err(|e| { in get_file_contents()
316 km_err!(SecureHwCommunicationFailed, "failed to read '{}': {:?}", file_name, e) in get_file_contents()
330 Err(e) => return Err(e), in read_attestation_ids()
334 .map_err(|e| km_err!(UnknownError, "failed to parse attestation IDs proto: {:?}", e))?; in read_attestation_ids()
367 .map_err(|e| km_err!(UnknownError, "failed to parse attestation key proto: {:?}", e))?, in read_attestation_key_content()
378 Err(e) => { in import_ec_key()
379 info!("couldn't parse as sec1 ECPrivateKey, will try as PKCS#8. Error {:?}", e); in import_ec_key()
390 Err(e) => { in import_rsa_key()
391 info!("couldn't parse PKCS#1 RSA key, will try as PKCS#8. Error {:?}", e); in import_rsa_key()
454 if let Err(e) = result { in signing_key()
455 info!("failed to read attestation key ({:?}), fall back to test key", e); in signing_key()
465 if let Err(e) = result { in cert_chain()
466 info!("failed to read attestation chain ({:?}), fall back to test chain", e); in cert_chain()