1#!/bin/bash -eux 2# Copyright 2015 The Chromium OS Authors. All rights reserved. 3# Use of this source code is governed by a BSD-style license that can be 4# found in the LICENSE file. 5 6me=${0##*/} 7TMP="$me.tmp" 8 9# Work in scratch directory 10cd "$OUTDIR" 11 12# Current vb1 keys, including original .pem files. 13TESTKEYS=${SRCDIR}/tests/testkeys 14 15# Demonstrate that we can recreate the same vb1 keys without the .keyb files 16for sig in rsa1024 rsa2048 rsa4096 rsa8192; do 17 for hash in sha1 sha256 sha512; do 18 ${FUTILITY} --vb1 create --hash_alg "${hash}" \ 19 "${TESTKEYS}/key_${sig}.pem" "${TMP}_key_${sig}.${hash}" 20 cmp "${TESTKEYS}/key_${sig}.${hash}.vbprivk" \ 21 "${TMP}_key_${sig}.${hash}.vbprivk" 22 cmp "${TESTKEYS}/key_${sig}.${hash}.vbpubk" \ 23 "${TMP}_key_${sig}.${hash}.vbpubk" 24 done 25done 26 27 28# Demonstrate that we can create some vb21 keypairs. This doesn't prove 29# prove anything until we've used them to sign some stuff, though. 30for sig in rsa1024 rsa2048 rsa4096 rsa8192; do 31 for hash in sha1 sha256 sha512; do 32 ${FUTILITY} --vb21 create --hash_alg "${hash}" \ 33 "${TESTKEYS}/key_${sig}.pem" "${TMP}_key_${sig}.${hash}" 34 done 35done 36 37# cleanup 38rm -rf ${TMP}* 39exit 0 40