futility: add "sign" command to resign firmware images

The "sign" command can perform the same operation as the old
resign_firmwarefd.sh script, only about 20 times faster. The
test for that will use the new command instead.

BUG=chromium:224734
BRANCH=ToT
TEST=make runtests

Change-Id: Ie7f7a0ab6fc00d7e06cb263733bf6e7246fdb023
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/216227
Reviewed-by: Randall Spangler <rspangler@chromium.org>
diff --git a/futility/futility.h b/futility/futility.h
index 8c2b809..03b4cb5 100644
--- a/futility/futility.h
+++ b/futility/futility.h
@@ -71,4 +71,11 @@
 int futil_valid_gbb_header(GoogleBinaryBlockHeader *gbb, uint32_t len,
 			   uint32_t *maxlen);
 
+/* Copies a file or dies with an error message */
+void copy_file_or_die(const char *infile, const char *outfile);
+
+/* Wrapper for mmap/munmap. Returns 0 on success. Skips stupidly large files. */
+int map_it(int fd, int writeable, void **buf, uint32_t *len);
+int unmap_it(int fd, int writeable, void *buf, uint32_t len);
+
 #endif /* VBOOT_REFERENCE_FUTILITY_H_ */