summaryrefslogtreecommitdiff
path: root/host/lib/include/host_key.h
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2016-06-17 10:48:16 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-08-03 19:40:41 -0700
commit814aaf09ceecddb16a01e1cbe0df4299b83b5699 (patch)
tree2d8cdeed4ee062c83dd6e84a341ff53cf343fd1c /host/lib/include/host_key.h
parent31f04ada58bc67680ec9d62a404365803c76ffc1 (diff)
downloadvboot-814aaf09ceecddb16a01e1cbe0df4299b83b5699.tar.gz
futility: Create signatures using vboot 2.0 APIsstabilize-8688.B
Refactor futility to use only vboot 2.0 APIs to create signatures. BUG=chromium:611535 BRANCH=none TEST=make runtests Change-Id: I176e7f424fa556d34d8fe691df5681f1e43210ce Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/356128 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'host/lib/include/host_key.h')
-rw-r--r--host/lib/include/host_key.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/host/lib/include/host_key.h b/host/lib/include/host_key.h
index cdfc81bd..25b7f767 100644
--- a/host/lib/include/host_key.h
+++ b/host/lib/include/host_key.h
@@ -8,10 +8,12 @@
#ifndef VBOOT_REFERENCE_HOST_KEY_H_
#define VBOOT_REFERENCE_HOST_KEY_H_
+#include "2crypto.h"
#include "cryptolib.h"
#include "vboot_struct.h"
struct vb2_packed_key;
+struct vb2_private_key;
typedef struct rsa_st RSA;
@@ -23,9 +25,11 @@ typedef struct VbPrivateKey {
/* Read a private key from a .pem file. Caller owns the returned pointer,
- * and must free it with PrivateKeyFree(). */
+ * and must free() it. */
VbPrivateKey* PrivateKeyReadPem(const char* filename, uint64_t algorithm);
-
+struct vb2_private_key *vb2_read_private_key_pem(
+ const char *filename,
+ enum vb2_crypto_algorithm algorithm);
/* Free a private key. */
void PrivateKeyFree(VbPrivateKey* key);
@@ -33,13 +37,12 @@ void PrivateKeyFree(VbPrivateKey* key);
/* Write a private key to a file in .vbprivk format. */
int PrivateKeyWrite(const char* filename, const VbPrivateKey* key);
-/* Read a privake key from a .vbprivk file. Caller owns the returned
- * pointer, and must free it with PrivateKeyFree().
+/* Read a private key from a .vbprivk file. Caller owns the returned
+ * pointer, and must free() it.
*
* Returns NULL if error. */
VbPrivateKey* PrivateKeyRead(const char* filename);
-
-
+struct vb2_private_key *vb2_read_private_key(const char *filename);
/* Allocate a new public key with space for a [key_size] byte key. */
VbPublicKey* PublicKeyAlloc(uint64_t key_size, uint64_t algorithm,