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

Unified Diff: vboot_firmware/lib/vboot_common.c

Issue 2802002: Implemented pipelined hash calculation in LoadFirmware() (Closed) Base URL: ssh://gitrw.chromium.org/vboot_reference.git
Patch Set: Add comment 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « vboot_firmware/lib/include/vboot_common.h ('k') | vboot_firmware/lib/vboot_firmware.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vboot_firmware/lib/vboot_common.c
diff --git a/vboot_firmware/lib/vboot_common.c b/vboot_firmware/lib/vboot_common.c
index 3eac471ec9bea09756fed1f241b3749ae5178979..1256b676d3e67d12b08352ea1c82d5c488a43619 100644
--- a/vboot_firmware/lib/vboot_common.c
+++ b/vboot_firmware/lib/vboot_common.c
@@ -122,6 +122,22 @@ int VerifyData(const uint8_t* data, const VbSignature *sig,
}
+int VerifyDigest(const uint8_t* digest, const VbSignature *sig,
+ const RSAPublicKey* key) {
+
+ if (sig->sig_size != siglen_map[key->algorithm]) {
+ debug("Wrong signature size for algorithm.\n");
+ return 1;
+ }
+
+ if (!RSAVerifyBinaryWithDigest_f(NULL, key, digest,
+ GetSignatureDataC(sig), key->algorithm))
+ return 1;
+
+ return 0;
+}
+
+
int KeyBlockVerify(const VbKeyBlockHeader* block, uint64_t size,
const VbPublicKey *key) {
« no previous file with comments | « vboot_firmware/lib/include/vboot_common.h ('k') | vboot_firmware/lib/vboot_firmware.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698