Skip to content

Commit

Permalink
lib_standard_app/crypto_helpers.c: Fix bad cleanup of private key
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Chapron committed Aug 2, 2023
1 parent 8f97df2 commit f4097de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib_standard_app/crypto_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ WARN_UNUSED_RESULT cx_err_t bip32_derive_with_seed_init_privkey_256(
CX_CHECK(cx_ecfp_init_private_key_no_throw(curve, raw_privkey, length, privkey));

end:
explicit_bzero(&raw_privkey, sizeof(raw_privkey));
explicit_bzero(raw_privkey, sizeof(raw_privkey));

if (error != CX_OK) {
// Make sure the caller doesn't use uninitialized data in case
// the return code is not checked.
explicit_bzero(&privkey, sizeof(privkey));
explicit_bzero(privkey, sizeof(cx_ecfp_256_private_key_t));
}
return error;
}
Expand Down

0 comments on commit f4097de

Please sign in to comment.