blob: 09df8eefcf0b81af8ced71f84f2bddf381d7ab2b [file] [log] [blame]
/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*
* Miscellaneous functions for userspace vboot utilities.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "cryptolib.h"
#include "host_common.h"
#include "util_misc.h"
#include "vboot_common.h"
void PrintPubKeySha1Sum(VbPublicKey* key) {
uint8_t* buf = ((uint8_t *)key) + key->key_offset;
uint64_t buflen = key->key_size;
uint8_t* digest = DigestBuf(buf, buflen, SHA1_DIGEST_ALGORITHM);
int i;
for (i=0; i<SHA1_DIGEST_SIZE; i++)
printf("%02x", digest[i]);
free(digest);
}