Commit Graph
2 Commits
Author SHA1 Message Date
Mounir IDRASSI 37ce73775f Tests: verify rejected passwords leave volumes unchanged
Compare volume contents before and after a rejected password change.
Check before reopening, which rewrites both headers and could hide damage.
2026-10-09 21:16:17 +09:00
Ville TakioandGitHub 277e236968 CI: build and test on big-endian (s390x) and across byte orders (#1905)
* CI: build and test on big-endian (s390x) and across byte orders

The Linux workflow only builds and tests on x86_64, so code that assumes
a little-endian host (see #1899) is not caught. Add a workflow that
cross-builds the console version for s390x and runs it under qemu-user:

- the algorithm self-tests (--test),
- the Tests/test.*.hc volumes, created on little-endian, must open and
  accept a password change,
- volumes created on s390x open on a native amd64 build and the other
  way round, for every encryption algorithm and cascade, with every PRF
  (new Tests/test_byte_order_interop.py, also usable on its own).

The wxWidgets console build is cached per architecture, like in the
existing Linux workflow.

Signed-off-by: Ville Takio <ville+git@takio.fi>

* CI: quick big-endian check on pull requests, full suite on request

Address review:

- Pull requests and pushes run only the s390x build, the algorithm
  self-tests and the Tests/*.hc volumes. The full suite (amd64 build,
  volumes on both builds, interoperability in both directions) runs
  when started manually, with the volume and interoperability tests in
  separate jobs that run concurrently.
- Pass the KDF with --hash; one interoperability case per direction
  still uses autodetection.
- Use separate current and new PIM values: the Tests/*.hc volumes are
  opened with PIM 0, but the new headers use PIM 1, so only the first
  key derivation is expensive.
- Open each Tests/*.hc volume again with the new password before
  removing it.
- Run VeraCrypt with LANG and LC_ALL set to C and an empty
  XDG_CONFIG_HOME, so the "Incorrect password" check does not depend on
  the user's language settings.
- Fail instead of reporting success when nothing would be tested:
  --skip-official without a second binary, or no (or a missing
  requested) Tests/*.hc volume. Add --fixture to select volumes.
- Print how long each check takes.

* CI: keep the automatic big-endian check short

- Open only Tests/test.sha512.hc in the automatic check (all five
  volumes took 154 s of the 327 s s390x job); the full suite still
  opens all of them.
- Cover KDF autodetection in the automatic check too: the first volume
  is opened with the new password (PIM 1) without --hash. The
  interoperability case without --hash now uses sha256, since sha512
  is tried first anyway.
- Include the event name in the concurrency group, so a push does not
  cancel a manual full run.
- Print the elapsed time for failed checks too.

(The previous commit message should say that XDG_CONFIG_HOME points to
an empty temporary directory.)

* CI: use actions/cache@v5 in the big-endian workflow

Match build-linux.yml, which moved to the Node 24 runtime in 9d9fda20.

---------

Signed-off-by: Ville Takio <ville+git@takio.fi>
2026-10-09 21:11:38 +09:00