Skip to content

Package signing

Download only from the GitHub releases page. If a check fails, do not install the package.

Package Check Section
Flathub Signed by Flathub, nothing to do Flatpak
GitHub Flatpak bundle SHA256SUMS Flatpak
.deb pair GPG (dpkg-sig) + build provenance Debian
Helper .rpm Detached GPG + RPM signature + build provenance Fedora
AppImage Embedded GPG signature AppImage

All GPG checks pin the ClamUI signing key fingerprint:

037273A518BE90BA6EA27B3CDEF2A3E473DE1E26

Release .deb and .rpm assets carry GitHub artifact attestations. They prove the file was built by this repository’s workflow. Needs GitHub CLI 2.49 or newer:

Check provenance
gh attestation verify clamui_0.6.1_amd64.deb --repo linx-systems/clamui
gh attestation verify clamui-privileged-helper-0.6.1-1.x86_64.rpm --repo linx-systems/clamui

This complements the GPG checks below; it does not replace them.

Flathub signs every Flatpak it publishes, so installing from Flathub needs no extra step. The GitHub bundles clamui-x86_64.flatpak and clamui-aarch64.flatpak are not covered by that signature. Check them against the release’s SHA256SUMS:

Check a Flatpak bundle
sha256sum --ignore-missing -c SHA256SUMS

The release is an architecture-specific application and helper pair. Verify both:

Verify the Debian pair
DEB_ARCH="$(dpkg --print-architecture)"
APP="clamui_0.6.1_${DEB_ARCH}.deb"
HELPER="clamui-privileged-helper_0.6.1_${DEB_ARCH}.deb"
test -f "$APP" && test -f "$HELPER"
curl -fsSLo signing-key.asc https://raw.githubusercontent.com/linx-systems/clamui/master/signing-key.asc
EXPECTED_FINGERPRINT=037273A518BE90BA6EA27B3CDEF2A3E473DE1E26
ACTUAL_FINGERPRINT="$(gpg --show-keys --with-colons signing-key.asc | awk -F: '$1 == "fpr" { print $10; exit }')"
test "$ACTUAL_FINGERPRINT" = "$EXPECTED_FINGERPRINT" || { echo "Unexpected ClamUI signing-key fingerprint" >&2; exit 1; }
gpg --import signing-key.asc
dpkg-sig --verify "$APP" "$HELPER"

Success prints GOODSIG for the expected fingerprint. BADSIG means stop: install neither package. An _gpgbuilder member alone proves nothing.

Assets: clamui-privileged-helper-0.6.1-1.x86_64.rpm and .aarch64.rpm, each with a .rpm.asc. The RPM holds only the helper, not the GUI or ClamAV. This check uses a temporary GPG home and RPM database, so your trust stores stay untouched:

