Files
OpenCellular/tests/run_vboot_common_tests.sh
Bill Richardson 2448d3b3bc Create vbutil_ec tool for signing EC firmware.
This just adds the vbutil_ec tool (and a simple test of the library
functions related to it).

BUG=chrome-os-partner:7459, chromium-os:27142
TEST=manual

  make
  make runtests

Change-Id: I2a2c4e7cfb8ac6ce2229c5de4252a5cc89321fa5
Reviewed-on: https://gerrit.chromium.org/gerrit/21868
Commit-Ready: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2012-05-04 12:16:45 -07:00

92 lines
2.4 KiB
Bash
Executable File

#!/bin/bash
# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Run verified boot firmware and kernel verification tests.
# Load common constants and variables.
. "$(dirname "$0")/common.sh"
return_code=0
function test_vboot_common {
${TEST_DIR}/vboot_common_tests
if [ $? -ne 0 ]
then
return_code=255
fi
}
function test_vboot_common2 {
algorithmcounter=0
for keylen in ${key_lengths[@]}
do
for hashalgo in ${hash_algos[@]}
do
echo -e "For signing key ${COL_YELLOW}RSA-$keylen/$hashalgo${COL_STOP}:"
${TEST_DIR}/vboot_common2_tests $algorithmcounter \
${TESTKEY_DIR}/key_rsa${keylen}.pem \
${TESTKEY_DIR}/key_rsa${keylen}.keyb
if [ $? -ne 0 ]
then
return_code=255
fi
let algorithmcounter=algorithmcounter+1
done
done
}
function test_vboot_common3 {
# Test for various combinations of firmware signing algorithm and
# kernel signing algorithm
firmware_algorithmcounter=0
kernel_algorithmcounter=0
for firmware_keylen in ${key_lengths[@]}
do
for firmware_hashalgo in ${hash_algos[@]}
do
let kernel_algorithmcounter=0
for kernel_keylen in ${key_lengths[@]}
do
for kernel_hashalgo in ${hash_algos[@]}
do
echo -e "For ${COL_YELLOW}signing algorithm \
RSA-${firmware_keylen}/${firmware_hashalgo}${COL_STOP} \
and ${COL_YELLOW}data signing algorithm RSA-${kernel_keylen}/\
${kernel_hashalgo}${COL_STOP}"
${TEST_DIR}/vboot_common3_tests \
$firmware_algorithmcounter $kernel_algorithmcounter \
${TESTKEY_DIR}/key_rsa${firmware_keylen}.pem \
${TESTKEY_DIR}/key_rsa${firmware_keylen}.keyb \
${TESTKEY_DIR}/key_rsa${kernel_keylen}.pem \
${TESTKEY_DIR}/key_rsa${kernel_keylen}.keyb
if [ $? -ne 0 ]
then
return_code=255
fi
let kernel_algorithmcounter=kernel_algorithmcounter+1
done
done
let firmware_algorithmcounter=firmware_algorithmcounter+1
done
done
}
check_test_keys
echo
echo "Testing vboot_common tests which don't depend on keys..."
test_vboot_common
echo
echo "Testing vboot_common tests which depend on one key..."
test_vboot_common2
echo
echo "Testing vboot_common tests which depend on two keys..."
test_vboot_common3
exit $return_code