LedgerHQ / app-vechain

Apache License 2.0
6 stars 11 forks source link

Bad signature on some edge case #24

Closed xchapron-ledger closed 1 month ago

xchapron-ledger commented 11 months ago

In https://github.com/LedgerHQ/app-vechain/blob/develop/src/main.c#L647-L652 if rLength == 31, which can happen, then the signature will be invalid and transaction will be rejected by the blockchain. A simpler implementation would be using cx_ecdsa_sign_rs_no_throw,a nd best would be changing all the crypto call to use directly helpers from https://github.com/LedgerHQ/ledger-secure-sdk/blob/master/lib_standard_app/crypto_helpers.h