Gaurav Shah | 4d78d9a | 2010-06-29 17:29:18 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. |
| 4 | # Use of this source code is governed by a BSD-style license that can be |
| 5 | # found in the LICENSE file. |
| 6 | # |
| 7 | # Generate test vboot public keys and keyblocks for testing. |
| 8 | |
| 9 | # Load common constants and variables. |
| 10 | . "$(dirname "$0")/common.sh" |
| 11 | |
| 12 | function generate_vpubks { |
| 13 | algorithmcounter=0 |
| 14 | for keylen in ${key_lengths[@]} |
| 15 | do |
| 16 | for hashalgo in ${hash_algos[@]} |
| 17 | do |
Bill Richardson | a1d9fe6 | 2014-09-05 12:52:27 -0700 | [diff] [blame] | 18 | ${FUTILITY} vbutil_key --pack \ |
Gaurav Shah | 4d78d9a | 2010-06-29 17:29:18 -0700 | [diff] [blame] | 19 | --in ${TESTKEY_DIR}/key_rsa${keylen}.keyb \ |
| 20 | --out ${TESTKEY_DIR}/key_rsa${keylen}.${hashalgo}.vbpubk \ |
| 21 | --version 1 \ |
| 22 | --algorithm ${algorithmcounter} |
| 23 | let algorithmcounter=algorithmcounter+1 |
| 24 | done |
| 25 | done |
| 26 | } |
| 27 | |
Gaurav Shah | bde9a64 | 2010-06-29 19:46:39 -0700 | [diff] [blame] | 28 | check_test_keys |
Gaurav Shah | 4d78d9a | 2010-06-29 17:29:18 -0700 | [diff] [blame] | 29 | generate_vpubks |