You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The parseGetVersionResponse function seems to be incorrectly updating the offset counter after reading the SE target id. I believe it is due to a copy paste error.
// flags. gives information about manager allowed in SE mode.
constflagsLength=data[i++];
letflags=data.slice(i,i+flagsLength);
i+=flagsLength;
Later when parsing the SE target id (in case the target id corresponds to a bootloader one and it's either the new or old format but WE CAN'T know this is not documented), the offset counter is updated by the value of the length of the flags slice, not the length of the SE target id slice!
In passing, please document your APDU protocol. This is really not a fun exercise to have to reverse-engineer it from the confusing Ledger Live codebase.
Expected behavior
I don't think this changes the behaviour but could lead to a pretty nasty bug should this function be updated in the future.
Additional context
No response
The text was updated successfully, but these errors were encountered:
Impacted Library name
No response
Impacted Library version
No response
Describe the bug
The
parseGetVersionResponse
function seems to be incorrectly updating the offset counter after reading the SE target id. I believe it is due to a copy paste error.Earlier in the function the flags are parsed:
ledger-live/libs/device-core/src/commands/use-cases/parseGetVersionResponse.ts
Lines 20 to 23 in dd1d17f
Later when parsing the SE target id (in case the target id corresponds to a bootloader one and it's either the new or old format but WE CAN'T know this is not documented), the offset counter is updated by the value of the length of the flags slice, not the length of the SE target id slice!
ledger-live/libs/device-core/src/commands/use-cases/parseGetVersionResponse.ts
Lines 56 to 58 in dd1d17f
In passing, please document your APDU protocol. This is really not a fun exercise to have to reverse-engineer it from the confusing Ledger Live codebase.
Expected behavior
I don't think this changes the behaviour but could lead to a pretty nasty bug should this function be updated in the future.
Additional context
No response
The text was updated successfully, but these errors were encountered: