2017-01-11 01:40:43 +08:00
|
|
|
#! /bin/sh
|
|
|
|
|
2017-02-02 23:10:23 +08:00
|
|
|
# This script can be used as an example of how to sign images.
|
|
|
|
|
2017-01-11 01:40:43 +08:00
|
|
|
source $(dirname $0)/target.sh
|
|
|
|
|
2017-02-02 23:10:23 +08:00
|
|
|
# RSA signatures can be made with the signing script in the scripts
|
|
|
|
# directory.
|
|
|
|
if true; then
|
|
|
|
./scripts/zep2newt.py \
|
|
|
|
--bin ../zephyr/samples/shell/outdir/$BOARD/zephyr.bin \
|
|
|
|
--key root.pem \
|
|
|
|
--sig RSA \
|
|
|
|
--out shell.signed.bin \
|
|
|
|
--vtoff 0x200 \
|
|
|
|
--word-size 8 \
|
|
|
|
--image-version 3 \
|
|
|
|
--bit --pad 0x20000
|
|
|
|
|
|
|
|
./scripts/zep2newt.py \
|
|
|
|
--bin ../zephyr/samples/hello_world/outdir/$BOARD/zephyr.bin \
|
|
|
|
--key root.pem \
|
|
|
|
--sig RSA \
|
|
|
|
--vtoff 0x200 \
|
|
|
|
--word-size 8 \
|
|
|
|
--image-version 2 \
|
|
|
|
--out hello.signed.bin
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Currently, ECDSA signatures need to be made with the imgtool. See
|
|
|
|
# 'imgtool' for instructions on building the tool.
|
|
|
|
if false; then
|
|
|
|
imgtool sign \
|
|
|
|
--key root_ec.pem \
|
|
|
|
--header-size 0x200 \
|
|
|
|
--version 3.0 \
|
|
|
|
--align 8 \
|
|
|
|
--pad 0x20000 \
|
|
|
|
../zephyr/samples/shell/outdir/$BOARD/zephyr.bin \
|
|
|
|
shell.signed.bin
|
2017-01-11 01:40:43 +08:00
|
|
|
|
2017-02-02 23:10:23 +08:00
|
|
|
imgtool sign \
|
|
|
|
--key root_ec.pem \
|
|
|
|
--header-size 0x200 \
|
|
|
|
--version 3.0 \
|
|
|
|
../zephyr/samples/hello_world/outdir/$BOARD/zephyr.bin \
|
|
|
|
hello.signed.bin
|
|
|
|
fi
|