Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(connect): skip fw hash check when binary too tiny (DX) #15201

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

Lemonexe
Copy link
Contributor

@Lemonexe Lemonexe commented Nov 4, 2024

Description

When FW binary is only a git LFS pointer (which is the case on all web dev deployments), FW hash is mismatched so you get Ghost modal even with legit physical Trezor - example.

➡️ ignore the FW hash check for too small binary files

👀 You can verify on this dev deployment

ℹ️ This is DX only thing, won't happen in production

@@ -773,8 +773,9 @@ export class Device extends TypedEmitter<DeviceEvents> {

const btcOnly = this.firmwareType === FirmwareType.BitcoinOnly;
const binary = await getBinaryOptional({ baseUrl, btcOnly, release });
if (binary === null) {
if (binary === null || binary.byteLength < 200) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would personally be more explicit, something like

if (binary.byteLenght < 200) {
  log('skipping too small);
...
}

otherwise 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done ✔️

@Lemonexe Lemonexe force-pushed the fix/fw-hash-check-with-lfs-pointer branch from 00ba609 to 9a0ce11 Compare November 5, 2024 08:18
@Lemonexe Lemonexe force-pushed the fix/fw-hash-check-with-lfs-pointer branch from 9a0ce11 to f330e63 Compare November 5, 2024 09:09
@Lemonexe Lemonexe marked this pull request as ready for review November 5, 2024 09:45
@Lemonexe Lemonexe merged commit 584d742 into develop Nov 5, 2024
62 checks passed
@Lemonexe Lemonexe deleted the fix/fw-hash-check-with-lfs-pointer branch November 5, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants