Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1109)

Unified Diff: tests/run_vbutil_tests.sh

Issue 3124004: Changes to allow user-signed kernels to be generated. (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Respond to feedback Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « host/lib/host_keyblock.c ('k') | utility/Makefile » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/run_vbutil_tests.sh
diff --git a/tests/run_vbutil_tests.sh b/tests/run_vbutil_tests.sh
index abbd17b70d1f834b70bb537be8fd0646e0c38e9b..b8811305717caaf0fb42400770f7880e1e62f8f7 100755
--- a/tests/run_vbutil_tests.sh
+++ b/tests/run_vbutil_tests.sh
@@ -68,13 +68,25 @@ ${datahashalgo}${COL_STOP}"
keyblockfile+="${data_algorithmcounter}.keyblock"
rm -f ${keyblockfile}
- # Wrap
+ # Wrap private key
${UTIL_DIR}/vbutil_key \
--pack ${TESTKEY_SCRATCH_DIR}/key_alg${algorithmcounter}.vbprivk \
--key ${TESTKEY_DIR}/key_rsa${signing_keylen}.pem \
--algorithm $signing_algorithmcounter
if [ $? -ne 0 ]
then
+ echo -e "${COL_RED}Wrap vbprivk${COL_STOP}"
+ return_code=255
+ fi
+
+ # Wrap public key
+ ${UTIL_DIR}/vbutil_key \
+ --pack ${TESTKEY_SCRATCH_DIR}/key_alg${algorithmcounter}.vbpubk \
+ --key ${TESTKEY_DIR}/key_rsa${signing_keylen}.keyb \
+ --algorithm $signing_algorithmcounter
+ if [ $? -ne 0 ]
+ then
+ echo -e "${COL_RED}Wrap vbpubk${COL_STOP}"
return_code=255
fi
@@ -86,17 +98,30 @@ ${datahashalgo}${COL_STOP}"
${TESTKEY_SCRATCH_DIR}/key_alg${algorithmcounter}.vbprivk
if [ $? -ne 0 ]
then
+ echo -e "${COL_RED}Pack${COL_STOP}"
return_code=255
fi
# Unpack
${UTIL_DIR}/vbutil_keyblock --unpack ${keyblockfile} \
+ --datapubkey \
+ ${TESTKEY_SCRATCH_DIR}/key_alg${data_algorithmcounter}.vbpubk2 \
--signpubkey \
- ${TESTKEY_SCRATCH_DIR}/key_alg${signing_algorithmcounter}.vbpubk
- # TODO: check data key against the packed one?
+ ${TESTKEY_SCRATCH_DIR}/key_alg${algorithmcounter}.vbpubk
if [ $? -ne 0 ]
then
+ echo -e "${COL_RED}Unpack${COL_STOP}"
+ return_code=255
+ fi
+
+ # Check
+ if ! cmp -s \
+ ${TESTKEY_SCRATCH_DIR}/key_alg${data_algorithmcounter}.vbpubk \
+ ${TESTKEY_SCRATCH_DIR}/key_alg${data_algorithmcounter}.vbpubk2
+ then
+ echo -e "${COL_RED}Check${COL_STOP}"
return_code=255
+ exit 1
fi
let data_algorithmcounter=data_algorithmcounter+1
« no previous file with comments | « host/lib/host_keyblock.c ('k') | utility/Makefile » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698