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

Side by Side Diff: tests/gen_test_keys.sh

Issue 2845001: Rework the vboot_reference make system. (Closed) Base URL: ssh://git@chromiumos-git/vboot_reference.git
Patch Set: Rework the vboot_reference make system. Created 10 years, 6 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 unified diff | Download patch
« no previous file with comments | « tests/common.sh ('k') | tests/run_cgpt_tests.sh » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/bin/bash 1 #!/bin/bash
2 2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 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 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 # 6 #
7 # Generate test keys for use by the tests. 7 # Generate test keys for use by the tests.
8 8
9 # Load common constants and variables. 9 # Load common constants and variables.
10 . "$(dirname "$0")/common.sh" 10 . "$(dirname "$0")/common.sh"
11 11
12 # Generate RSA test keys of various lengths. 12 # Generate RSA test keys of various lengths.
13 function generate_keys { 13 function generate_keys {
14 for i in ${key_lengths[@]} 14 for i in ${key_lengths[@]}
15 do 15 do
16 if [ -f ${TESTKEY_DIR}/key_rsa$i.keyb ]; then
17 continue
18 fi
16 openssl genrsa -F4 -out ${TESTKEY_DIR}/key_rsa$i.pem $i 19 openssl genrsa -F4 -out ${TESTKEY_DIR}/key_rsa$i.pem $i
17 # Generate self-signed certificate from key. 20 # Generate self-signed certificate from key.
18 openssl req -batch -new -x509 -key ${TESTKEY_DIR}/key_rsa$i.pem \ 21 openssl req -batch -new -x509 -key ${TESTKEY_DIR}/key_rsa$i.pem \
19 -out ${TESTKEY_DIR}/key_rsa$i.crt 22 -out ${TESTKEY_DIR}/key_rsa$i.crt
20 # Generate pre-processed key for use by RSA signature verification code. 23 # Generate pre-processed key for use by RSA signature verification code.
21 ${UTIL_DIR}/dumpRSAPublicKey ${TESTKEY_DIR}/key_rsa$i.crt \ 24 ${UTIL_DIR}/dumpRSAPublicKey ${TESTKEY_DIR}/key_rsa$i.crt \
22 > ${TESTKEY_DIR}/key_rsa$i.keyb 25 > ${TESTKEY_DIR}/key_rsa$i.keyb
23 done 26 done
24 } 27 }
25 28
26 mkdir -p ${TESTKEY_DIR} 29 mkdir -p ${TESTKEY_DIR}
27 generate_keys 30 generate_keys
OLDNEW
« no previous file with comments | « tests/common.sh ('k') | tests/run_cgpt_tests.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698