Repository navigation
fix: verify downloads against the checksum Foojay lists, so vfox install java@25.0.2-graalce and the like no longer end with WARNING: Checksum is not provided, skip verify... - #120
Merged
Conversation
…tall java@25.0.2-graalce` and the like no longer end with `WARNING: Checksum is not provided, skip verify...` PreInstall never gave vfox a checksum (the TODO in hooks/pre_install.lua), so vfox trusted every download. Foojay lists one for most distributions, in its record or in a file of the vendor, and the files come in four different forms. - lib/checksum.lua reads it, and PreInstall hands it to vfox under the name of its algorithm. vfox then verifies the download before it unpacks anything, and fails the install with `Checksum error` if it does not match. - A checksum file on GitHub is fetched through VFOX_JAVA_GITHUB_MIRROR. - Where Foojay has none, or the plugin cannot use what it has, the install goes on as before. In the second case the plugin says why. - Tests, e2e assertions and docs (English and Chinese).
This was referenced Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
vfox install java@25.0.2-graalceends withWARNING: Checksum is not provided, skip verify..., and so does every other install:PreInstallnever gave vfox a checksum (TODO: checksuminhooks/pre_install.lua), so vfox trusted whatever it downloaded. Foojay lists one for most distributions. For GraalVM Community 25.0.2,checksum_typeissha256andchecksum_uripoints to the vendor's.sha256file, while the record's ownchecksumis empty, so the file has to be fetched. Vendors write these files in different ways.Change
lib/checksum.lua(new) takes the digest from Foojay's record first (Temurin, Zulu, Liberica ...) and fetcheschecksum_urionly where the record has none. It reads the digest alone,sha256sum's<digest> <name>and<digest> *<name>, BSD'sMD5 (<name>) = <digest>, and listings of several files, where it takes the line of the package's file name. Only digests of the algorithm's length count, and they are lower-cased, as vfox compares the hex string as it stands.PreInstallhands the digest to vfox under the name of its algorithm (sha256,sha1,sha512ormd5). vfox printsVerifying checksum <digest>...and, before it unpacks anything, fails the install withChecksum errorif the download does not match.VFOX_JAVA_GITHUB_MIRROR, like the download.Cannot verify the download: .... Failing there would stop installs that work today: from my machine, the checksum file of Microsoft's JDK 25.0.5 times out in the TLS handshake. A file that lists other packages only gives no digest either: Microsoft's file for its EA build of 11.0.14 for macOS names the GA build..md5sumnext to each tarball, which a later change could read.tests/checksum_test.lua(new, added to the Test workflow), 22 more cases intests/pre_install_test.lua, and e2e assertions on Linux and Windows that the pinned release of each default distribution is verified (Verifying checksum <digest>..., no warning).foojay.md, andmirror.md,troubleshooting.md,development.md,e2e.mdandchanges.md(Unreleased).Verification
In Docker (
ubuntu:26.04, vfox 1.0.13):vfox install java@25.0.2-graalce: before,WARNING: Checksum is not provided, skip verify.... NowVerifying checksum e0be791c8fda4d03b6b0a0cb824fef3149736170057b3a515252b44419606af0...and no warning, throughgh-proxy.organd straight from GitHub..sha256installs, a mismatching one fails withChecksum errorand installs nothing, and a 404 or an HTML page printsCannot verify the download: ...and installs.tests/e2e/linuxwith vfox 1.0.13 foropen,tem,librca-fx,jbandgraalce(linux/amd64): all pass, with the new assertions.stylua --check .,lua-language-server --check . --checklevel=Warning, andgo vet,gofmtandgo test -shortintests/e2epass.Not run locally: the Windows and Linux arm64 e2e jobs, and the
mainchannel of vfox. Foojay lists a checksum for the pinned release of each default distribution on each of those platforms (checked 2026-11-02).Notes
mirror.mdsays so.