Skip to content

Commit 50e3d61

Browse files
committed
makefiles/suit: allow to decrypt signing key with SUIT_SEC_PASSWORD
1 parent 1517949 commit 50e3d61

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

makefiles/suit.inc.mk

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,13 @@ $(SUIT_MANIFEST): $(SUIT_MANIFEST_PAYLOADS) $(BINDIR_SUIT)
5656
$(SUIT_MANIFEST_SIGNED): $(SUIT_MANIFEST) $(SUIT_SEC)
5757
$(Q)( \
5858
if grep -q ENCRYPTED $(SUIT_SEC_SIGN); then \
59-
printf "Enter encryption for key file $(SUIT_SEC_SIGN): "; \
60-
read PASSWORD; \
61-
$(SUIT_TOOL) sign -p $$PASSWORD -k $(SUIT_SEC_SIGN) -m $(SUIT_MANIFEST) -o $@; \
59+
if [ -z "$(SUIT_SEC_PASSWORD)" ]; then \
60+
printf "Enter encryption for key file $(SUIT_SEC_SIGN): "; \
61+
read PASSWORD; \
62+
else \
63+
PASSWORD="$(SUIT_SEC_PASSWORD)"; \
64+
fi; \
65+
$(SUIT_TOOL) sign -p "$$PASSWORD" -k $(SUIT_SEC_SIGN) -m $(SUIT_MANIFEST) -o $@;\
6266
else \
6367
$(SUIT_TOOL) sign -k $(SUIT_SEC_SIGN) -m $(SUIT_MANIFEST) -o $@; \
6468
fi \

0 commit comments

Comments
 (0)