@@ -7,7 +7,7 @@ use super::{
77use crate :: authenticators:: ApplicationName ;
88use crate :: key_info_managers:: KeyTriple ;
99use crate :: key_info_managers:: { self , ManageKeyInfo } ;
10- use log:: { error, info, warn} ;
10+ use log:: { error, info, trace , warn} ;
1111use parsec_interface:: operations:: psa_key_attributes:: * ;
1212use parsec_interface:: operations:: {
1313 psa_destroy_key, psa_export_public_key, psa_generate_key, psa_import_key,
@@ -116,12 +116,15 @@ impl Pkcs11Provider {
116116 KeyPairType :: Any => ( ) ,
117117 }
118118
119+ trace ! ( "FindObjectsInit command" ) ;
119120 if let Err ( e) = self . backend . find_objects_init ( session, & template) {
120121 format_error ! ( "Object enumeration init failed" , e) ;
121122 Err ( utils:: to_response_status ( e) )
122123 } else {
124+ trace ! ( "FindObjects command" ) ;
123125 match self . backend . find_objects ( session, 1 ) {
124126 Ok ( objects) => {
127+ trace ! ( "FindObjectsFinal command" ) ;
125128 if let Err ( e) = self . backend . find_objects_final ( session) {
126129 format_error ! ( "Object enumeration final failed" , e) ;
127130 Err ( utils:: to_response_status ( e) )
@@ -220,6 +223,7 @@ impl Pkcs11Provider {
220223 ) ;
221224 }
222225
226+ trace ! ( "GenerateKeyPair command" ) ;
223227 match self . backend . generate_key_pair (
224228 session. session_handle ( ) ,
225229 & mech,
@@ -362,6 +366,7 @@ impl Pkcs11Provider {
362366 ) ;
363367 }
364368
369+ trace ! ( "CreateObject command" ) ;
365370 match self
366371 . backend
367372 . create_object ( session. session_handle ( ) , & template)
@@ -408,6 +413,7 @@ impl Pkcs11Provider {
408413 size_attrs. push ( CK_ATTRIBUTE :: new ( pkcs11:: types:: CKA_PUBLIC_EXPONENT ) ) ;
409414
410415 // Get the length of the attributes to retrieve.
416+ trace ! ( "GetAttributeValue command" ) ;
411417 let ( modulus_len, public_exponent_len) =
412418 match self
413419 . backend
@@ -440,6 +446,7 @@ impl Pkcs11Provider {
440446 . with_bytes ( public_exponent. as_mut_slice ( ) ) ,
441447 ) ;
442448
449+ trace ! ( "GetAttributeValue command" ) ;
443450 match self
444451 . backend
445452 . get_attribute_value ( session. session_handle ( ) , key, & mut extract_attrs)
@@ -502,6 +509,7 @@ impl Pkcs11Provider {
502509
503510 match self . find_key ( session. session_handle ( ) , key_id, KeyPairType :: Any ) {
504511 Ok ( key) => {
512+ trace ! ( "DestroyObject command" ) ;
505513 match self . backend . destroy_object ( session. session_handle ( ) , key) {
506514 Ok ( _) => info ! ( "Private part of the key destroyed successfully." ) ,
507515 Err ( e) => {
@@ -519,6 +527,7 @@ impl Pkcs11Provider {
519527 // Second key is optional.
520528 match self . find_key ( session. session_handle ( ) , key_id, KeyPairType :: Any ) {
521529 Ok ( key) => {
530+ trace ! ( "DestroyObject command" ) ;
522531 match self . backend . destroy_object ( session. session_handle ( ) , key) {
523532 Ok ( _) => info ! ( "Private part of the key destroyed successfully." ) ,
524533 Err ( e) => {
0 commit comments