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

Unified Diff: src/platform/vboot_reference/crypto/rsa.c

Issue 1585007: combined patch for: (Closed)
Patch Set: Created 10 years, 9 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 | « src/platform/vboot_reference/crypto/padding.c ('k') | src/platform/vboot_reference/crypto/rsa_utility.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/vboot_reference/crypto/rsa.c
diff --git a/src/platform/vboot_reference/crypto/rsa.c b/src/platform/vboot_reference/crypto/rsa.c
index c84ae4e8da8094d2080f7c43ff842fc9ae267fb3..bfc644690e615d64c2f068bb1bef123afd6f32c2 100644
--- a/src/platform/vboot_reference/crypto/rsa.c
+++ b/src/platform/vboot_reference/crypto/rsa.c
@@ -8,10 +8,7 @@
* support multiple RSA key lengths and hash digest algorithms.
*/
-#include <stdio.h>
-
-#include "padding.h"
-#include "rsa.h"
+#include "cryptolib.h"
#include "utility.h"
/* a[] -= mod */
@@ -138,17 +135,17 @@ int RSAVerify(const RSAPublicKey *key,
int success = 1;
if (sig_len != (key->len * sizeof(uint32_t))) {
- fprintf(stderr, "Signature is of incorrect length!\n");
+ debug("Signature is of incorrect length!\n");
return 0;
}
if (sig_type >= kNumAlgorithms) {
- fprintf(stderr, "Invalid signature type!\n");
+ debug("Invalid signature type!\n");
return 0;
}
if (key->len != siglen_map[sig_type] / sizeof(uint32_t)) {
- fprintf(stderr, "Wrong key passed in!\n");
+ debug("Wrong key passed in!\n");
return 0;
}
@@ -165,7 +162,7 @@ int RSAVerify(const RSAPublicKey *key,
if (buf[i] != padding[i]) {
#ifndef NDEBUG
/* TODO(gauravsh): Replace with a macro call for logging. */
- fprintf(stderr, "Padding: Expecting = %02x Got = %02x\n", padding[i],
+ debug("Padding: Expecting = %02x Got = %02x\n", padding[i],
buf[i]);
#endif
success = 0;
@@ -177,7 +174,7 @@ int RSAVerify(const RSAPublicKey *key,
if (buf[i] != *hash++) {
#ifndef NDEBUG
/* TODO(gauravsh): Replace with a macro call for logging. */
- fprintf(stderr, "Digest: Expecting = %02x Got = %02x\n", padding[i],
+ debug("Digest: Expecting = %02x Got = %02x\n", padding[i],
buf[i]);
#endif
success = 0;
« no previous file with comments | « src/platform/vboot_reference/crypto/padding.c ('k') | src/platform/vboot_reference/crypto/rsa_utility.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698