summaryrefslogtreecommitdiff
path: root/firmware/2lib/include/2id.h
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2015-03-04 16:13:45 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-03-10 23:46:07 +0000
commit36bc59140c9d3d4110b3d1c4b7c6b0b84875e81e (patch)
tree33dacefd33271d0cb35a7f39d298e486c5387ce5 /firmware/2lib/include/2id.h
parent0f21441e78114805e2baf61b1cabc6a5b55183c6 (diff)
downloadvboot-36bc59140c9d3d4110b3d1c4b7c6b0b84875e81e.tar.gz
vb21: Rename struct vb2_guid to struct vb2_id
Since the ID structure isn't a true GUID anymore, let's call it something else. BUG=none BRANCH=none TEST=make runtests Change-Id: I96f511bd5587a94d2cc20764e26d7ef0096de04c Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/256182 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'firmware/2lib/include/2id.h')
-rw-r--r--firmware/2lib/include/2id.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/firmware/2lib/include/2id.h b/firmware/2lib/include/2id.h
new file mode 100644
index 00000000..03f6d961
--- /dev/null
+++ b/firmware/2lib/include/2id.h
@@ -0,0 +1,28 @@
+/* Copyright 2015 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.
+ *
+ * Key ID, used to quickly match keys with signatures. There's not a standard
+ * fingerprint for private keys, so we're using the sha1sum of the public key
+ * in our keyb format. Pretty much anything would work as long as it's
+ * resistant to collisions and easy to compare.
+ */
+
+#ifndef VBOOT_REFERENCE_VBOOT_2ID_H_
+#define VBOOT_REFERENCE_VBOOT_2ID_H_
+#include <stdint.h>
+
+#define VB2_ID_NUM_BYTES 20
+
+struct vb2_id {
+ uint8_t raw[VB2_ID_NUM_BYTES];
+} __attribute__((packed));
+
+#define EXPECTED_ID_SIZE VB2_ID_NUM_BYTES
+
+/* IDs to use for "keys" with sig_alg==VB2_SIG_NONE */
+#define VB2_ID_NONE_SHA1 {{0x00, 0x01,}}
+#define VB2_ID_NONE_SHA256 {{0x02, 0x56,}}
+#define VB2_ID_NONE_SHA512 {{0x05, 0x12,}}
+
+#endif /* VBOOT_REFERENCE_VBOOT_2ID_H_ */