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

Unified Diff: host/lib/signature_digest.c

Issue 2871033: Switch to using .vbprivk for signing everything now. (Closed) Base URL: ssh://git@chromiumos-git//vboot_reference.git
Patch Set: Okay, now tests pass again. 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
Index: host/lib/signature_digest.c
diff --git a/host/lib/signature_digest.c b/host/lib/signature_digest.c
index 4dba95a66afe354cee073b633642abaca1b3525c..eaa60690251b98b7ff99ea2944262f21ec259e18 100644
--- a/host/lib/signature_digest.c
+++ b/host/lib/signature_digest.c
@@ -31,7 +31,7 @@ uint8_t* SignatureDigest(const uint8_t* buf, uint64_t len, int algorithm) {
uint8_t* digest = NULL;
if (algorithm >= kNumAlgorithms) {
- debug("SignatureDigest() called with invalid algorithm!\n");
+ VBDEBUG(("SignatureDigest() called with invalid algorithm!\n"));
} else if ((digest = DigestBuf(buf, len, algorithm))) {
info_digest = PrependDigestInfo(algorithm, digest);
}
@@ -49,22 +49,22 @@ uint8_t* SignatureBuf(const uint8_t* buf, uint64_t len, const char* key_file,
digestinfo_size_map[algorithm]);
key_fp = fopen(key_file, "r");
if (!key_fp) {
- debug("SignatureBuf(): Couldn't open key file: %s\n", key_file);
+ VBDEBUG(("SignatureBuf(): Couldn't open key file: %s\n", key_file));
Free(signature_digest);
return NULL;
}
if ((key = PEM_read_RSAPrivateKey(key_fp, NULL, NULL, NULL)))
signature = (uint8_t*) Malloc(siglen_map[algorithm]);
else
- debug("SignatureBuf(): Couldn't read private key from file: %s\n",
- key_file);
+ VBDEBUG(("SignatureBuf(): Couldn't read private key from file: %s\n",
+ key_file));
if (signature) {
if (-1 == RSA_private_encrypt(signature_digest_len, /* Input length. */
signature_digest, /* Input data. */
signature, /* Output signature. */
key, /* Key to use. */
RSA_PKCS1_PADDING)) /* Padding to use. */
- debug("SignatureBuf(): RSA_private_encrypt() failed.\n");
+ VBDEBUG(("SignatureBuf(): RSA_private_encrypt() failed.\n"));
}
fclose(key_fp);
if (key)
« no previous file with comments | « host/lib/host_signature.c ('k') | tests/big_firmware_tests.c » ('j') | utility/vbutil_key.c » ('J')

Powered by Google App Engine
This is Rietveld 408576698