mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-15 20:37:33 +00:00
futility: add vbutil_key into the built-in features
BUG=chromium:224734 BRANCH=ToT TEST=make runtests Signed-off-by: Bill Richardson <wfrichar@chromium.org> Change-Id: I6757a9c7f70bbe8d1db9bb3f0521778fbbb9632e Reviewed-on: https://chromium-review.googlesource.com/207927 Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
3e3790d008
commit
b84b81dc26
6
Makefile
6
Makefile
@@ -488,7 +488,6 @@ UTIL_NAMES = ${UTIL_NAMES_STATIC} \
|
||||
utility/tpmc \
|
||||
utility/vbutil_firmware \
|
||||
utility/vbutil_kernel \
|
||||
utility/vbutil_key \
|
||||
utility/vbutil_keyblock \
|
||||
|
||||
ifeq (${MINIMAL},)
|
||||
@@ -535,7 +534,7 @@ FUTIL_BIN = ${BUILD}/futility/futility
|
||||
# But we still need both static (tiny) and dynamic (with openssl) versions.
|
||||
FUTIL_STATIC_BIN = ${FUTIL_BIN}_s
|
||||
|
||||
# These are the others it will replace.
|
||||
# These are the executables to be replaced with symlinks.
|
||||
FUTIL_OLD = bmpblk_font bmpblk_utility cgpt chromeos-tpm-recovery crossystem \
|
||||
dev_debug_vboot dev_make_keypair dev_sign_file dumpRSAPublicKey \
|
||||
dump_fmap dump_kernel_config eficompress efidecompress \
|
||||
@@ -552,6 +551,7 @@ FUTIL_STATIC_SRCS = \
|
||||
|
||||
FUTIL_SRCS = \
|
||||
$(FUTIL_STATIC_SRCS) \
|
||||
futility/cmd_vbutil_key.c \
|
||||
futility/cmd_hey.c
|
||||
|
||||
FUTIL_LDS = futility/futility.lds
|
||||
@@ -902,6 +902,7 @@ ${FUTIL_STATIC_BIN}: ${FUTIL_LDS} ${FUTIL_STATIC_OBJS} ${UTILLIB}
|
||||
@$(PRINTF) " LD $(subst ${BUILD}/,,$@)\n"
|
||||
${Q}${LD} -o $@ ${CFLAGS} ${LDFLAGS} -static $^ ${LDLIBS}
|
||||
|
||||
${FUTIL_BIN}: LDLIBS += ${CRYPTO_LIBS}
|
||||
${FUTIL_BIN}: ${FUTIL_LDS} ${FUTIL_OBJS} ${UTILLIB}
|
||||
@$(PRINTF) " LD $(subst ${BUILD}/,,$@)\n"
|
||||
${Q}${LD} -o $@ ${CFLAGS} ${LDFLAGS} $^ ${LDLIBS}
|
||||
@@ -996,7 +997,6 @@ ${BUILD}/utility/signature_digest_utility: LDLIBS += ${CRYPTO_LIBS}
|
||||
${BUILD}/utility/dev_sign_file: LDLIBS += ${CRYPTO_LIBS}
|
||||
${BUILD}/utility/vbutil_firmware: LDLIBS += ${CRYPTO_LIBS}
|
||||
${BUILD}/utility/vbutil_kernel: LDLIBS += ${CRYPTO_LIBS}
|
||||
${BUILD}/utility/vbutil_key: LDLIBS += ${CRYPTO_LIBS}
|
||||
${BUILD}/utility/vbutil_keyblock: LDLIBS += ${CRYPTO_LIBS}
|
||||
|
||||
${BUILD}/host/linktest/main: LDLIBS += ${CRYPTO_LIBS}
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "cryptolib.h"
|
||||
#include "futility.h"
|
||||
#include "host_common.h"
|
||||
#include "util_misc.h"
|
||||
#include "vboot_common.h"
|
||||
@@ -52,8 +53,10 @@ static int PrintHelp(char *progname) {
|
||||
" Required parameters:\n"
|
||||
" --key <infile> RSA key file (.keyb or .pem)\n"
|
||||
" --version <number> Key version number "
|
||||
"(required for .keyb, ignored for .pem)\n"
|
||||
" --algorithm <number> Signing algorithm to use with key:\n",
|
||||
"(required for .keyb,\n"
|
||||
" ignored for .pem)\n"
|
||||
" --algorithm <number> "
|
||||
"Signing algorithm to use with key:\n",
|
||||
progname);
|
||||
|
||||
for (i = 0; i < kNumAlgorithms; i++) {
|
||||
@@ -160,7 +163,7 @@ static int Unpack(const char *infile, const char *outfile) {
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
int do_vbutil_key(int argc, char* argv[]) {
|
||||
|
||||
char *infile = NULL;
|
||||
char *outfile = NULL;
|
||||
@@ -234,3 +237,6 @@ int main(int argc, char* argv[]) {
|
||||
return PrintHelp(progname);
|
||||
}
|
||||
}
|
||||
|
||||
DECLARE_FUTIL_COMMAND(vbutil_key, do_vbutil_key,
|
||||
"Wraps RSA keys with vboot headers");
|
||||
@@ -51,7 +51,7 @@ progs=0
|
||||
# TODO(crbug.com/224734): dev_debug_vboot isn't tested right now.
|
||||
PROGS=${*:-cgpt crossystem dev_sign_file dumpRSAPublicKey
|
||||
dump_kernel_config enable_dev_usb_boot gbb_utility
|
||||
tpm_init_temp_fix tpmc vbutil_firmware vbutil_kernel vbutil_key
|
||||
tpm_init_temp_fix tpmc vbutil_firmware vbutil_kernel
|
||||
vbutil_keyblock vbutil_what_keys}
|
||||
|
||||
# For now just compare results of invoking each program with no args.
|
||||
|
||||
Reference in New Issue
Block a user