mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-23 14:58:09 +00:00
bip32: Fix NULL dereference for EdDSA
This commit is contained in:
parent
af06a997cb
commit
dfdb4d2d76
2
bip32.c
2
bip32.c
@ -94,7 +94,7 @@ int hdnode_from_xprv(uint32_t depth, uint32_t child_num, const uint8_t *chain_co
|
|||||||
const curve_info *info = get_curve_by_name(curve);
|
const curve_info *info = get_curve_by_name(curve);
|
||||||
if (info == 0) {
|
if (info == 0) {
|
||||||
failed = true;
|
failed = true;
|
||||||
} else {
|
} else if (info->params) {
|
||||||
bignum256 a;
|
bignum256 a;
|
||||||
bn_read_be(private_key, &a);
|
bn_read_be(private_key, &a);
|
||||||
if (bn_is_zero(&a)) { // == 0
|
if (bn_is_zero(&a)) { // == 0
|
||||||
|
Loading…
Reference in New Issue
Block a user