summaryrefslogtreecommitdiff
path: root/futility/cmd_create.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2016-05-11 13:50:18 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-07-22 18:40:04 -0700
commit7c3ae42e045935728a63a6d592ecf6c5bdbd005a (patch)
treeb03c1bde6af714d2229b2362ad1d64b99c8f581d /futility/cmd_create.c
parentb3a625f8fef1768d78eab4cfaaea270cb3fbd0c3 (diff)
downloadvboot-7c3ae42e045935728a63a6d592ecf6c5bdbd005a.tar.gz
vboot: Convert vboot1 SHA calls to use vboot2
This change replaces all calls to the old vboot1 SHA library with their vboot2 equivalents. This is the first in a long series of changes to move the core vboot kernel verification into vb2, and the control/display loop out to depthcharge. BUG=chromium:611535 BRANCH=none TEST=make runtests; build samus firmware and boot it Change-Id: I31986eb766176c0e39a192c5ce15730471c3cf94 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/344342 Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'futility/cmd_create.c')
-rw-r--r--futility/cmd_create.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/futility/cmd_create.c b/futility/cmd_create.c
index 143ea9ae..70568f46 100644
--- a/futility/cmd_create.c
+++ b/futility/cmd_create.c
@@ -13,6 +13,7 @@
#include "2common.h"
#include "2id.h"
#include "2rsa.h"
+#include "2sha.h"
#include "util_misc.h"
#include "vb2_common.h"
#include "vb2_struct.h"
@@ -254,10 +255,8 @@ static int vb2_make_keypair()
/* Update the IDs */
if (!force_id) {
- uint8_t *digest = DigestBuf(keyb_data, keyb_size,
- SHA1_DIGEST_ALGORITHM);
- memcpy(&opt_id, digest, sizeof(opt_id));
- free(digest);
+ vb2_digest_buffer(keyb_data, keyb_size, VB2_HASH_SHA1,
+ opt_id.raw, sizeof(opt_id.raw));
}
memcpy((struct vb2_id *)pubkey->id, &opt_id, sizeof(opt_id));