Verify the helper RPM in a throwaway keyring
set -euo pipefail
VERSION=0.6.1
ARCH="$(rpm --eval '%{_arch}')"
case "$ARCH" in x86_64|aarch64) ;; *) echo "Unsupported ClamUI helper RPM architecture: $ARCH" >&2; exit 1 ;; esac
RPM="clamui-privileged-helper-${VERSION}-1.${ARCH}.rpm"
ASC="${RPM}.asc"
EXPECTED_FINGERPRINT=037273A518BE90BA6EA27B3CDEF2A3E473DE1E26
test -f "$RPM" && test -f "$ASC"
verify_dir="$(mktemp -d)"
trap 'rm -rf "$verify_dir"' EXIT
downloaded_key="$verify_dir/downloaded-signing-key.asc"
PINNED_KEY="$verify_dir/clamui-pinned-key.gpg"
GPG_HOME="$verify_dir/gnupg"
RPMDB="$verify_dir/rpmdb"
install -d -m 0700 "$GPG_HOME" "$RPMDB"
curl -fsSLo "$downloaded_key" https://raw.githubusercontent.com/linx-systems/clamui/master/signing-key.asc
mapfile -t PRIMARY_FINGERPRINTS < <(gpg --batch --no-options --homedir "$GPG_HOME" --show-keys --with-colons "$downloaded_key" | awk -F: '$1 == "pub" { primary = 1; next } primary && $1 == "fpr" { print $10; primary = 0 }')
test "${#PRIMARY_FINGERPRINTS[@]}" -eq 1
test "${PRIMARY_FINGERPRINTS[0]}" = "$EXPECTED_FINGERPRINT"
gpg --batch --no-options --homedir "$GPG_HOME" --import "$downloaded_key"
gpg --batch --no-options --homedir "$GPG_HOME" --armor --export "$EXPECTED_FINGERPRINT" > "$PINNED_KEY"
test -s "$PINNED_KEY"
gpg_status="$(gpg --batch --no-options --homedir "$GPG_HOME" --status-fd=1 --verify "$ASC" "$RPM" 2>/dev/null)"
printf '%s\n' "$gpg_status" | grep -F "[GNUPG:] VALIDSIG $EXPECTED_FINGERPRINT "
rpm --dbpath "$RPMDB" --define '_keyring rpmdb' --initdb
rpm --dbpath "$RPMDB" --define '_keyring rpmdb' --define '_pkgverify_level all' --import "$PINNED_KEY"
rpm --dbpath "$RPMDB" --define '_keyring rpmdb' --define '_pkgverify_level all' --checksig --verbose "$RPM"
test "$(rpm --query --package --queryformat '%{NAME} %{EPOCH}:%{VERSION}-%{RELEASE}.%{ARCH}' "$RPM")" = "clamui-privileged-helper 0:${VERSION}-1.${ARCH}"
Why not just rpmkeys –checksig?

The script accepts the downloaded key only if it has exactly one primary key with the pinned fingerprint, and it requires every RPM verification class. A bare rpmkeys --checksig can accept an unsigned RPM under its default policy. With set -e, any nonzero exit stops the procedure; do not parse the verbose wording, which differs between RPM versions.

Then install in the same shell, so $PINNED_KEY and $RPM are still set:

Fedora Workstation / Server. Importing the key is a lasting, system-wide trust decision. Keep localpkg_gpgcheck on:

Terminal window
sudo rpm --import "$PINNED_KEY"
sudo dnf --setopt=localpkg_gpgcheck=1 install -y "./$RPM"

Fedora Atomic. Do not import the key; layer the RPM and reboot (rpm-ostree handbook):

Terminal window
sudo rpm-ostree install "./$RPM"
systemctl reboot

The asset is ClamUI-0.6.1-x86_64.AppImage with ClamUI-0.6.1-x86_64.AppImage.zsync.

  1. Install build tools: a C/C++ compiler, CMake, Git, pkg-config, GLib/GObject, Cairo, OpenSSL, GPGME, libgcrypt, zlib, FUSE headers, mksquashfs, plus GNU binutils (readelf, objcopy), GnuPG, and bubblewrap.

  2. Build AppImageKit’s validate from a pinned revision. Upstream publishes no prebuilt binary.

    Terminal window
    git clone https://github.com/AppImage/AppImageKit.git
    git -C AppImageKit checkout 5735cc5bed206497cddfbd2a75e1982c2606c35d
    git -C AppImageKit submodule update --init --depth 1
    cmake -S AppImageKit -B build -DUSE_SYSTEM_MKSQUASHFS=ON -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release
    cmake --build build --target validate --parallel 2
  3. Run the check below. It never executes the AppImage, uses a private keyring and /tmp inside bubblewrap, and requires the line Good signature from. If your validator needs extra shared libraries, set VALIDATOR_LIBRARY_PATH to their directory first.

