From 70beb7aeff0783673ef1dee30ab0ae2125e0c7ee Mon Sep 17 00:00:00 2001 From: Shane Jaroch Date: Sat, 17 Jan 2026 08:18:10 -0500 Subject: [PATCH] lint/cubic --- tests/system-test-multikey.sh | 19 ++++++++----------- tests/system-test-privacy-leaks.sh | 3 ++- tests/system-test-repack.sh | 3 ++- tests/system-test.sh | 3 ++- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/system-test-multikey.sh b/tests/system-test-multikey.sh index 06e6ef3..ccba68c 100755 --- a/tests/system-test-multikey.sh +++ b/tests/system-test-multikey.sh @@ -82,7 +82,14 @@ trap 'rm -Rf -- "${tempdir}"' EXIT export HOME="${tempdir}" # Setup PATH to use local git-remote-gcrypt -PATH=${PWD}:${PATH} +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +repo_root="$(dirname "$SCRIPT_DIR")" +test_version=$(git describe --tags --always --dirty 2>/dev/null || echo "test") +cp "$repo_root/git-remote-gcrypt" "$tempdir/git-remote-gcrypt" +sed "s/@@DEV_VERSION@@/$test_version/" "$tempdir/git-remote-gcrypt" >"$tempdir/git-remote-gcrypt.tmp" +mv "$tempdir/git-remote-gcrypt.tmp" "$tempdir/git-remote-gcrypt" +chmod +x "$tempdir/git-remote-gcrypt" +PATH=$tempdir:${PATH} readonly PATH export PATH @@ -139,16 +146,6 @@ key_fps=() ) 2>&1 | indent # Capture fingerprints -# Integrated fix: use mapfile -# -# CRITICAL FIX: -# Previously, `grep fpr` captured both the Primary Key (EDDSA) and the Subkey (ECDH) fingerprints. -# This caused the `key_fps` array to double in size (36 entries for 18 keys). -# As a result, `key_fps[17]` (intended to be the last Primary Key) actually pointed to the -# Subkey of the 9th key (`key_fps[8*2 + 1]`). -# We configured `gcrypt.participants` with this Subkey, but GPG always signs with the Primary Key. -# This caused a signature mismatch ("Participant A vs Signer B") and verification failure. -# Using `awk` to filter `pub:` ensures we only capture the Primary Key. mapfile -t key_fps < <(gpg --list-keys --with-colons | awk -F: '/^pub:/ {f=1;next} /^fpr:/ && f {print $10;f=0}') echo "Generated keys: ${key_fps[*]}" | indent diff --git a/tests/system-test-privacy-leaks.sh b/tests/system-test-privacy-leaks.sh index 8b277bc..5df0d8f 100755 --- a/tests/system-test-privacy-leaks.sh +++ b/tests/system-test-privacy-leaks.sh @@ -15,7 +15,8 @@ trap 'rm -Rf -- "$tempdir"' EXIT export HOME="${tempdir}" # Ensure git-remote-gcrypt is in PATH -repo_root="${PWD}" +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +repo_root="$(dirname "$SCRIPT_DIR")" test_version=$(git describe --tags --always --dirty 2>/dev/null || echo "test") cp "$repo_root/git-remote-gcrypt" "$tempdir/git-remote-gcrypt" sed "s/@@DEV_VERSION@@/$test_version/" "$tempdir/git-remote-gcrypt" >"$tempdir/git-remote-gcrypt.tmp" diff --git a/tests/system-test-repack.sh b/tests/system-test-repack.sh index 58ffb84..db176a6 100755 --- a/tests/system-test-repack.sh +++ b/tests/system-test-repack.sh @@ -47,7 +47,8 @@ trap "rm -Rf -- '${tempdir}'" EXIT export HOME="${tempdir}" # Set up the PATH -repo_root="${PWD}" +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +repo_root="$(dirname "$SCRIPT_DIR")" test_version=$(git describe --tags --always --dirty 2>/dev/null || echo "test") cp "$repo_root/git-remote-gcrypt" "$tempdir/git-remote-gcrypt" sed -i "s/@@DEV_VERSION@@/$test_version/" "$tempdir/git-remote-gcrypt" diff --git a/tests/system-test.sh b/tests/system-test.sh index 9d398f3..d5471d7 100755 --- a/tests/system-test.sh +++ b/tests/system-test.sh @@ -74,7 +74,8 @@ export HOME="${tempdir}" # Set up the PATH to favor the version of git-remote-gcrypt from the repository # rather than a version that might already be installed on the user's system. # We also copy it to tempdir to inject a version number for testing. -repo_root="${PWD}" +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +repo_root="$(dirname "$SCRIPT_DIR")" test_version=$(git describe --tags --always --dirty 2>/dev/null || echo "test") cp "$repo_root/git-remote-gcrypt" "$tempdir/git-remote-gcrypt" sed "s/@@DEV_VERSION@@/$test_version/" "$tempdir/git-remote-gcrypt" > "$tempdir/git-remote-gcrypt.tmp" -- 2.52.0