aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.main4
-rwxr-xr-xlibstb/sign-with-local-keys.sh10
2 files changed, 10 insertions, 4 deletions
diff --git a/Makefile.main b/Makefile.main
index 516afdd..46ad3b0 100644
--- a/Makefile.main
+++ b/Makefile.main
@@ -223,10 +223,10 @@ $(TARGET).lid: $(TARGET).elf
$(call Q,OBJCOPY, $(OBJCOPY) -O binary -S $^ $@, $@)
$(TARGET).lid.stb: $(TARGET).lid libstb/create-container
- $(call Q,STB-DEVELOPMENT-SIGNED-CONTAINER,$(SRC)/libstb/sign-with-local-keys.sh $< $@ $(SRC)/libstb/keys/,$@)
+ $(call Q,STB-DEVELOPMENT-SIGNED-CONTAINER,$(SRC)/libstb/sign-with-local-keys.sh $< $@ $(SRC)/libstb/keys/ PAYLOAD,$@)
$(TARGET).lid.xz.stb: $(TARGET).lid.xz libstb/create-container
- $(call Q,STB-DEVELOPMENT-SIGNED-CONTAINER,$(SRC)/libstb/sign-with-local-keys.sh $< $@ $(SRC)/libstb/keys/,$@)
+ $(call Q,STB-DEVELOPMENT-SIGNED-CONTAINER,$(SRC)/libstb/sign-with-local-keys.sh $< $@ $(SRC)/libstb/keys/ PAYLOAD,$@)
$(TARGET).tmp.elf: $(ALL_OBJS_1) $(TARGET).lds $(KERNEL)
$(call Q,LD, $(CC) $(LDFLAGS) -T $(TARGET).lds $(ALL_OBJS_1) -o $@, $@)
diff --git a/libstb/sign-with-local-keys.sh b/libstb/sign-with-local-keys.sh
index edd2757..efddabf 100755
--- a/libstb/sign-with-local-keys.sh
+++ b/libstb/sign-with-local-keys.sh
@@ -9,13 +9,19 @@ if [ ! -f $PAYLOAD ]; then
fi
KEYLOC=$3
+LABEL=$4
+
T=`mktemp -d`
+LABEL_ARG=""
+if [ ! -z "$LABEL" ]; then
+ LABEL_ARG="-L $LABEL"
+fi
# Build enough of the container to create the Prefix and Software headers.
# (reuse HW key for SW key P)
./libstb/create-container -a $KEYLOC/hw_key_a.key -b $KEYLOC/hw_key_b.key -c $KEYLOC/hw_key_c.key \
-p $KEYLOC/hw_key_a.key \
- --payload $PAYLOAD --imagefile $OUTPUT \
+ --payload $PAYLOAD --imagefile $OUTPUT $LABEL_ARG \
--dumpPrefixHdr $T/prefix_hdr --dumpSwHdr $T/software_hdr
# Sign the Prefix header.
@@ -28,7 +34,7 @@ openssl dgst -SHA512 -sign $KEYLOC/hw_key_a.key $T/software_hdr > $T/sw_key_p.si
# Build the full container with signatures.
./libstb/create-container -a $KEYLOC/hw_key_a.key -b $KEYLOC/hw_key_b.key -c $KEYLOC/hw_key_c.key \
- -p $KEYLOC/hw_key_a.key \
+ -p $KEYLOC/hw_key_a.key $LABEL_ARG \
-A $T/hw_key_a.sig -B $T/hw_key_b.sig -C $T/hw_key_c.sig \
-P $T/sw_key_p.sig \
--payload $PAYLOAD --imagefile $OUTPUT