@@ -119,16 +119,16 @@ impl Task {
119119 if let Some ( handle) = cryp_state. get_object_handle ( false )
120120 && tee_obj_map. exists ( handle)
121121 {
122- if cfg ! ( debug_assertions) {
123- todo ! ( "support two-key algorithms" ) ;
124- }
122+ # [ cfg( debug_assertions) ]
123+ todo ! ( "support two-key algorithms" ) ;
124+ # [ cfg ( not ( debug_assertions ) ) ]
125125 return Err ( TeeResult :: NotSupported ) ;
126126 }
127127
128128 let Some ( cipher) = create_cipher ( cryp_state. algorithm ( ) , key, iv) else {
129- if cfg ! ( debug_assertions) {
130- todo ! ( "implement algorithm {}" , cryp_state. algorithm( ) as u32 ) ;
131- }
129+ # [ cfg( debug_assertions) ]
130+ todo ! ( "implement algorithm {}" , cryp_state. algorithm( ) as u32 ) ;
131+ # [ cfg ( not ( debug_assertions ) ) ]
132132 return Err ( TeeResult :: NotSupported ) ;
133133 } ;
134134 tee_cryp_state_map. set_cipher ( state, & cipher) ?;
@@ -174,9 +174,9 @@ impl Task {
174174 // Check last_block before applying the cipher so we don't mutate
175175 // dst_slice and then return an error.
176176 if last_block {
177- if cfg ! ( debug_assertions) {
178- todo ! ( "support algorithms which have a certain finalization logic" ) ;
179- }
177+ # [ cfg( debug_assertions) ]
178+ todo ! ( "support algorithms which have a certain finalization logic" ) ;
179+ # [ cfg ( not ( debug_assertions ) ) ]
180180 return Err ( TeeResult :: NotSupported ) ;
181181 }
182182 if let Some ( state_entry) = map. get_mut ( & state)
@@ -195,8 +195,13 @@ impl Task {
195195 }
196196 }
197197 * dst_len = src_slice. len ( ) ;
198+ Ok ( ( ) )
199+ } else {
200+ #[ cfg( debug_assertions) ]
201+ todo ! ( "handle unimplemented cipher" ) ;
202+ #[ cfg( not( debug_assertions) ) ]
203+ Err ( TeeResult :: NotImplemented )
198204 }
199- Ok ( ( ) )
200205 } else {
201206 Err ( TeeResult :: BadParameters )
202207 }
@@ -260,9 +265,9 @@ impl Task {
260265 ) -> Result < ( ) , TeeResult > {
261266 let tee_obj_map = & self . tee_obj_map ;
262267 if attrs. len ( ) > 1 {
263- if cfg ! ( debug_assertions) {
264- todo ! ( "handle multiple attributes" ) ;
265- }
268+ # [ cfg( debug_assertions) ]
269+ todo ! ( "handle multiple attributes" ) ;
270+ # [ cfg ( not ( debug_assertions ) ) ]
266271 return Err ( TeeResult :: NotSupported ) ;
267272 }
268273 if !tee_obj_map. exists ( obj) {
0 commit comments