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

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

Issue 600093: Make verify_data return the correct error code. (Closed)
Patch Set: 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 | « no previous file | 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 05399b1881b4240047bd3f457c37be60ed80ceb7..8f8b76bc028ce015453272580ad3df8f07cda7c6 100644
--- a/src/platform/vboot_reference/utils/verify_data.c
+++ b/src/platform/vboot_reference/utils/verify_data.c
@@ -79,6 +79,7 @@ uint8_t* read_signature(char* input_file, int len) {
int main(int argc, char* argv[]) {
int i, algorithm, sig_len;
+ int return_code = 1; /* Default to error. */
uint8_t* digest = NULL;
uint8_t* signature = NULL;
RSAPublicKey* key = NULL;
@@ -107,15 +108,18 @@ int main(int argc, char* argv[]) {
goto failure;
if (!(digest = DigestFile(argv[4], algorithm)))
goto failure;
- if(RSA_verify(key, signature, sig_len, algorithm, digest))
+ if(RSA_verify(key, signature, sig_len, algorithm, digest)) {
+ return_code = 0;
fprintf(stderr, "Signature Verification SUCCEEDED.\n");
- else
+ }
+ else {
fprintf(stderr, "Signature Verification FAILED!\n");
+ }
failure:
free(key);
free(signature);
free(digest);
- return 0;
+ return return_code;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698