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

Unified Diff: src/platform/vboot_reference/tests/gen_test_keys.sh

Issue 604016: Vboot Reference: Move test key generation to a separate script and add sample test keys. (Closed)
Patch Set: Fix spacing. Created 10 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform/vboot_reference/tests/Makefile ('k') | src/platform/vboot_reference/tests/run_tests.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/vboot_reference/tests/gen_test_keys.sh
diff --git a/src/platform/vboot_reference/tests/gen_test_keys.sh b/src/platform/vboot_reference/tests/gen_test_keys.sh
new file mode 100755
index 0000000000000000000000000000000000000000..2a8fe83e689f91d7aaf97fab5dc077404e5a230e
--- /dev/null
+++ b/src/platform/vboot_reference/tests/gen_test_keys.sh
@@ -0,0 +1,32 @@
+#!/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 keys for use by the tests.
+
+KEY_DIR=testkeys
+key_lengths=( 1024 2048 4096 8192 )
+UTIL_DIR=../utils/
+
+# Generate RSA test keys of various lengths.
+function generate_keys {
+ for i in ${key_lengths[@]}
+ do
+ openssl genrsa -F4 -out ${KEY_DIR}/key_rsa$i.pem $i
+ # Generate self-signed certificate from key.
+ openssl req -batch -new -x509 -key ${KEY_DIR}/key_rsa$i.pem \
+ -out ${KEY_DIR}/key_rsa$i.crt
+ # Generate pre-processed key for use by RSA signature verification code.
+ ${UTIL_DIR}/dumpRSAPublicKey ${KEY_DIR}/key_rsa$i.crt \
+ > ${KEY_DIR}/key_rsa$i.keyb
+ done
+}
+
+if [ ! -d "$KEY_DIR" ]
+then
+ mkdir "$KEY_DIR"
+fi
+
+generate_keys
« no previous file with comments | « src/platform/vboot_reference/tests/Makefile ('k') | src/platform/vboot_reference/tests/run_tests.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698