Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Unified Diff: host/lib/host_common.c

Issue 2762009: Add vbutil_key (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Util to pack/unpack .vbpubk files Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « host/include/host_misc.h ('k') | host/lib/host_key.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: host/lib/host_common.c
diff --git a/host/lib/host_common.c b/host/lib/host_common.c
index 6c4c4387106706fd2bfb74e2fb7449f91ce57ef5..03efd2a41996bccd0b112e4c1845fc37a4fbb2ca 100644
--- a/host/lib/host_common.c
+++ b/host/lib/host_common.c
@@ -7,18 +7,6 @@
/* TODO: change all 'return 0', 'return 1' into meaningful return codes */
-#if 0
-#define OPENSSL_NO_SHA
-#include <openssl/engine.h>
-#include <openssl/pem.h>
-#include <openssl/rsa.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include "file_keys.h"
-#endif
-
#include "host_common.h"
#include "cryptolib.h"
@@ -141,6 +129,7 @@ VbKernelPreambleHeader* CreateKernelPreamble(
uint64_t bootloader_address,
uint64_t bootloader_size,
const VbSignature* body_signature,
+ uint64_t desired_size,
const VbPrivateKey* signing_key) {
VbKernelPreambleHeader* h;
@@ -151,6 +140,10 @@ VbKernelPreambleHeader* CreateKernelPreamble(
uint8_t* block_sig_dest;
VbSignature *sigtmp;
+ /* If the block size is smaller than the desired size, pad it */
+ if (block_size < desired_size)
+ block_size = desired_size;
+
/* Allocate key block */
h = (VbKernelPreambleHeader*)Malloc(block_size);
if (!h)
« no previous file with comments | « host/include/host_misc.h ('k') | host/lib/host_key.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698