Index: src/platform/vboot_reference/tests/run_tests.sh |
diff --git a/src/platform/vboot_reference/tests/run_tests.sh b/src/platform/vboot_reference/tests/run_tests.sh |
index e5ee196cc5c619c222f9f78b2ff34a3cbd197d00..68b81bbdcabc56fdee28bfcc8c4f22d7e08e9cc1 100755 |
--- a/src/platform/vboot_reference/tests/run_tests.sh |
+++ b/src/platform/vboot_reference/tests/run_tests.sh |
@@ -12,6 +12,13 @@ key_lengths=( 1024 2048 4096 8192 ) |
TEST_FILE=test_file |
TEST_FILE_SIZE=1000000 |
UTIL_DIR=../utils/ |
+TEST_DIR=../tests/ |
+ |
+# Color code output |
+COL_YELLOW='\E[1;33m' |
+COL_RED='\E[1;31m' |
+COL_GREEN='\E[1;32m' |
+COL_STOP='\E[0m' |
# Generate RSA test keys of various lengths. |
function generate_keys { |
@@ -54,6 +61,21 @@ function test_signatures { |
done |
} |
+function test_verification { |
+ algorithmcounter=0 |
+ for keylen in ${key_lengths[@]} |
+ do |
+ for hashalgo in ${hash_algos[@]} |
+ do |
+ echo -e "For ${COL_YELLOW}RSA-$keylen and $hashalgo${COL_STOP}:" |
+ cd ${UTIL_DIR} && ${TEST_DIR}/firmware_image_tests $algorithmcounter testkeys/key_rsa8192.pem \ |
+ testkeys/key_rsa8192.keyb testkeys/key_rsa${keylen}.pem \ |
+ testkeys/key_rsa${keylen}.keyb |
+ let algorithmcounter=algorithmcounter+1 |
+ done |
+ done |
+} |
+ |
function pre_work { |
# Generate a file with random bytes for signature tests. |
echo "Generating test file..." |
@@ -73,11 +95,15 @@ echo "Testing message digests..." |
echo |
echo "Testing signature verification..." |
-pre_work |
+#pre_work |
test_signatures |
echo |
+echo "Testing high-level image verification..." |
+test_verification |
+ |
+echo |
echo "Cleaning up..." |
-cleanup |
+#cleanup |