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

Unified Diff: src/platform/vboot_reference/utils/verify_data.c

Issue 650105: Vboot Reference: Add the "real" reference firmware verification function (VerifyFirmware). (Closed)
Patch Set: Review fixes. Created 10 years, 10 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/utils/signature_digest.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/vboot_reference/utils/verify_data.c
diff --git a/src/platform/vboot_reference/utils/verify_data.c b/src/platform/vboot_reference/utils/verify_data.c
index 5cb33f45e973513df2771f0702614c7d5423e24d..c58b6fb8358a57b08f53d99fa42a48ba6451f3c4 100644
--- a/src/platform/vboot_reference/utils/verify_data.c
+++ b/src/platform/vboot_reference/utils/verify_data.c
@@ -22,6 +22,11 @@
#include "rsa_utility.h"
#include "verify_data.h"
+/* ANSI Color coding sequences. */
+#define COL_GREEN "\e[1;32m"
+#define COL_RED "\e[0;31m]"
+#define COL_STOP "\e[m"
+
uint8_t* read_signature(char* input_file, int len) {
int i, sigfd;
uint8_t* signature = NULL;
@@ -46,7 +51,6 @@ uint8_t* read_signature(char* input_file, int len) {
return signature;
}
-
int main(int argc, char* argv[]) {
int i, algorithm, sig_len;
int return_code = 1; /* Default to error. */
@@ -80,10 +84,11 @@ int main(int argc, char* argv[]) {
goto failure;
if(RSA_verify(key, signature, sig_len, algorithm, digest)) {
return_code = 0;
- fprintf(stderr, "Signature Verification SUCCEEDED.\n");
- }
- else {
- fprintf(stderr, "Signature Verification FAILED!\n");
+ fprintf(stderr, "Signature Verification "
+ COL_GREEN "SUCCEEDED" COL_STOP "\n");
+ } else {
+ fprintf(stderr, "Signature Verification "
+ COL_RED "FAILED" COL_STOP "\n");
}
failure:
« no previous file with comments | « src/platform/vboot_reference/utils/signature_digest.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698