-
Notifications
You must be signed in to change notification settings - Fork 2
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
check UI hashes Part 2 #48
Conversation
matthme
commented
Mar 18, 2024
- computes the hashes from the bytes in memory instead of writing them to a zip file in the temp directory
- adds better error handling when checking hashes before serving asset to happ window
- adds test for IntegrityChecker
…is requested that's not in the list of originally installed files
src/main/tests/integrityChecker.ts
Outdated
iC.storeToSignedJSON(filePath, writeData); | ||
// tamper with file | ||
const readString = fs.readFileSync(filePath, 'utf-8'); | ||
fs.writeFileSync(filePath, readString + 'tampered'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I's be careful to maintain the structure of the file here. This could (and I think will) throw because the content is no longer valid JSON. It's the signature that's important here so it needs to be that error that gets thrown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
valid point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, should be addressed with the latest commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just one comment on the tampering test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!