Add a native full post-quantum encryption mode and fix a critical keystream-reuse bug in deduplicated encrypted archives. Full post-quantum mode (--pq-only) - New envelope type 0x06 (ZUPT_ENC_PQ_ONLY): ML-KEM-768 (FIPS 203) as the sole key-establishment mechanism, with no classical X25519 component. Archive key = SHA3-512(ml_ss || ml_ct || "ZUPT-PQ-ONLY-v1"). - For compliance postures that require a single NIST-standardised PQ primitive with no classical KEM in the envelope (CNSA 2.0-style "PQ-only"). Hybrid --pq stays the recommended default; --pq-only has no classical fallback, so a break of ML-KEM-768 alone breaks it. - keygen --pq-only / keygen --pub --pq-only (ZPQK magic, 1200B pub / 3600B priv; not interchangeable with hybrid --pq keys). Wrong or tampered ciphertext is rejected via ML-KEM FO implicit rejection plus the HMAC-SHA256 Encrypt-then-MAC envelope. In-tree, default build. Security (critical): AES-256-CTR keystream reuse under --dedup - Dedup assigns block sequence 0 to every data block (the sentinel that keeps cross-file dedup references authenticating consistently). The per-block nonce was base_nonce XOR block_seq, so under --dedup every block collapsed to the same nonce, reusing the CTR keystream across distinct plaintexts (a many-time-pad). Each block now uses a fresh random 128-bit nonce stored in the block prefix and bound into the block MAC; block_seq is still bound as MAC AAD. Regression test: tests/test_dedup_nonce.sh. Re-encrypt any --dedup encrypted archives written by <= 4.1.0. Other - keygen --sdk / --box on a source-only build now fails with a clear message pointing to native --pq / --pq-only (or a WITH_SDK=1 build). - Documentation: README, SECURITY, THREAT_MODEL, man page, CHANGELOG, and all packaging recipes updated for the new mode and the security fix; version bumped to 4.2.0. Wire format v1.6 unchanged (0x06 is additive). Validation: make check 16/16, quick suite 11/11 (incl. PQ-only), dedup-nonce regression (all block nonces distinct), cppcheck clean.
64 lines
2.6 KiB
Shell
64 lines
2.6 KiB
Shell
# Maintainer: Cristian Cezar Moisés <sac@securityops.co>
|
|
#
|
|
# AUR submission instructions:
|
|
# 1. Run `make dist` upstream to produce zupt-VERSION.tar.gz.
|
|
# 2. Upload that tarball somewhere stable (GitHub release / git.securityops.co).
|
|
# 3. Update `source=()` URL and `sha256sums=()` below.
|
|
# 4. Run `makepkg --printsrcinfo > .SRCINFO` in this directory.
|
|
# 5. Commit and push to ssh://aur@aur.archlinux.org/zupt.git
|
|
#
|
|
# Test locally: `makepkg -s` in this directory after dropping a copy of the
|
|
# zupt-VERSION.tar.gz alongside the PKGBUILD.
|
|
|
|
pkgname=vaptvupt
|
|
pkgver=4.2.0
|
|
pkgrel=1
|
|
provides=('zupt')
|
|
replaces=('zupt')
|
|
conflicts=('zupt')
|
|
pkgdesc='Pure-C11 post-quantum backup compression utility (AES-256-CTR + HMAC-SHA256 + ML-KEM-768 + X25519)'
|
|
arch=('x86_64' 'aarch64')
|
|
url='https://git.securityops.co/cristiancmoises/zupt'
|
|
license=('AGPL-3.0-or-later')
|
|
depends=('glibc')
|
|
makedepends=('gcc')
|
|
checkdepends=('python')
|
|
|
|
# Replace SHA256 placeholder with output of:
|
|
# sha256sum /tmp/zupt-2.4.4.tar.gz
|
|
source=("${pkgname}-${pkgver}.tar.gz::https://git.securityops.co/cristiancmoises/zupt/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
|
|
sha256sums=('SKIP')
|
|
|
|
build() {
|
|
cd "${pkgname}-${pkgver}"
|
|
# Strict-warning build that the project's own §6 verification matrix uses.
|
|
CFLAGS="${CFLAGS:--O2 -std=c11} -Wall -Wextra -Wpedantic" \
|
|
make -j"$(nproc)"
|
|
}
|
|
|
|
check() {
|
|
cd "${pkgname}-${pkgver}"
|
|
# Project regression suite — F-06 HMAC, F-08 top-MAC, F-09 byte sweep, etc.
|
|
make test
|
|
}
|
|
|
|
package() {
|
|
cd "${pkgname}-${pkgver}"
|
|
make DESTDIR="${pkgdir}" PREFIX=/usr install
|
|
|
|
# Docs that aren't part of `make install`
|
|
install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
|
|
install -Dm644 SECURITY.md "${pkgdir}/usr/share/doc/${pkgname}/SECURITY.md"
|
|
install -Dm644 CHANGELOG.md "${pkgdir}/usr/share/doc/${pkgname}/CHANGELOG.md"
|
|
install -Dm644 AUDIT.md "${pkgdir}/usr/share/doc/${pkgname}/AUDIT.md"
|
|
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
|
|
|
|
# Vendored libzuptsdk shipped alongside the binary because the binary
|
|
# is linked with -Wl,-rpath,$ORIGIN/vendor/zuptsdk. For system install
|
|
# we move it to /usr/lib/zupt/ and the binary's rpath remains relative.
|
|
install -d "${pkgdir}/usr/lib/${pkgname}"
|
|
install -Dm755 vendor/zuptsdk/libzuptsdk.so.2.0.0 \
|
|
"${pkgdir}/usr/lib/${pkgname}/libzuptsdk.so.2.0.0"
|
|
ln -sf libzuptsdk.so.2.0.0 "${pkgdir}/usr/lib/${pkgname}/libzuptsdk.so.2"
|
|
ln -sf libzuptsdk.so.2.0.0 "${pkgdir}/usr/lib/${pkgname}/libzuptsdk.so"
|
|
}
|