Add VBDEBUG macro for debug output.

Replaced in firmware/ lib; not replaced in host-side utils/tests.

Review URL: http://codereview.chromium.org/2810026
This commit is contained in:
Randall Spangler
2010-06-23 21:17:07 -07:00
parent 07f7865227
commit e2ec98412e
8 changed files with 102 additions and 95 deletions

View File

@@ -135,17 +135,17 @@ int RSAVerify(const RSAPublicKey *key,
int success = 1;
if (sig_len != (key->len * sizeof(uint32_t))) {
debug("Signature is of incorrect length!\n");
VBDEBUG(("Signature is of incorrect length!\n"));
return 0;
}
if (sig_type >= kNumAlgorithms) {
debug("Invalid signature type!\n");
VBDEBUG(("Invalid signature type!\n"));
return 0;
}
if (key->len != siglen_map[sig_type] / sizeof(uint32_t)) {
debug("Wrong key passed in!\n");
VBDEBUG(("Wrong key passed in!\n"));
return 0;
}
@@ -162,8 +162,7 @@ int RSAVerify(const RSAPublicKey *key,
if (buf[i] != padding[i]) {
#ifndef NDEBUG
/* TODO(gauravsh): Replace with a macro call for logging. */
debug("Padding: Expecting = %02x Got = %02x\n", padding[i],
buf[i]);
VBDEBUG(("Padding: Expecting = %02x Got = %02x\n", padding[i], buf[i]));
#endif
success = 0;
}
@@ -174,8 +173,7 @@ int RSAVerify(const RSAPublicKey *key,
if (buf[i] != *hash++) {
#ifndef NDEBUG
/* TODO(gauravsh): Replace with a macro call for logging. */
debug("Digest: Expecting = %02x Got = %02x\n", padding[i],
buf[i]);
VBDEBUG(("Digest: Expecting = %02x Got = %02x\n", padding[i], buf[i]));
#endif
success = 0;
}