Skip to content

Fix hash calculation when both signature sections start in the same chunk - #268

Open
datah4zard wants to merge 1 commit into
AppImageCommunity:mainfrom
datah4zard:fix-hash-section-skipping
Open

datah4zard wants to merge 1 commit into
AppImageCommunity:mainfrom
datah4zard:fix-hash-section-skipping

Conversation

@datah4zard

@datah4zard datah4zard commented Oct 30, 2026 •

Copy link
Copy Markdown

readBytes() subtracted the cumulative number of bytes read into the chunk buffer from bytesLeftInChunk, rather than the number of bytes it had just read. When .sha256_sig and .sig_key both begin within the same 4 KiB chunk, readBytes() is called a second time in that chunk, so bytesLeftInChunk is decremented by too much and the rest of the chunk is dropped from the hash.

The standard type2 runtime places these sections in different chunks, so this went unnoticed. uruntime places both in the same chunk, so correctly signed uruntime-based AppImages fail validation.

Tested the fix against my project's AppImage, which uses uruntime. Also tested a standard runtime AppImage to ensure validation still passes for those.

@datah4zard

Copy link
Copy Markdown
Author

The CI failures don't seem to be related to my change. It's failing to pull Docker images.

@TheAssassin

Copy link
Copy Markdown
Member

@datah4zard seems reasonable. Could you provide an example AppImage to test against, please?

@TheAssassin

Copy link
Copy Markdown
Member

I'll have a look at the CI problems.

@datah4zard

Copy link
Copy Markdown
Author

@datah4zard seems reasonable. Could you provide an example AppImage to test against, please?

Our pipeline actually just put one out with my GPG signature on it: https://github.com/OpenFusionProject/OpenFusionLauncher/releases/download/2.4.0-beta.1/OpenFusionLauncher.AppImage

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