Skip to content

Signing and verification

ZIGNOS verifies the integrity of distributed packages and recipes with Ed25519 detached signatures. It does not depend on GPG or external libraries; key generation, signing and verification all happen in the single zpkg binary.

Target What is signed What it protects
binpkg repository The raw bytes of index.json Tampering with package contents, manifests and version information
Recipe tree recipes.manifest (sha256/size/mode of every file) Tampering with recipes, build scripts and bundled patches
Rollback generation and the last accepted state Swapping in an older signed index/manifest
Expiry expires Reuse of a signature left unused for a long time

A recipe’s checksums are included in the manifest, so verification extends from the recipe tree signature to the source tarball sha256.

ターミナルウィンドウ
# signing key pair (private key is 0600, existing files are not overwritten)
zpkg key generate --private ~/zignos-signing.key --public ~/zignos-signing.pub
# client: trust the public key
zpkg key import zignos-signing.pub
zpkg key list
  • The key ID is the SHA-256 (64 hex) of the 32-byte Ed25519 public key
  • Trusted keys live in $ZPKG_ROOT/etc/zpkg/trusted.d/*.pub
  • There is no TOFU (automatic trust on first use). Verify the public key fingerprint over a separate channel before importing
  • Do not place private keys inside repositories or recipe trees. zpkg mkindex and zpkg sign-recipes refuse when the private key is inside the target directory
  • When rotating keys, import the new public key, sign with the new key, and finally remove the old key with zpkg key remove <keyid>

Recommended layout:

binrepo/
├── index.json
├── index.json.sig
├── keys/<keyid>.pub
└── packages/
├── gcc.pkg.tar.gz
├── gcc.manifest
└── gcc.meta.json
ターミナルウィンドウ
zpkg mkindex --key ~/zignos-signing.key \
--generation 42 --expires 90d /srv/binrepo
  • index.json is schema 2 and carries generation / expires / keyid
  • index.json.sig is a signature over the raw bytes of index.json
  • Each entry’s sha256 and manifest_sha256 bind the binpkg payload and file list
  • keys/<keyid>.pub is also written automatically. If you distribute it, publish this key’s fingerprint over a separate channel (website, release notes, etc.)

If --generation is omitted, it becomes the existing index.json generation

    1. A new repository starts at 1. --expires accepts RFC3339 or 90d / 720h (default +90 days).
ターミナルウィンドウ
zpkg sign-recipes --key ~/zignos-signing.key \
--generation 42 --expires 90d /path/to/zignos-recipes

recipes.manifest lists path / sha256 / size / mode for every regular file except .git and the signatures themselves. recipes.manifest.sig is a signature over the raw bytes of that manifest.

zpkg sync verifies the following against the unpacked staging tree.

  • The manifest signature and key ID
  • Expiry and generation
  • The sha256 / size of every file (and mode on Unix)
  • That there are no extra files not listed in the manifest

The same verification runs for any input: a directory, a recipe tarball or a stage3 tarball.

Every commit on the official zignos-recipes main signs the whole tree. The private key never lives in the repository; it is kept on an offline USB. The public key is published as keys/recipes-signing.pub, and its fingerprint is announced on the site and in release notes.

ターミナルウィンドウ
# Make the change and stage everything (no untracked files)
git add -A
# Mount the USB and sign (updates and stages the manifest and .sig)
ZIGNOS_SIGNING_KEY=/media/zignos-signing/zignos-recipes.key \
scripts/sign-recipes.sh
git commit -m "..."
scripts/verify-recipes.sh
git push origin main
  • recipes.manifest and recipes.manifest.sig are committed
  • generation increments automatically from the previous manifest
  • The default expiry is 180 days. Even without changes, a re-signing commit is needed before it expires
  • Sign on a Linux ext4 filesystem. DrvFs paths such as WSL /mnt/d expose file modes as 0777, so scripts/sign-recipes.sh refuses them
  • CI runs the same check as scripts/verify-recipes.sh on every push to main
  • External contributor PRs are reviewed unsigned; the maintainer signs after merging

Key generation, backup and rotation are described in keys/README.md.

For channel trees (stable/ / testing/ / unstable/), the entire tree is signed by one recipes.manifest. The distributed recipe tarball contains all channels, so a single sync verifies every channel. stage3 bundles only the stable subtree, which has no manifest of its own and is therefore still treated as unsigned.

zpkg overlay add and zpkg overlay sync run the same recipes.manifest verification on the fetched tree. Trusted keys, expiry, generation and the sha256 of every file behave exactly as for the official tree.

Only the rollback record is kept per overlay: $ZPKG_DB/.security.json stores the last accepted generation and SHA-256 under overlay:<name>, so generations from one overlay never mix with another.

An unsigned overlay is accepted only with --allow-unsigned (for the official ZIGNOS MENU, overlay add zignos-menu sets it automatically). A signature that is present but invalid is rejected even with that setting. Overlay authors can create a manifest and signature in the official format with zpkg sign-recipes.

ターミナルウィンドウ
# register a trusted key
zpkg key import zignos-signing.pub
# update to a signed recipe tree
zpkg sync --from zignos-recipes.tar.xz
# use the binpkg repository
export ZPKG_BINREPO=https://example.com/zignos/binpkgs
zpkg install <pkg>

If verification fails, install and sync stop with an error. They never silently fall back to a source build from a tampered repository.

The last accepted generation and SHA-256 are stored in $ZPKG_DB/.security.json.

  • A new generation smaller than the stored value → rejected as a rollback
  • The same generation with different contents → rejected as a same-generation swap
  • expires is in the past → rejected
Setting Meaning
--allow-unsigned / ZPKG_ALLOW_UNSIGNED=1 Allowed only when no signature exists. A broken signature is always rejected
ZPKG_ALLOW_EXPIRED=1 Only expiry is allowed. Signature and rollback verification remain

The same settings can go in /etc/zpkg/security.conf.

TRUSTED_KEYS=/etc/zpkg/trusted.d
ALLOW_UNSIGNED=0
ALLOW_EXPIRED=0

The signing mechanism and the per-commit signing workflow / CI check are in place in zignos-recipes, but the official signing key has not been generated yet. Until keys/recipes-signing.pub is published, CI skips signature verification. The current stage3 / recipe tarballs are unsigned. When running zpkg sync on an unsigned distribution, specify the exception explicitly.

ターミナルウィンドウ
zpkg sync --from zignos-recipes-....tar.xz --allow-unsigned

The official ZIGNOS MENU overlay is unsigned as well. zpkg overlay add zignos-menu recognises the official name and records ALLOW_UNSIGNED=1, so no extra option is needed.

Once the official key is generated on the offline USB and keys/recipes-signing.pub is published, users import it with zpkg key import and run without --allow-unsigned. Every commit to main must then be signed for CI to pass.

  • A leaked private key or a compromised root account cannot be prevented
  • Key revocation lists (CRL) are not supported. Key rotation is used instead
  • Initial trust depends on out-of-band fingerprint verification
  • Secure Boot (GRUB/kernel signing) is a separate mechanism from package signing and is not supported
  • GPG/OpenPGP is not supported. It will be added in the future by extending the signature envelope’s algorithm