summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2019-04-25 17:27:17 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-04-27 04:13:04 -0700
commit20467f0bd57bd99836c1bb5d03b029b48f2da132 (patch)
tree15eb92300b76527248f6b34194a9933a5a51c2c0
parent231112a2c6f646f2d11a67e6a1f2fa8c085b9a14 (diff)
downloadvboot-20467f0bd57bd99836c1bb5d03b029b48f2da132.tar.gz
vboot: add vb2_sha.h to replace NEED_VB2_SHA_LIBRARY
When clients wish to use SHA functionality, they should import vb2_sha.h header instead of setting NEED_VB2_SHA_LIBRARY and importing vb2_api.h. The latter will be deprecated. NEED_VB2_SHA_LIBRARY is troublesome since the compiler may complain when it is defined multiple times within the same namespace. BUG=b:124141368, chromium:956474 TEST=make clean && make runtests BRANCH=none Change-Id: Ie39bb14e7fb35fd7e365acdd29dd5524567358b1 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/1583820 Commit-Ready: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Randall Spangler <rspangler@google.com>
-rw-r--r--firmware/2lib/include/2sha.h4
-rw-r--r--firmware/include/vb2_sha.h13
2 files changed, 15 insertions, 2 deletions
diff --git a/firmware/2lib/include/2sha.h b/firmware/2lib/include/2sha.h
index 38b8a816..f41d8e15 100644
--- a/firmware/2lib/include/2sha.h
+++ b/firmware/2lib/include/2sha.h
@@ -3,8 +3,8 @@
* found in the LICENSE file.
*
* These APIs may be called by external firmware as well as vboot. External
- * firmware must NOT include this header file directly; instead, define
- * NEED_VB2_SHA_LIBRARY and include vb2api.h. This is permissible because the
+ * firmware must NOT include this header file directly; instead, import
+ * the external-facing vb2_sha.h. This is permissible because the
* SHA library routines below don't interact with the rest of vboot.
*/
diff --git a/firmware/include/vb2_sha.h b/firmware/include/vb2_sha.h
new file mode 100644
index 00000000..fe8b2aaf
--- /dev/null
+++ b/firmware/include/vb2_sha.h
@@ -0,0 +1,13 @@
+/* Copyright 2019 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.
+ *
+ * This header may be imported to expose vboot SHA implemenation.
+ */
+
+#ifndef VBOOT_REFERENCE_VB2_SHA_H_
+#define VBOOT_REFERENCE_VB2_SHA_H_
+
+#include "../2lib/include/2sha.h"
+
+#endif /* VBOOT_REFERENCE_VB2_SHA_H_ */