Skip to content

Commit 9359a43

Browse files
committed
Use WineHQ stable instead of Ubuntu wine64 for FIPS cross-build
Ubuntu 24.04's wine64 package (Wine 9.0) does not properly execute .CRT$XCU initializers in DLLs built with clang-cl/lld-link. This prevents the FIPS power-on self-test from running during the capture_hash build step, which is a correctness issue — the FIPS module's integrity guarantee depends on that test executing at load time. WineHQ stable (Wine 11.0+) handles .CRT$XCU initializers correctly. Install it from dl.winehq.org instead of the Ubuntu repos.
1 parent 56845b7 commit 9359a43

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

.github/workflows/aws-lc-rs.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,25 @@ jobs:
279279
WINEDEBUG: "-all"
280280
DISPLAY: ""
281281
run: |
282+
set -ex
282283
# Wine binfmt allows the kernel to transparently run .exe files through
283284
# Wine. This is needed for the FIPS build, which runs fips_empty_main.exe
284285
# at build time to capture the integrity hash.
285-
sudo apt-get install --assume-yes --no-install-recommends wine64 binfmt-support wine-binfmt
286-
sudo update-binfmts --enable wine
286+
#
287+
# Ubuntu 24.04's wine64 (9.0) does not properly execute .CRT$XCU
288+
# initializers in cross-compiled DLLs, which prevents the FIPS
289+
# power-on self-test from running. WineHQ stable (11.0+) handles
290+
# this correctly.
291+
sudo dpkg --add-architecture i386
292+
sudo mkdir -pm755 /etc/apt/keyrings
293+
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
294+
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/noble/winehq-noble.sources
295+
sudo apt-get update -o Acquire::Languages=none -o Acquire::Translation=none
296+
sudo apt-get install --assume-yes --install-recommends winehq-stable binfmt-support
297+
# Register Wine as the interpreter for Windows PE executables
298+
if [ ! -f /proc/sys/fs/binfmt_misc/wine ]; then
299+
echo ':wine:M::MZ::/usr/bin/wine:' | sudo tee /proc/sys/fs/binfmt_misc/register
300+
fi
287301
wineboot --init
288302
- name: Build
289303
working-directory: ./aws-lc-rs

0 commit comments

Comments
 (0)