File tree 2 files changed +4
-9
lines changed
providers/trusted_service/context
2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -74,15 +74,10 @@ impl Context {
74
74
75
75
info ! ( "Obtaining a crypto Trusted Service context." ) ;
76
76
let mut status = 0 ;
77
- let service_context = unsafe {
78
- service_locator_query (
79
- CString :: new ( "sn:trustedfirmware.org:crypto:0" )
80
- . unwrap ( )
81
- . into_raw ( ) ,
82
- & mut status,
83
- )
84
- } ;
77
+ let service_name = CString :: new ( "sn:trustedfirmware.org:crypto:0" ) . unwrap ( ) ;
78
+ let service_context = unsafe { service_locator_query ( service_name. as_ptr ( ) , & mut status) } ;
85
79
if service_context. is_null ( ) {
80
+ error ! ( "Locating crypto Trusted Service failed, status: {}" , status) ;
86
81
return Err ( io:: Error :: new (
87
82
io:: ErrorKind :: Other ,
88
83
"Failed to obtain a Trusted Service context" ,
Original file line number Diff line number Diff line change @@ -370,7 +370,7 @@ unsafe fn get_provider(
370
370
}
371
371
#[ cfg( feature = "trusted-service-provider" ) ]
372
372
ProviderConfig :: TrustedService { .. } => {
373
- info ! ( "Creating a TPM Provider." ) ;
373
+ info ! ( "Creating a Trusted Service Provider." ) ;
374
374
Ok ( Some ( Arc :: new (
375
375
TrustedServiceProviderBuilder :: new ( )
376
376
. with_key_info_store ( kim_factory. build_client ( ProviderId :: TrustedService ) )
You can’t perform that action at this time.
0 commit comments