aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Zongker2013-04-10 13:32:17 -0500
committerKenny Root2013-09-25 12:11:46 -0500
commit30362a6ad132cbafde82cc57293e00679d4f86c2 (patch)
tree47f9585d4cd72de8a3fb935d8e8387763ce3a9b1 /verifier.h
parent5c4e1dac0bd8f31559bd50eec4343b7a17b7a976 (diff)
downloadplatform-bootable-recovery-30362a6ad132cbafde82cc57293e00679d4f86c2.tar.gz
platform-bootable-recovery-30362a6ad132cbafde82cc57293e00679d4f86c2.tar.xz
platform-bootable-recovery-30362a6ad132cbafde82cc57293e00679d4f86c2.zip
verifier: update to support certificates using SHA-256
(cherry picked from commit bac7fba02763ae5e78e8e4ba0bea727330ad953e) Change-Id: I01c38d7fea088622a8b0bbf2c833fa2d969417af
Diffstat (limited to 'verifier.h')
-rw-r--r--verifier.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/verifier.h b/verifier.h
index e9ef3b72..6ce1b44d 100644
--- a/verifier.h
+++ b/verifier.h
@@ -19,12 +19,17 @@
19 19
20#include "mincrypt/rsa.h" 20#include "mincrypt/rsa.h"
21 21
22typedef struct Certificate {
23 int hash_len; // SHA_DIGEST_SIZE (SHA-1) or SHA256_DIGEST_SIZE (SHA-256)
24 RSAPublicKey* public_key;
25} Certificate;
26
22/* Look in the file for a signature footer, and verify that it 27/* Look in the file for a signature footer, and verify that it
23 * matches one of the given keys. Return one of the constants below. 28 * matches one of the given keys. Return one of the constants below.
24 */ 29 */
25int verify_file(const char* path, const RSAPublicKey *pKeys, unsigned int numKeys); 30int verify_file(const char* path, const Certificate *pKeys, unsigned int numKeys);
26 31
27RSAPublicKey* load_keys(const char* filename, int* numKeys); 32Certificate* load_keys(const char* filename, int* numKeys);
28 33
29#define VERIFY_SUCCESS 0 34#define VERIFY_SUCCESS 0
30#define VERIFY_FAILURE 1 35#define VERIFY_FAILURE 1