summaryrefslogtreecommitdiff
path: root/tests/gen_test_vbpubks.sh
diff options
context:
space:
mode:
authorGaurav Shah <gauravsh@chromium.org>2010-06-29 19:46:39 -0700
committerGaurav Shah <gauravsh@chromium.org>2010-06-29 19:46:39 -0700
commitbde9a64357657a37aa7a2788aeeed67a62acdd94 (patch)
tree7374e17b801c2140ae0244892d4ec8a1c63aa691 /tests/gen_test_vbpubks.sh
parent0ec7078d5b9995bd2fd0de445c5ec444793dc26c (diff)
downloadvboot-bde9a64357657a37aa7a2788aeeed67a62acdd94.tar.gz
Fix name. Use existing directory check.
Review URL: http://codereview.chromium.org/2805051
Diffstat (limited to 'tests/gen_test_vbpubks.sh')
-rwxr-xr-xtests/gen_test_vbpubks.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/gen_test_vbpubks.sh b/tests/gen_test_vbpubks.sh
new file mode 100755
index 00000000..995a48b9
--- /dev/null
+++ b/tests/gen_test_vbpubks.sh
@@ -0,0 +1,29 @@
+#!/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.
+#
+# Generate test vboot public keys and keyblocks for testing.
+
+# Load common constants and variables.
+. "$(dirname "$0")/common.sh"
+
+function generate_vpubks {
+ algorithmcounter=0
+ for keylen in ${key_lengths[@]}
+ do
+ for hashalgo in ${hash_algos[@]}
+ do
+ ${UTIL_DIR}/vbutil_key --pack \
+ --in ${TESTKEY_DIR}/key_rsa${keylen}.keyb \
+ --out ${TESTKEY_DIR}/key_rsa${keylen}.${hashalgo}.vbpubk \
+ --version 1 \
+ --algorithm ${algorithmcounter}
+ let algorithmcounter=algorithmcounter+1
+ done
+ done
+}
+
+check_test_keys
+generate_vpubks