mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-26 19:25:02 +00:00
futility: cmd_show uses only vboot 2.0 APIs
This removes the remaining vboot 1.0 API calls from cmd_show. BUG=chromium:611535 BRANCH=none TEST=make runtests Change-Id: I03c4260aa034100efbbea1005367cd85dfff273d Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/350173 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
46b77fb2f0
commit
158b29672a
@@ -21,6 +21,7 @@
|
||||
#include "host_common.h"
|
||||
#include "util_misc.h"
|
||||
#include "vb2_common.h"
|
||||
#include "host_key2.h"
|
||||
#include "vboot_common.h"
|
||||
|
||||
const char *packed_key_sha1_string(const struct vb2_packed_key *key)
|
||||
@@ -29,10 +30,10 @@ const char *packed_key_sha1_string(const struct vb2_packed_key *key)
|
||||
uint32_t buflen = key->key_size;
|
||||
uint8_t digest[VB2_SHA1_DIGEST_SIZE];
|
||||
static char dest[VB2_SHA1_DIGEST_SIZE * 2 + 1];
|
||||
char *dnext = dest;
|
||||
|
||||
vb2_digest_buffer(buf, buflen, VB2_HASH_SHA1, digest, sizeof(digest));
|
||||
|
||||
char *dnext = dest;
|
||||
int i;
|
||||
for (i = 0; i < sizeof(digest); i++)
|
||||
dnext += sprintf(dnext, "%02x", digest[i]);
|
||||
@@ -40,24 +41,27 @@ const char *packed_key_sha1_string(const struct vb2_packed_key *key)
|
||||
return dest;
|
||||
}
|
||||
|
||||
void PrintPrivKeySha1Sum(VbPrivateKey *key)
|
||||
const char *private_key_sha1_string(const struct vb2_private_key *key)
|
||||
{
|
||||
uint8_t *buf;
|
||||
uint32_t buflen;
|
||||
uint8_t digest[VB2_SHA1_DIGEST_SIZE];
|
||||
int i;
|
||||
static char dest[VB2_SHA1_DIGEST_SIZE * 2 + 1];
|
||||
|
||||
if (vb_keyb_from_rsa(key->rsa_private_key, &buf, &buflen)) {
|
||||
printf("<error>");
|
||||
return;
|
||||
if (!key->rsa_private_key ||
|
||||
vb_keyb_from_rsa(key->rsa_private_key, &buf, &buflen)) {
|
||||
return "<error>";
|
||||
}
|
||||
|
||||
vb2_digest_buffer(buf, buflen, VB2_HASH_SHA1, digest, sizeof(digest));
|
||||
|
||||
char *dnext = dest;
|
||||
int i;
|
||||
for (i = 0; i < sizeof(digest); i++)
|
||||
printf("%02x", digest[i]);
|
||||
dnext += sprintf(dnext, "%02x", digest[i]);
|
||||
|
||||
free(buf);
|
||||
return dest;
|
||||
}
|
||||
|
||||
int vb_keyb_from_rsa(struct rsa_st *rsa_private_key,
|
||||
|
||||
Reference in New Issue
Block a user