Skip to content

Commit

Permalink
feat: have repros sign digests target
Browse files Browse the repository at this point in the history
  • Loading branch information
lrvick committed Oct 18, 2024
1 parent 276b96b commit edbeda3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .repros/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
build:
command: make
sign:
file: out/manifest.txt
file: out/digests.txt
format: raw
method: ssh
backing: tpm
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ include src/macros.mk
REGISTRY := local
.DEFAULT_GOAL :=
.PHONY: default
default: \
default: out/digests.txt

.PHONY: all
all: \
out/qos_client/index.json \
out/qos_host/index.json \
out/qos_enclave/index.json
Expand Down Expand Up @@ -39,6 +42,9 @@ shell: out/.common-loaded
qos-local/common:latest \
/bin/bash

out/digests.txt: all
@$(call digests) > $@

out/nitro.pcrs: out/qos_enclave.tar
@$(call run,/src/scripts/extract_oci_file.sh qos_enclave.tar nitro.pcrs)

Expand Down
12 changes: 12 additions & 0 deletions src/macros.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ define run
/bin/sh -c "set -eu; $(1)"
endef

define digests
find out -iname "index.json" \
| awk -F/ '{print $$2}' \
| sort \
| while IFS= read -r package; do \
jq \
-jr '.manifests[].digest | sub ("sha256:";"")' \
out/$${package}/index.json; \
printf " %s\n" "$${package}"; \
done
endef

define build_context
$$( \
self=$(1); \
Expand Down

0 comments on commit edbeda3

Please sign in to comment.