summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Zeuthen <zeuthen@google.com>2016-03-23 16:04:05 -0400
committerDavid Zeuthen <zeuthen@google.com>2016-03-23 16:04:05 -0400
commitae8b123b5edb8c8e4446311c8735351619450107 (patch)
tree93ca6a9a54d12ec0eee430e77c2c1db0d4402abb
parent67423cff39d7bd5f7d6402ad21c5a26643a3bb10 (diff)
downloadbvb-ae8b123b5edb8c8e4446311c8735351619450107.tar.gz
bvb_refimpl: Move library code to refimpl/ sub-directory.
This makes it easier to see exactly which files belong to the reference implementation. BUG=None TEST=Code builds and unit tests pass. Change-Id: Iebcc603985847c2f0af9df76396da138438edbef
-rw-r--r--Android.mk16
-rw-r--r--README62
-rw-r--r--refimpl/bvb_boot_image_header.h (renamed from bvb_boot_image_header.h)0
-rw-r--r--refimpl/bvb_property.c (renamed from bvb_property.c)0
-rw-r--r--refimpl/bvb_property.h (renamed from bvb_property.h)0
-rw-r--r--refimpl/bvb_refimpl.h (renamed from bvb_refimpl.h)0
-rw-r--r--refimpl/bvb_rsa.c (renamed from bvb_rsa.c)0
-rw-r--r--refimpl/bvb_rsa.h (renamed from bvb_rsa.h)0
-rw-r--r--refimpl/bvb_sha.h (renamed from bvb_sha.h)0
-rw-r--r--refimpl/bvb_sha256.c (renamed from bvb_sha256.c)0
-rw-r--r--refimpl/bvb_sha512.c (renamed from bvb_sha512.c)0
-rw-r--r--refimpl/bvb_sysdeps.h (renamed from bvb_sysdeps.h)0
-rw-r--r--refimpl/bvb_sysdeps_stub.c (renamed from bvb_sysdeps_stub.c)0
-rw-r--r--refimpl/bvb_util.c (renamed from bvb_util.c)0
-rw-r--r--refimpl/bvb_util.h (renamed from bvb_util.h)0
-rw-r--r--refimpl/bvb_verify.c (renamed from bvb_verify.c)0
-rw-r--r--refimpl/bvb_verify.h (renamed from bvb_verify.h)0
17 files changed, 30 insertions, 48 deletions
diff --git a/Android.mk b/Android.mk
index 7edbca8..4c93406 100644
--- a/Android.mk
+++ b/Android.mk
@@ -51,13 +51,13 @@ LOCAL_CFLAGS := $(bvb_common_cflags) -DBVB_ENABLE_DEBUG -DBVB_REFIMPL_COMPILATIO
LOCAL_LDFLAGS := $(bvb_common_ldflags)
LOCAL_C_INCLUDES :=
LOCAL_SRC_FILES := \
- bvb_property.c \
- bvb_rsa.c \
- bvb_sha256.c \
- bvb_sha512.c \
- bvb_sysdeps_stub.c \
- bvb_util.c \
- bvb_verify.c
+ refimpl/bvb_property.c \
+ refimpl/bvb_rsa.c \
+ refimpl/bvb_sha256.c \
+ refimpl/bvb_sha512.c \
+ refimpl/bvb_sysdeps_stub.c \
+ refimpl/bvb_util.c \
+ refimpl/bvb_verify.c
include $(BUILD_HOST_STATIC_LIBRARY)
include $(CLEAR_VARS)
@@ -68,7 +68,7 @@ LOCAL_CLANG := true
LOCAL_CFLAGS := $(bvb_common_cflags)
LOCAL_CPPFLAGS := $(bvb_common_cppflags)
LOCAL_LDFLAGS := $(bvb_common_ldflags)
-LOCAL_C_INCLUDES := external/gtest/include
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/refimpl external/gtest/include
LOCAL_STATIC_LIBRARIES := \
libbvb_refimpl \
libgmock_host \
diff --git a/README b/README
index f146540..37c5dac 100644
--- a/README
+++ b/README
@@ -5,58 +5,40 @@ signing boot images.
-- FILES AND DIRECTORIES
- bvb_boot_image.h
+ refimpl/
- The specification for a Brillo Boot Image as a C header file.
+ The reference implementation for boot image verification and A/B
+ selection is in the refimpl sub-directory.
- bvb_verify.[ch]
+ Part of this code is considered internal to the reference
+ implementation and should not be used outside it. This includes the
+ bvb_rsa.[ch] and bvb_sha.[ch] files.
- Code for cryptographically verifying a Brillo Boot Image.
-
- bvb_property.[ch]
-
- Code for looking up properties (key/value pairs) embedded in the
- boot image.
-
- bvb_sha.h, bvb_sha{256, 512}.c
-
- Code for calculating SHA-256 and SHA-512. Only to be used internally.
-
- bvb_rsa.h, bvb_rsa.c
-
- Code for verifying RSA signatures. Only to be used internally.
-
- bvb_util.[ch]
-
- Various utility code.
-
- bvb_sysdeps.h
-
- Declarations of system dependencies expected to be provided by the
- platform the reference implementation is used by. If the platform
- provides the standard C runtime you can use bvb_sysdeps_stub.c.
-
- bvb_sysdeps_stub.c
-
- An implementation of system dependencies for the standard C runtime.
+ System dependencies expected to be provided by the platform is
+ defined in bvb_sysdeps.h. If the platform provides the standard C
+ runtime bvb_sysdeps_stub.c can be used.
Android.mk
Build instructions for building the reference implementation and
associated unit tests.
- bvb_*_unittest.cc
+ bvb_util_unittest.cc, bvb_verify_unittest.cc, bvb_unittest_util.h
Unit tests for the reference implementation.
- test/
+ bvbtool_unittest.cc
- Contains test data used in unit tests.
+ Unit tests for bvbtool.
bvbtool
A tool written in Python for working with Brillo boot images.
+ test/
+
+ Contains test data used in unit tests.
+
-- AUDIENCE AND PORTABILITY NOTES
This code is intended to be used in bootloaders in devices running
@@ -82,15 +64,15 @@ The preprocessor symbol BVB_REFIMPL_COMPILATION should be set when
compiling the code. The code must be compiled into a separate library.
Applications using the compiled library must only include the
-bvb_refimpl.h file (which will include all public interfaces) and must
-not have the BVB_REFIMPL_COMPILATION preprocessor symbol set. This is
-to ensure that internal code that may be change in the future (for
-example bvb_sha.[ch] and bvb_rsa.[ch]) will not be visible to
-application code.
+refimpl/bvb_refimpl.h file (which will include all public interfaces)
+and must not have the BVB_REFIMPL_COMPILATION preprocessor symbol
+set. This is to ensure that internal code that may be change in the
+future (for example refimpl/bvb_sha.[ch] and refimpl/bvb_rsa.[ch])
+will not be visible to application code.
-- COMPATIBILITY NOTES
-The Brillo Boot Image structure (as defined in bvb_boot_image.h)
+The Brillo Boot Image structure (as defined in refimpl/bvb_boot_image.h)
guarantees forwards- and backwards-compatibility provided the major
version does not change.
diff --git a/bvb_boot_image_header.h b/refimpl/bvb_boot_image_header.h
index 8f90e5e..8f90e5e 100644
--- a/bvb_boot_image_header.h
+++ b/refimpl/bvb_boot_image_header.h
diff --git a/bvb_property.c b/refimpl/bvb_property.c
index 8b3ac3d..8b3ac3d 100644
--- a/bvb_property.c
+++ b/refimpl/bvb_property.c
diff --git a/bvb_property.h b/refimpl/bvb_property.h
index d105e3e..d105e3e 100644
--- a/bvb_property.h
+++ b/refimpl/bvb_property.h
diff --git a/bvb_refimpl.h b/refimpl/bvb_refimpl.h
index e65ad09..e65ad09 100644
--- a/bvb_refimpl.h
+++ b/refimpl/bvb_refimpl.h
diff --git a/bvb_rsa.c b/refimpl/bvb_rsa.c
index 50517b8..50517b8 100644
--- a/bvb_rsa.c
+++ b/refimpl/bvb_rsa.c
diff --git a/bvb_rsa.h b/refimpl/bvb_rsa.h
index 417ee35..417ee35 100644
--- a/bvb_rsa.h
+++ b/refimpl/bvb_rsa.h
diff --git a/bvb_sha.h b/refimpl/bvb_sha.h
index 8f8efd7..8f8efd7 100644
--- a/bvb_sha.h
+++ b/refimpl/bvb_sha.h
diff --git a/bvb_sha256.c b/refimpl/bvb_sha256.c
index 53e5f6b..53e5f6b 100644
--- a/bvb_sha256.c
+++ b/refimpl/bvb_sha256.c
diff --git a/bvb_sha512.c b/refimpl/bvb_sha512.c
index 0f1b385..0f1b385 100644
--- a/bvb_sha512.c
+++ b/refimpl/bvb_sha512.c
diff --git a/bvb_sysdeps.h b/refimpl/bvb_sysdeps.h
index a1f924e..a1f924e 100644
--- a/bvb_sysdeps.h
+++ b/refimpl/bvb_sysdeps.h
diff --git a/bvb_sysdeps_stub.c b/refimpl/bvb_sysdeps_stub.c
index c7cd076..c7cd076 100644
--- a/bvb_sysdeps_stub.c
+++ b/refimpl/bvb_sysdeps_stub.c
diff --git a/bvb_util.c b/refimpl/bvb_util.c
index fff8e96..fff8e96 100644
--- a/bvb_util.c
+++ b/refimpl/bvb_util.c
diff --git a/bvb_util.h b/refimpl/bvb_util.h
index 951ce83..951ce83 100644
--- a/bvb_util.h
+++ b/refimpl/bvb_util.h
diff --git a/bvb_verify.c b/refimpl/bvb_verify.c
index 45b675e..45b675e 100644
--- a/bvb_verify.c
+++ b/refimpl/bvb_verify.c
diff --git a/bvb_verify.h b/refimpl/bvb_verify.h
index 0cfd7ba..0cfd7ba 100644
--- a/bvb_verify.h
+++ b/refimpl/bvb_verify.h