File tree 2 files changed +4
-1
lines changed
2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -664,6 +664,7 @@ int cmd_cipher_sym() {
664
664
secret [64 ] = { 0 };
665
665
mbedtls_aes_init (& ctx );
666
666
if (hd_keytype != 0x3 ) {
667
+ mbedtls_ecdsa_free (& hd_context );
667
668
return SW_INCORRECT_PARAMS ();
668
669
}
669
670
key_size = 32 ;
Original file line number Diff line number Diff line change @@ -284,11 +284,13 @@ int cmd_signature() {
284
284
}
285
285
else if (p2 == ALGO_HD ) {
286
286
size_t olen = 0 ;
287
- uint8_t buf [MBEDTLS_ECDSA_MAX_LEN ];
287
+ uint8_t buf [MBEDTLS_ECDSA_MAX_LEN ] = { 0 } ;
288
288
if (hd_context .grp .id == MBEDTLS_ECP_DP_NONE ) {
289
+ mbedtls_ecdsa_free (& hd_context );
289
290
return SW_CONDITIONS_NOT_SATISFIED ();
290
291
}
291
292
if (hd_keytype != 0x1 && hd_keytype != 0x2 ) {
293
+ mbedtls_ecdsa_free (& hd_context );
292
294
return SW_INCORRECT_PARAMS ();
293
295
}
294
296
md = MBEDTLS_MD_SHA256 ;
You can’t perform that action at this time.
0 commit comments