Fix cleanup code
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
parent
3aae30c224
commit
1a45c713f0
2 changed files with 6 additions and 0 deletions
|
@ -311,7 +311,10 @@ static int aead_encrypt( psa_key_id_t key, psa_algorithm_t alg,
|
||||||
|
|
||||||
olen = p - out;
|
olen = p - out;
|
||||||
print_out( "aead ", out, olen );
|
print_out( "aead ", out, olen );
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
/* required on errors, harmless on success */
|
||||||
|
psa_aead_abort( &op );
|
||||||
return( status );
|
return( status );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -336,6 +339,8 @@ static psa_status_t aead( const char *info )
|
||||||
msg2_part2, sizeof( msg2_part2 ) ) );
|
msg2_part2, sizeof( msg2_part2 ) ) );
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
|
psa_destroy_key( key );
|
||||||
|
|
||||||
return( status );
|
return( status );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -150,6 +150,7 @@ psa_status_t mac(void)
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
psa_mac_abort( &op );
|
psa_mac_abort( &op );
|
||||||
|
psa_destroy_key( key );
|
||||||
|
|
||||||
return( status );
|
return( status );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue