summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2015-11-05 17:54:00 -0800
committerchrome-bot <chrome-bot@chromium.org>2015-11-10 06:54:42 -0800
commitcb3e9777748251aab15fbceff80d0eaea18416b0 (patch)
tree7f6d79b48dc742bf671e9dbc24ed36c3b65590eb
parentee86a8ce1f343186bcc545cd68d7ad54ec7f3ea6 (diff)
downloadchrome-ec-cb3e9777748251aab15fbceff80d0eaea18416b0.tar.gz
cr50: util: signer: make signer header definition usable on the target
The signer running on the build host and the loader running on the target must be in sync as of the structure of the signature header. To be able to use the same definition in both programs, remove the system includes from the .h file which needs to be shared. Rearrange includes in image.cc to follow the coding conventions. BRANCH=none BUG=chrome-os-partner:43025 TEST=with the rest of the patches applied the code successfully boots, which indicates that the signer is in fact working properly. (See the top patch for testing details). Change-Id: I6bc9c57ebea55ac256fcdac8338c5566f16b6371 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/311420 Reviewed-by: Nagendra Modadugu <ngm@google.com>
-rw-r--r--util/signer/common/signed_header.h4
-rw-r--r--util/signer/image.cc32
2 files changed, 17 insertions, 19 deletions
diff --git a/util/signer/common/signed_header.h b/util/signer/common/signed_header.h
index 98cc2c09a6..82a6a7cbda 100644
--- a/util/signer/common/signed_header.h
+++ b/util/signer/common/signed_header.h
@@ -5,10 +5,6 @@
#ifndef __EC_UTIL_SIGNER_COMMON_SIGNED_HEADER_H
#define __EC_UTIL_SIGNER_COMMON_SIGNED_HEADER_H
-#include <assert.h>
-#include <string.h>
-#include <inttypes.h>
-
#define FUSE_PADDING 0x55555555 // baked in hw!
#define FUSE_IGNORE 0xa3badaac // baked in rom!
#define FUSE_MAX 128 // baked in rom!
diff --git a/util/signer/image.cc b/util/signer/image.cc
index b0657b8892..ac84957492 100644
--- a/util/signer/image.cc
+++ b/util/signer/image.cc
@@ -2,31 +2,33 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
-#include <common/image.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
+// global C++ includes
+#include <string>
-#include <libelf.h>
+// global C includes
+#include <assert.h>
+#include <fcntl.h>
#include <gelf.h>
-
-#include <common/publickey.h>
-
+#include <libelf.h>
#include <openssl/bn.h>
#include <openssl/evp.h>
-#include <openssl/rsa.h>
#include <openssl/pem.h>
#include <openssl/rand.h>
+#include <openssl/rsa.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+// local includes
+#include <common/publickey.h>
+#include <common/image.h>
#include <common/signed_header.h>
-#include <string>
using namespace std;