Commit Graph
2244 Commits
Author SHA1 Message Date
Mounir IDRASSI 9c8f3ec67b Crypto: fix ChaCha partial block continuation
Count consumed input bytes so short updates don't skip unused keystream.
Reset the saved offset when the block is exhausted.

Reported by @router0mail.
2026-10-17 21:54:35 +09:00
Mounir IDRASSI 67ee92f508 macOS: refresh app bundles before notarization
Refresh the app bundle after every build, without requiring -p.
2026-10-17 11:45:08 +02:00
Mounir IDRASSI a143fa7e6a macOS: update Makefile signing identities
Use the new signing identity for app signing and
standard and legacy installer packaging.
2026-10-17 10:52:36 +02:00
Mounir IDRASSI 5e064ad2af macOS: harden notarization and use Keychain credentials
Use the new signing identity and Keychain profiles.
Verify hardened runtime and packaged binaries before submission.
Stop on failures and isolate outputs to prevent stale uploads.
2026-10-17 10:50:33 +02:00
amail80andGitHub de04285ddf Windows: flush shell notifications when dismounting with /q (#1852)
* Windows: flush shell notifications when dismounting with /q

* Windows: limit the /q notification flush to the command line dismount

ProcessExitsAfterCommand was set while parsing /q and stayed set when
the process went on as the background task (/q background, and
/q preferences, which is also used at logon). Later interactive
dismounts, automatic dismounts through DismountAll and the hotkeys then
flushed as well, which would also delay the cache wipe that the force
dismount and wipe hotkeys issue after DismountAll.

Set the flag only for the dismount requested on the command line and
clear it right after, whatever Silent is. Rename it to
FlushDriveRemovalNotifications, as /q doesn't necessarily end the
process.

Reword the comments: according to the documentation, SHCNF_FLUSH makes
SHChangeNotify return once the notification has been delivered, which
doesn't mean that Explorer has finished updating its display, and the
cause of the reported ghost drive letters hasn't been established.
2026-10-17 12:09:03 +09:00
Mounir IDRASSI 7eab121669 Release header allocations after early setup failures
Free the key-info buffer and owned crypto context on pre-KDF errors,
preserving borrowed contexts and avoiding uninitialized drain resources.

Inject every setup allocation and event failure to verify cleanup.
2026-10-16 21:27:25 +09:00
Mounir IDRASSI 8b1b0d5222 Unix: complete pool work when exception capture fails
Record cloning, formatting and allocation failures without allocating, then
complete and drain the request before reporting an error. This prevents
worker loss and avoids treating incomplete cipher or KDF output as valid.

Test ordinary exceptions, capture failures and subsequent pool recovery.
2026-10-16 21:26:21 +09:00
Mounir IDRASSI 996ec04851 Unix: drain encryption pool users before shutdown
Retain accepted callers and KDF workers until completion, and run later
requests synchronously. Clear joined threads and unwind partial startup
so serialized restarts do not retain stale workers.

Cover shutdown boundaries and startup failures with gated tests.
2026-10-16 21:17:31 +09:00
Mounir IDRASSI 56834be339 Unix: synchronize encryption fragment exceptions
Serialize updates to the shared exception pointer and retain the first
reported error. Test concurrent failures through all three handlers,
exception cleanup and subsequent successful work.
2026-10-16 18:30:43 +09:00
Mounir IDRASSI 9603625a3d Windows: drain encryption pool users before shutdown
Close admission and retain references for accepted requests, KDF workers
and submitters until they stop using pool resources. Run new work
synchronously while stopping, then join workers and release handles.

Test queued work, delayed requester wakeup, fallback and restart.
2026-10-16 18:22:09 +09:00
Mounir IDRASSI cdb1af48e0 Windows: clean up partial encryption pool startup
Join created workers and release allocated handles when startup fails before
the pool is published. Close worker handles on normal shutdown as well.

Test each startup allocation failure and subsequent restart.
2026-10-16 18:14:21 +09:00
Mounir IDRASSI 9f92aa6317 Windows: remove unused header finalization work
Header reads have performed synchronous cleanup since 9dc24ba7.
Remove the unused queue operation and obsolete event-reset macros.
2026-10-16 18:06:30 +09:00
Mounir IDRASSI 9ff43ba473 Windows: fix KDF completion lifetime
Hold a requester reference until header parsing can no longer enqueue KDFs.
This prevents stale completion signals from allowing cleanup while workers
still use request-owned state.

Add bounded tests of the production pool and caller completion protocol.
2026-10-16 18:06:08 +09:00
Mounir IDRASSI 0cb9fad329 Harden encryption fragment completion against queue slot reuse
Capture the parent before releasing a fragment slot on Windows and Unix.
This removes the completion code's dependency on the first-fragment slot
holding up the ring until the requester observes completion.
2026-10-16 18:05:24 +09:00
Mounir IDRASSI 762b374db0 Windows: handle extended processor state save failures
Use per-context software SHA-256/SHA-512 after a failed state save
without changing global dispatch. Return an error and clear Argon2's
output before its accelerated core can run.
2026-10-16 14:47:34 +09:00
Mounir IDRASSI 80d7bf771a Unix: fall back to English when a language file is unusable
An empty language file made VeraCrypt access the first element of an
empty vector, and any language file without a language element crashed
it at startup, when LanguageStrings::Init took the first element of an
empty node list. A file with an unterminated tag made initialization
fail instead, so VeraCrypt could not start until the preferences file
was edited. Read the file only if it is not empty, and ignore a
language file that cannot be parsed or has no language element, keeping
the built-in English strings.

Also fall back when the optional language file cannot be opened or
read completely. Catch I/O failures at the resource loader, leaving
preference-loading errors outside the handler.
2026-10-15 07:57:12 +02:00
Mounir IDRASSI 85a79a1c36 Windows: do not truncate files of 4 GiB or more in LoadFile
LoadFile read the file size with GetFileSize without its high-order
part, so a file of 4 GiB or more was loaded as if it were only as large
as its size modulo 4 GiB, without any error. Refuse such files with
ERROR_FILE_TOO_LARGE instead.
2026-10-15 07:57:12 +02:00
Mounir IDRASSI 204d663952 Security tokens: bound response chaining and EMV directory reads
ApduProcessData sent GET RESPONSE for as long as the card answered
0x61XX, allowing an endless loop and unbounded response growth. Limit
each chain to 256 follow-up commands and erase the partial response
if the limit is exceeded.

PSE directory enumeration had a separate unbounded loop with an
eight-bit record counter. Read only records 1 through 254, stop on an
empty or unsuccessful response, and limit the accumulated directory
data to 254 short records before parsing. Malformed TLV responses
consume this budget too, so they cannot bypass either limit.
2026-10-15 07:57:12 +02:00
Mounir IDRASSI 1ac1c891a6 Security tokens: release cached EMV card data when closing sessions
EMVToken::EMVCards keeps every EMV card that was read, together with
the ICC and issuer public key certificates and the CPLC data that make
up its keyfile, and keeps the card connected. Closing all security
token sessions, the option to close them after mounting and wiping the
cache on auto-dismount only closed PKCS#11 sessions, so this data
stayed in memory until VeraCrypt exited.

Add Token::CloseAllSessions, which also releases the cached cards so
that their data is erased and their connection closed, and use it
wherever all sessions are closed. This resolves the "TODO Use Token"
notes at these call sites on Windows.

Keep the EMV cache private and serialize reader enumeration, card reads,
and cache cleanup with the same mutex. Closing sessions waits for active
reads to release their local card references before erasing the cache,
so a read cannot race destruction or insert its card after cleanup.
2026-10-15 07:57:11 +02:00
Mounir IDRASSI f9d64be3f7 Security tokens: fix PC/SC error messages
PCSCException::Show on Windows was derived from the PKCS#11 version
but kept its trailing %s without the matching argument, so any PC/SC
error without a message of its own was formatted from a missing
argument. Remove the extra conversion.

Both platforms label these errors with PCSC_ERROR, which no language
file defined, so users saw a placeholder such as ?PCSC_ERROR? instead.
Append the English text to all language files as a fallback.

Unknown codes were printed in decimal after a 0x prefix. Print them in
hexadecimal, as Pkcs11Exception does.
2026-10-15 07:57:11 +02:00
Mounir IDRASSI 86f6084b50 Security tokens: reject unsupported paths when resolving keyfiles
Token::getTokenKeyfile returned null for a path that is neither a
PKCS#11 nor an EMV token path, and every caller dereferenced the
result. Keyfile application validates the path beforehand, but the
text-mode export does not, so entering an ordinary file path at the
--export-token-keyfile prompt crashed VeraCrypt. Throw
InvalidSecurityTokenKeyfilePath instead, which the user interfaces
already report.
2026-10-15 07:57:07 +02:00
Mounir IDRASSIandMounir IDRASSI bd8e6a70aa Unix: snapshot token import lengths before allocation
Use a single file-length measurement for both the non-empty check
and the vector allocation in GUI and text token imports. Reject
lengths exceeding vector::max_size before converting to size_t,
while retaining the cleanup guard before reading.
2026-10-15 00:09:37 +09:00
Mounir IDRASSIandMounir IDRASSI c42fb18d59 Security tokens: wipe APDU buffers throughout their lifetime
EMV keyfile cleanup did not cover APDU response storage, temporary
copies, or transport buffers on exceptions. Wipe responses on clear,
replacement, destruction and growth, avoid redundant response and PAN
copies, and install transport cleanup guards before use.

Add standalone checks for erasure before release, aliasing, allocation
failures, exception unwinding and const TLV input.
2026-10-15 00:09:13 +09:00
9cfce29514 Use direct burn in BufferPtr::Erase and guard token keyfile data (#1816)
BufferPtr::Erase() previously delegated to Zero()/memset even though
its current callers use it to wipe sensitive data. Expand burn()
directly in the inline Erase implementation, matching VeraCrypt's
established erasure design without adding an out-of-line wrapper.

Install vector-referencing cleanup guards before token keyfile reads
and fetches in the four GUI and text-mode import/export paths. This
ensures partially populated data is wiped when an operation throws
and avoids retaining a stale BufferPtr if the vector reallocates.

Reject empty token exports before accessing vector::front().
Memory::Zero(), Buffer::Erase(), and the existing password guards
remain unchanged.

Co-authored-by: Damian Rickard <damian@rickard.us>
2026-10-14 11:42:51 +02:00
Mounir IDRASSI 3905ea5269 Windows: remove driver resource dependency on MFC
Use the Windows SDK winres.h header in Driver.rc and its resource-editor
metadata. Remove the obsolete MFC include-path override from the legacy
driver build script.
2026-10-13 22:11:37 +09:00
Mounir IDRASSI b4c4290588 Tests: check declared buffer alignment at compile time
Check wrapper type alignment in both test suites so incidental alignment
can't hide an empty CRYPTOPP_ALIGN_DATA, including in ASan builds.
Clarify that the compiler may fold the existing address checks.
2026-10-13 20:18:23 +09:00
Mounir IDRASSI 0ae91a9049 Windows: handle failed mount queries after dismount
Require a complete, valid mount list before reporting removals or success.

Skip empty removal masks to avoid a spurious notification for A:.
2026-10-13 19:40:11 +09:00
Mounir IDRASSI c5bff80d57 Windows: restore drive notifications after failed dismounts
Restore notifications after silent open file failures and honor suppression.
Use SHCNF_FLUSHNOWAIT to start delivery without waiting for completion.
2026-10-13 19:40:11 +09:00
Mounir IDRASSI c44fce5000 Windows: honor notification suppression when dismounting
Guard both direct SHChangeNotify flushes with DeviceChangeBroadcastDisabled.
These calls bypass BroadcastDeviceChange and its suppression check.
2026-10-13 19:40:10 +09:00
Bernard LadenthinandGitHub b31bd203d4 Crypto: document that CRYPTOPP_ALIGN_DATA can expand to nothing (#1842)
The macro falls through to an empty definition for the MSVC bootloader build
(TC_WINDOWS_BOOT) and for compilers that are neither MSVC nor GCC/Clang. The
ks and ks2 members of CRYPTO_INFO are compiled into the bootloader and are
declared with it, so the caveat is reachable.
2026-10-13 19:30:32 +09:00
Bernard LadenthinandGitHub e9992cf778 Tests: verify that CRYPTOPP_ALIGN_DATA delivers the requested alignment (#1844)
The macro expands to nothing for compilers that are neither MSVC nor
GCC/Clang, and the SIMD backends issue aligned loads against buffers declared
with it, so a silent expansion to nothing would fault at run time. Nothing
verified this so far.

Add TC_IS_ALIGNED next to the existing alignment constants and check both of
them from the platform self-test suites. The probe buffers stay below the
alignment under test because the ABI already aligns larger objects by itself,
which would make the check pass vacuously.

The check is skipped in the Windows driver: a failing self-test there reaches
TC_BUG_CHECK and would bugcheck the machine.
2026-10-13 17:09:34 +09:00
Mounir IDRASSI 3e1c3f6490 Linux: warn when a mounted volume depends on the requester's session
A volume file opened with the credentials of the requesting user is
served by a file system that belongs to that user's session. Ejecting
the share or logging out while the volume is mounted can lose data, and
GVfs does not refuse to eject a share whose file is in use. Warn after
each such mount that the share must stay mounted and the session active
until the volume is unmounted. Append the English message to all
language files as a fallback.

The indicator reaches the UI with the mount result, through a new
MountVolumeRequestV2/ResponseV2 pair: a service that predates it rejects
the new request before mounting, and legacy requests keep their legacy
response, so that an older UI still works with a newer service. The
control file format is unchanged.
2026-10-13 14:36:45 +09:00
Mounir IDRASSI eb9d10f430 Linux: mount volume files that only the requesting user can access
A FUSE file system mounted without allow_other, such as a GVfs share,
denies root access to files that its owner can open. Mounting a volume
stored there, or formatting a new one with a non-FAT file system, failed
with "Permission denied".

When root is denied opening an existing volume file, re-execute
VeraCrypt with the internal option --requester-helper. The helper
permanently takes the credentials of the user who requested elevation
through sudo or doas, opens the file and passes the descriptor back.
Root does all I/O through that descriptor and mounts the volume through
the FUSE volume image. Another helper restores the timestamps when the
FUSE service closes the file.

This also lets volumes on NFS with root_squash mount read-write instead
of falling back to read-only.

Fixes #23
2026-10-13 14:36:40 +09:00
a835875912 Fix build with NOSSE2 (#1891)
* Fix build with NOSSE2

Disable AESNI and SHANI code that depends on SSE2 availability if NOSSE2
is enabled.

* Fix NOSSE2 builds while preserving runtime AES acceleration

Keep AES/Camellia acceleration enabled and honor NOSSE2 with NOAESNI.
Include stddef.h outside UEFI to provide wchar_t for Camellia.
Match the SHA probe guard to its implementation, keeping NOASM and
UEFI exclusions.

---------

Co-authored-by: Mounir IDRASSI <mounir.idrassi@amcrypto.jp>
2026-10-12 00:01:39 +09:00
Mounir IDRASSI 62253154cb Wipe token keyfile buffers on failure and release
Use a size_t counter in burn so large erasures retain their full length.
Install cleanup guards before token verification and keyfile application,
including the Windows token export path.

Reserve the complete EMV keyfile output before copying its components,
and wipe temporary components on every exit. Erase cached card data before
clearing or replacing it, including when copying a card fails.

Validation: Linux console and GUI builds with algorithm tests; cleanup
checks with GCC and Clang UBSan. PR 1816 still applies cleanly.
2026-10-11 23:10:55 +09:00
Mounir IDRASSI b2b28d5793 Linux: release only the volume's own loop and device-mapper devices
Unmounting released the loop device and device-mapper devices recorded
at mount time, by name. After a dismount that failed partway, for
example on a busy auxiliary FUSE mount, these names could be reused by
unrelated objects, which the listing then showed as the volume's and a
retry, emergency cleanup, filesystem check or auto-dismount released.
Without kernel cryptography, the loop device, which carries the
decrypted volume, was also released while the filesystem was mounted
elsewhere or the device was held open. A failed mount could remove a
pre-existing device-mapper device of the same name, and a failed
cascade mount could leave its layers and loop device behind.

Each destructive step now acts only on a device verified to belong to
the volume. A loop device must be bound to the container or volume
image (LOOP_GET_STATUS64). Device-mapper devices get the UUID
VERACRYPT-<serial>-<name> and are removed by UUID; those of earlier
versions, which have none, are verified through their sysfs slaves,
and the dismount fails, saying why, if that is not possible. Emergency
cleanup is not offered then, as it would hide the volume but leave its
devices. While the filesystem is mounted elsewhere, the dismount fails
and keeps the volume's devices. With kernel cryptography, the loop
device is marked for autoclear as soon as it is attached and verified,
so the kernel detaches it once device-mapper releases it; a process
holding it open sees only ciphertext and does not fail the dismount.
Without kernel cryptography, the dismount also fails while the loop
device is held open. Dismount, emergency cleanup, filesystem check and
the listing re-read the volume's devices from its auxiliary mount, and
the English emergency warning mentions these causes.

Add Tests/test_linux_loop_identity.py, covering these cases with and
without kernel cryptography, and with --legacy-binary, volumes mounted
by an earlier version. All 89 checks pass, as do the 11 added by
--legacy-binary 1.26.29; 1.26.29 itself fails 21 of the 89.
2026-10-11 22:33:20 +09:00
Mounir IDRASSI 3eaa6fc4c7 Windows: handle window placement repair failure
Return the SetWindowPlacement result so SC_RESTORE falls back to
normal handling on failure.

Describe the observed window state without assuming its cause.
2026-10-11 22:18:03 +09:00
amail80andGitHub 689507c41c Windows: bring the main window back on screen when its restore position is off screen (#1858)
* Windows: bring the main window back on screen when its restore position is off screen

A minimized window is parked by Windows at (-32000,-32000). When the display
topology changes while it is minimized - which happens on every session lock
that powers off a monitor - Windows can copy that parking position into the
window's restore rectangle and clear WS_MINIMIZE. The window then is, by every
API, a normal visible window living 32000 pixels off screen: IsIconic returns
FALSE, IsWindowVisible returns TRUE, and ShowWindow (SW_RESTORE) is a no-op
because the restore rectangle is exactly where the window already is.

The user is left with an application that answers its notification area icon
but whose main window cannot be shown by any means, and only restarting
VeraCrypt recovers it.

Validate the restore rectangle and re-center it on the primary monitor when it
intersects none. The repair runs from the three paths that show the window and,
because clicking the taskbar button of an already visible window runs no
application code at all, also on WM_DISPLAYCHANGE. showCmd is left as
GetWindowPlacement returned it, so a legitimately minimized window stays
minimized and only its future restore position is corrected.

The window size is captured once after the dialog has been laid out: a parked
window carries the parking size, so it cannot serve as a source for the normal
dimensions.

Verified on Windows 11 26200.8875 with two monitors at different scale factors,
the primary one being powered off by the session lock: GetWindowPlacement
returned rcNormalPosition = (-32000,-32000)-(-31840,-31972), and neither a
notification area click nor an explicit minimize/restore cycle brought the
window back.

* Windows: fix the size, offset and trigger of the main window repair

The size used by RepairMainWindowPlacement was measured on the window at
the end of InitMainDialog whenever the window was not minimized. In the
state the repair handles, the window is not minimized but has the
parking dimensions, and InitMainDialog can run on it, for example when
the language is changed from Preferences opened from the notification
area. The font compensation then grows the height and keeps the parking
width, so the kept size became 160x456. The size is now taken once from
the newly created window, whose width never changes, and follows the
font compensation only while the window has that width: in a window as
narrow as a parked one the menu bar wraps and moves the controls down,
so the compensation height is meaningless there too.

A restore rectangle that is no larger than a minimized window in either
dimension is now repaired. Before, both dimensions had to be that small,
so a 160x456 rectangle was left as it was.

The repaired position was converted with the work area origin of the
primary monitor, and the visibility test passed rcNormalPosition to
MonitorFromRect unconverted. Workspace coordinates are offset by the
position of the work area within the monitor associated with the
window, so the offset of that monitor is now used, both to convert a
copy of the rectangle to screen coordinates for the visibility test and
to express the repaired position. With an appbar on the left, a window
just beyond the right edge was taken as visible; with an appbar on top
of the primary monitor only, a window repaired on another monitor was
placed too high.

The repair also runs on WM_ACTIVATE. The session notification that
triggers it after an unlock is registered only while the background task
is enabled, and activating a window that is not minimized, from its
taskbar button or with Alt+Tab, runs none of the other repair paths.
Two comments that said a taskbar click runs none of our code are
corrected.
2026-10-11 22:13:35 +09:00
amail80andGitHub 83b4fc23cb Show Secure Desktop dialogs on the monitor of their parent window (#1912)
* Show Secure Desktop dialogs on the monitor of their parent window

Dialogs shown through SecureDesktopDialogBoxParam (the password prompt,
mount options and the security token PIN prompt) are created on the
Secure Desktop without an owner, because their parent window stays on
the original desktop. Without an owner, DS_CENTER puts them on the
primary monitor even when the main window is on another one, so the
password is typed on one monitor and the wait dialog then appears on
the other.

Before switching desktops, take the middle of the work area of the
monitor that Windows associates with the parent window, and create a
hidden owner window at that point on the Secure Desktop. The DS_CENTER
dialog is then centered on the same monitor as without Secure Desktop,
and the dialogs opened from it follow it. If the parent window is hidden
or minimized, or the owner can't be created, the dialog has no owner as
before.

The monitor lookup added to ShowWaitDialogEx in #1865 moves into a
helper used by both.

* Windows: read signed coordinates in the Keyfiles context menu handlers

The WM_CONTEXTMENU handlers of the password dialog, the mount options
dialog and the VeraCrypt Expander password dialog took the click
position with LOWORD and HIWORD and compared it with the signed
rectangle from GetWindowRect. On a monitor to the left of or above the
primary one the screen coordinates are negative, LOWORD and HIWORD
return them as large positive values, and a right click on the
Keyfiles button was ignored. Use GET_X_LPARAM and GET_Y_LPARAM, as the
other WM_CONTEXTMENU handlers in Mount.c already do.

Now that the Secure Desktop prompt opens on the monitor of its parent
window, this case is easier to reach.
2026-10-11 20:44:22 +09:00
Mounir IDRASSI 3f04c42db9 Increment version to 1.26.30 2026-10-11 15:56:54 +09:00
Mounir IDRASSI 6e63041962 Linux: secure NixOS helper lookup and report blocked elevation
Look up NixOS helpers only when trusted system metadata identifies NixOS
and each path component passes ownership and permission checks. Keep the
existing helper search on other distributions.

Detect NoNewPrivs before prompting for administrator credentials, with a
clear error for restricted launchers. Add regression coverage to Linux CI
and append the English fallback message to all language files.

Refs #1911
2026-10-10 22:25:42 +09:00
Mounir IDRASSI 3e3a271e52 Unix: fix SystemLog include cycle in debug builds
With DEBUG enabled, including StringConverter.h reaches SystemLog.h through
PlatformBase.h before StringConverter is declared. The inline
WriteException implementation then fails to compile.

Move WriteException into Unix/SystemLog.cpp and include StringConverter.h
there, keeping the logging behavior unchanged while removing the header
dependency cycle.
2026-10-10 20:33:18 +09:00
Mounir IDRASSI dc74edfd5b Build: clarify wxWidgets job selection limitations 2026-10-10 12:26:21 +09:00
Ville TakioandGitHub 98ef739cd8 Build: let a parent make control the wxWidgets build jobs (#1903)
* Build: let a parent make control the wxWidgets build jobs

The wxbuild target always runs the wxWidgets sub-make with -j 4. When
VeraCrypt is built from a parent "make -jN" (for example by a
distribution or embedded build system), the explicit -j 4 overrides the
parent's job count and jobserver: the wx build ignores -j1 and the
configured parallelism and can oversubscribe the machine.

Keep -j 4 as the default for a standalone build, but leave the job count
to the parent make when it was started with -j: MFLAGS then contains -j,
-jN or the jobserver option (-j1 since GNU make 4.2; older makes treat a
-j1 parent like a serial one without -j). MFLAGS is used rather than
MAKEFLAGS because it holds only options, not command-line variable
definitions, so a variable value containing "-j" cannot match.

See also #717, which proposed dropping -j 4 for the same reason.

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

* Build: also detect grouped -j flags; pass OpenWrt jobs to wxbuild

Address review:

- GNU make 3.81 can group single-letter options in MFLAGS, e.g. "-sj"
  for the -s this Makefile adds plus a bare -j, which the previous
  pattern missed. Look for "j" in every single-dash option word instead,
  skipping the options that take an argument (-C, -E, -I, -O, -W, -f,
  -o). An option argument containing a space followed by "-j" can still
  be mistaken for a job option; this is documented next to the variable.
- The OpenWrt recipe built wxWidgets without the package's job settings,
  so it still ran 4 jobs. Pass $(PKG_JOBS) and an empty WX_MAKE_JOBS, so
  the wxWidgets build follows OpenWrt's settings, including serial
  builds.

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

---------

Signed-off-by: Ville Takio <ville+git@takio.fi>
2026-10-10 12:10:26 +09:00
amail80andGitHub f8e397cd5d Show mount/wait dialog on the monitor of the main window (#1865)
* Show mount/wait dialog on the monitor of the main window

* Place the wait dialog owner on the monitor chosen by MonitorFromWindow

Instead of the centre of the creator window, put the temporary owner in the
middle of the work area of the monitor returned by MonitorFromWindow
(MONITOR_DEFAULTTONEAREST). The centre point can lie on a different monitor
than most of the window when displays are offset, and Windows may make the
owner larger than the requested 1x1, so an owner close to a monitor edge
could spill onto the neighbouring monitor and take the wait dialog with it.
2026-10-09 20:41:11 +09:00
Ville TakioandGitHub 7c06e03ec3 Crypto: use alignment-safe loads and stores where unaligned access faults (#1909)
* Crypto: use alignment-safe loads and stores on all hosts

SHA-2, BLAKE2s, Twofish and Kuznyechik read and write words in caller
buffers directly on little-endian hosts, Streebog's stage2() reads 64-bit
words from the input, and the Unix XTS code XORs whitening values through
uint64 pointers. On strict-alignment CPUs (ARMv5-v7 for LDRD/LDM, MIPS,
mips64) this raises SIGBUS when a caller passes an unaligned buffer; real
volume operations use aligned buffers, but test vectors and future
callers need not.

- SHA-2, BLAKE2s, Twofish and Kuznyechik use the VcLoad*/VcStore* helpers
  on all hosts, not only on big-endian ones.
- On GCC/Clang little-endian targets the helpers copy with memcpy, which
  compiles to single loads and stores where unaligned access is allowed,
  so the C paths keep their speed. MSVC targets keep native accesses, as
  before.
- Streebog takes the direct path only for 8-byte-aligned input; other
  input goes through the existing copy into CTX->buffer.
- XTS (Unix, without the x64 SSE path) XORs the whitening values through
  memcpy.

Output is unchanged: known-answer comparisons for every offset from 0 to
15 match on x86_64, armv7, mips, mipsel and mips64, and an
alignment-checking (UBSan) build is clean.

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

* Crypto: keep direct word accesses where unaligned access is safe

Address review: limit the alignment fix to the targets that need it.

VC_UNALIGNED_ACCESS_OK (config.h) is 1 on x86, x64, ARMv8 (including
MSVC ARM64) and PowerPC, where unaligned 32- and 64-bit accesses are
safe; there SHA-2, BLAKE2s, Twofish, Kuznyechik, Streebog and XTS
compile exactly as before. On other targets (32-bit ARM, whose
unaligned support does not cover LDRD/LDM, MIPS, ...), they load and
store through the VcLoad*/VcStore* helpers; SHA-2 keeps its byte swaps
and only the input load changes.

The object code of the changed files is identical to master with GCC
and Clang on x86_64 and with GCC on AArch64. On armv7, mips, mipsel and
mips64 (qemu-user), the known-answer outputs at buffer offsets 0..15
match x86_64.

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

---------

Signed-off-by: Ville Takio <ville+git@takio.fi>
2026-10-09 20:39:21 +09:00
Ville TakioandGitHub cb1d9a4c3b Crypto: no unaligned 64-bit accesses on 32-bit ARM (#1908)
CRYPTOPP_ALLOW_UNALIGNED_DATA_ACCESS was defined whenever
__ARM_FEATURE_UNALIGNED is set, which includes 32-bit ARMv6/ARMv7. There
the hardware handles unaligned single-word loads and stores, but not
LDRD/STRD/LDM, which the compiler uses for 64-bit words. Camellia
(camellia_load64/camellia_store64) and Whirlpool (HashMultipleBlocks on
unaligned input) then access 64-bit words through unaligned pointers.

camellia_set_key() raised SIGBUS in the XTS self-test on an ARMv7
(cortex-a15) build whose test key happened to be only 2-byte aligned.

Define the macro for AArch64 only among the ARM targets; on 32-bit ARM
the memcpy and aligned-copy paths are used instead.

Signed-off-by: Ville Takio <ville+git@takio.fi>
2026-10-09 06:28:13 +09:00
felixandGitHub 4edad72bcc Unix: require confirmation before overwriting containers (#1861) 2026-10-06 00:09:52 +09:00
Mounir IDRASSI ff355d111f Argon2: fail self tests on context errors
Count argon2_ctx errors as test failures. Previously, failed calls skipped the hash comparison without increasing the failure count.
2026-10-05 09:27:21 +09:00
Ville TakioandGitHub 4f76ff7132 Argon2: fix build with -march=x86-64-v3/v4 and XOP targets (#1906)
* Argon2: fix build with -march=x86-64-v3/v4 and XOP targets

blamka-round-opt.h picked its SSE2, AVX2 or AVX-512 definitions only from
the compiler flags. With global flags such as -march=x86-64-v3 or
-march=x86-64-v4, opt_sse2.c (and with v4 also opt_avx2.c) saw __AVX2__
or __AVX512F__ and got definitions that do not match its code, so the
build failed.

Let opt_sse2.c and opt_avx2.c select the variant they implement, and
fall back to the compiler flags for other includers. This needs no new
compiler options, so it also works with old compilers and with the
plain objects used by NOASM=1 builds.

With XOP targets (-march=bdver*), the header skipped its
_mm_roti_epi64 fallback but did not include the intrinsic; include
<x86intrin.h> for GCC and Clang there.

Hashes are identical through the AVX2, SSE2 and reference code paths,
and match an unmodified build.

Fixes #1867
Refs #1871

* Argon2: update branch comments in blamka-round-opt.h

The #else/#endif comments still named __AVX2__ and __AVX512F__, but the
branches are now selected by ARGON2_BLAMKA_USE_SSE2/AVX2.

Refs #1867
2026-10-05 09:22:45 +09:00