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

Side by Side Diff: host/include/host_key.h

Issue 2745007: Major refactoring of structures, with unit tests. (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Implemented LoadFirmware2() 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 unified diff | Download patch
OLDNEW
(Empty)
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
4 *
5 * Host-side functions for verified boot.
6 */
7
8 #ifndef VBOOT_REFERENCE_HOST_KEY_H_
9 #define VBOOT_REFERENCE_HOST_KEY_H_
10
11 #include <stdint.h>
12
13 #include "cryptolib.h"
14 #include "utility.h"
15 #include "vboot_struct.h"
16
17
18 typedef struct rsa_st RSA;
19
20 /* Private key data */
21 typedef struct VbPrivateKey {
22 RSA* rsa_private_key; /* Private key data */
23 uint64_t algorithm; /* Algorithm to use when signing */
24 } VbPrivateKey;
25
26
27 /* Read a private key from a file. Caller owns the returned pointer,
28 * and must free it with PrivateKeyFree(). */
29 VbPrivateKey* PrivateKeyRead(const char* filename, uint64_t algorithm);
30
31
32 /* Free a private key. */
33 void PrivateKeyFree(VbPrivateKey* key);
34
35
36 /* Initialize a public key to refer to [key_data]. */
37 void PublicKeyInit(VbPublicKey* key, uint8_t* key_data, uint64_t key_size);
38
39
40 /* Allocate a new public key with space for a [key_size] byte key. */
41 VbPublicKey* PublicKeyAlloc(uint64_t key_size, uint64_t algorithm,
42 uint64_t version);
43
44
45 /* Copy a public key from [src] to [dest].
46 *
47 * Returns 0 if success, non-zero if error. */
48 int PublicKeyCopy(VbPublicKey* dest, const VbPublicKey* src);
49
50
51 /* Read a public key from a file. Caller owns the returned pointer,
52 * and must free it with Free().
53 *
54 * Returns NULL if error. */
55 /* TODO: should really store public keys in files as VbPublicKey */
56 VbPublicKey* PublicKeyRead(const char* filename, uint64_t algorithm,
57 uint64_t version);
58
59 #endif /* VBOOT_REFERENCE_HOST_KEY_H_ */
OLDNEW
« no previous file with comments | « host/include/host_common.h ('k') | host/include/host_signature.h » ('j') | host/lib/host_key.c » ('J')

Powered by Google App Engine
This is Rietveld 408576698