You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(tier4): simplify the digest-tamper fixture (ponytail-review)
Drop the dead pre-existence guard around the bundle extraction (WORK is
always a fresh mktemp -d, so the dir can never already exist) and replace
the last-hex-char-flip case statement with a fixed all-zero 64-char digest
— same effect (a well-formed but mismatched sha256), fewer lines.
orig_sha="$(grep -oE 'pithead-tor:[^[:space:]]*@sha256:[0-9a-f]+'"$tdir/docker-compose.yml"| grep -oE 'sha256:[0-9a-f]+'| head -1)"
225
223
[ -n"$orig_sha" ] ||
226
224
die "Could not find a digest-pinned pithead-tor image in the bundle's docker-compose.yml to tamper — the bundle isn't digest-pinned (#461 regression)."
227
-
# Flip the last hex character so the digest keeps its real shape (64 hex chars) but names a
228
-
# manifest that exists nowhere in the registry — a mismatched, not malformed, digest.
229
-
last_char="${orig_sha: -1}"
230
-
case"$last_char"in
231
-
0) new_char=1 ;;
232
-
*) new_char=0 ;;
233
-
esac
234
-
bad_sha="${orig_sha%?}${new_char}"
225
+
# A fixed all-zero 64-hex-char digest: the right SHAPE (a sha256 never legitimately hashes to
226
+
# it) so verify_release_images sees a well-formed-but-mismatched digest, not a parse error.
227
+
bad_sha="sha256:$(printf '%064d' 0)"
235
228
sed -E "s#(pithead-tor:[^[:space:]]*@)$orig_sha#\\1$bad_sha#""$tdir/docker-compose.yml">"$tdir/docker-compose.yml.tmp"&&
0 commit comments