diff --git a/src/providers/trusted_service/context/mod.rs b/src/providers/trusted_service/context/mod.rs index 4210d1b2..2d0fa749 100644 --- a/src/providers/trusted_service/context/mod.rs +++ b/src/providers/trusted_service/context/mod.rs @@ -74,15 +74,10 @@ impl Context { info!("Obtaining a crypto Trusted Service context."); let mut status = 0; - let service_context = unsafe { - service_locator_query( - CString::new("sn:trustedfirmware.org:crypto:0") - .unwrap() - .into_raw(), - &mut status, - ) - }; + let service_name = CString::new("sn:trustedfirmware.org:crypto:0").unwrap(); + let service_context = unsafe { service_locator_query(service_name.as_ptr(), &mut status) }; if service_context.is_null() { + error!("Locating crypto Trusted Service failed, status: {}", status); return Err(io::Error::new( io::ErrorKind::Other, "Failed to obtain a Trusted Service context", diff --git a/src/utils/service_builder.rs b/src/utils/service_builder.rs index 8b394cf1..04ff398f 100644 --- a/src/utils/service_builder.rs +++ b/src/utils/service_builder.rs @@ -370,7 +370,7 @@ unsafe fn get_provider( } #[cfg(feature = "trusted-service-provider")] ProviderConfig::TrustedService { .. } => { - info!("Creating a TPM Provider."); + info!("Creating a Trusted Service Provider."); Ok(Some(Arc::new( TrustedServiceProviderBuilder::new() .with_key_info_store(kim_factory.build_client(ProviderId::TrustedService))