Verify the AppImage without running it
set -euo pipefail
APPIMAGE="$(realpath ClamUI-0.6.1-x86_64.AppImage)"
VALIDATE="$(realpath build/src/validate)"
VALIDATOR_LIBRARY_PATH="${VALIDATOR_LIBRARY_PATH:-}"
EXPECTED_FINGERPRINT=037273A518BE90BA6EA27B3CDEF2A3E473DE1E26
test -f "$APPIMAGE" && test -x "$VALIDATE"
command -v readelf >/dev/null && command -v objcopy >/dev/null
command -v gpg >/dev/null && command -v bwrap >/dev/null
objcopy --version | grep -F 'GNU objcopy' >/dev/null
readelf -W -S "$APPIMAGE" | grep -F '.sha256_sig' >/dev/null
readelf -W -S "$APPIMAGE" | grep -F '.sig_key' >/dev/null
WORK="$(mktemp -d)"
trap 'rm -rf "$WORK"' EXIT
SIG_KEY="$WORK/embedded-signing-key.asc"
OBJ_COPY="$WORK/objcopy-output"
GNUPGHOME="$WORK/gnupg"
VALIDATE_LOG="$WORK/validate.log"
install -d -m 0700 "$GNUPGHOME" "$WORK/bin"
BEFORE_SHA256="$(sha256sum "$APPIMAGE")"
objcopy --dump-section ".sig_key=$SIG_KEY" "$APPIMAGE" "$OBJ_COPY"
rm -f "$OBJ_COPY"
test "$(sha256sum "$APPIMAGE")" = "$BEFORE_SHA256"
test -s "$SIG_KEY"
KEY_RECORDS="$WORK/embedded-key-records"
PRIMARY_FINGERPRINTS_FILE="$WORK/primary-fingerprints"
gpg --batch --no-options --homedir "$GNUPGHOME" --show-keys --with-colons "$SIG_KEY" >"$KEY_RECORDS"
awk -F: '$1 == "pub" { primary = 1; next } primary && $1 == "fpr" { print $10; primary = 0 }' \
"$KEY_RECORDS" >"$PRIMARY_FINGERPRINTS_FILE"
mapfile -t PRIMARY_FINGERPRINTS < "$PRIMARY_FINGERPRINTS_FILE"
test "${#PRIMARY_FINGERPRINTS[@]}" -eq 1
test "${PRIMARY_FINGERPRINTS[0]}" = "$EXPECTED_FINGERPRINT"
gpg --batch --no-options --homedir "$GNUPGHOME" --import "$SIG_KEY"
ln -s "$(command -v gpg)" "$WORK/bin/gpg2" # validate invokes gpg2 by name
bwrap --unshare-all --die-with-parent --new-session \
--ro-bind / / --proc /proc --dev /dev --tmpfs /tmp \
--bind "$WORK" "$WORK" --chdir "$WORK" \
--setenv GNUPGHOME "$GNUPGHOME" --setenv LC_ALL C \
--setenv PATH "$WORK/bin:/usr/bin:/bin" \
--setenv LD_LIBRARY_PATH "$VALIDATOR_LIBRARY_PATH" \
"$VALIDATE" "$APPIMAGE" >"$VALIDATE_LOG" 2>&1
LC_ALL=C grep -F 'Good signature from' "$VALIDATE_LOG" >/dev/null

An exit code of 0 or the presence of a signature section alone is not verification.

Use a dedicated 4096-bit RSA key that expires after two years. Commit only the public key as signing-key.asc; store the private key and passphrase in the GitHub Actions secrets GPG_PRIVATE_KEY and GPG_PASSPHRASE.

Terminal window
gpg --full-generate-key
gpg --armor --export-secret-keys YOUR_KEY_ID > private.key
gpg --armor --export YOUR_KEY_ID > signing-key.asc

Release workflows sign on v* tag pushes and on manual runs with sign: true; normal pushes and pull requests build unsigned. Only signed assets published on a release can be used by the in-app helper installer. Rotate the key before it expires and verify a published release on a known-good machine.