summaryrefslogtreecommitdiff
path: root/host/lib21
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2015-02-04 16:47:16 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-03-10 23:45:21 +0000
commitadd997fa941ef1a65207bee909a88e368a9b3d22 (patch)
treeeec7d3610d34338387e705b83b24a974c71d07ae /host/lib21
parent4e4c19602edf3834b50d66d3ba067e895aca6fa0 (diff)
downloadvboot-add997fa941ef1a65207bee909a88e368a9b3d22.tar.gz
futility: Display public and private keys for both formats
This enhances the futility show command to recognize and identify our public and private key files, for both the old vboot 1.0 format and the new vboot 2.1 format. BUG=chromium:231547 BRANCH=ToT TEST=make runtests vboot 1.0: futility show tests/devkeys/*.vbp* vboot 2.1: futility create tests/testkeys/key_rsa2048.pem foo futility show foo.vbp* Change-Id: I9d7641db03e480b416790a7da6b473215444128a Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/246767 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'host/lib21')
-rw-r--r--host/lib21/host_key.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/host/lib21/host_key.c b/host/lib21/host_key.c
index 4acba9cb..78a6d2ec 100644
--- a/host/lib21/host_key.c
+++ b/host/lib21/host_key.c
@@ -270,7 +270,7 @@ int vb2_private_key_write(const struct vb2_private_key *key,
memcpy(buf, &pkey, sizeof(pkey));
/* strcpy() is ok here because we checked the length above */
- if (key->desc)
+ if (pkey.c.desc_size)
strcpy((char *)buf + pkey.c.fixed_size, key->desc);
if (rsabuf) {