summaryrefslogtreecommitdiff
path: root/tests/gen_test_keys.sh
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@google.com>2017-02-07 11:40:59 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-02-18 00:39:28 -0800
commit83bd850f3fd45648bb811f6080efac396c8a2062 (patch)
tree3e22a3c7755002b5dbe55eb0ce951afc4ab24899 /tests/gen_test_keys.sh
parent94bd5c5069e6ca0c99754f39152bd4e059968904 (diff)
downloadvboot-83bd850f3fd45648bb811f6080efac396c8a2062.tar.gz
This also adds the required tests (keys, testcases). BRANCH=none BUG=chromium:684354 TEST=make runtests Change-Id: I5e148f8792ea325f813d76089271f3c4bcc2935d Reviewed-on: https://chromium-review.googlesource.com/438951 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'tests/gen_test_keys.sh')
-rwxr-xr-xtests/gen_test_keys.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/gen_test_keys.sh b/tests/gen_test_keys.sh
index dbb17419..04315ac3 100755
--- a/tests/gen_test_keys.sh
+++ b/tests/gen_test_keys.sh
@@ -25,7 +25,15 @@ function generate_keys {
continue
fi
- openssl genrsa -F4 -out ${key_base}.pem $i
+ # Extract exponent from key_length name, if necessary
+ exp="F4"
+ bits=$i
+ if [ "${i##*_exp}" != "${i}" ]; then
+ exp="${i##*_exp}"
+ bits="${i%%_exp${exp}}"
+ fi
+
+ openssl genrsa -${exp} -out ${key_base}.pem ${bits}
# Generate self-signed certificate from key.
openssl req -batch -new -x509 -key ${key_base}.pem \
-out ${key_base}.crt