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

Side by Side Diff: src/platform/vboot_reference/utils/file_keys.c

Issue 660310: Fix a typo in the RSA benchmark. (Closed)
Patch Set: Follow output convention. 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 unified diff | Download patch
« no previous file with comments | « src/platform/vboot_reference/tests/rsa_verify_benchmark.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 /* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be 2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file. 3 * found in the LICENSE file.
4 * 4 *
5 * Utility functions for file and key handling. 5 * Utility functions for file and key handling.
6 */ 6 */
7 7
8 #include "file_keys.h" 8 #include "file_keys.h"
9 9
10 #include <fcntl.h> 10 #include <fcntl.h>
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 fprintf(stderr, "Couldn't read key into a buffer.\n"); 44 fprintf(stderr, "Couldn't read key into a buffer.\n");
45 return NULL; 45 return NULL;
46 } 46 }
47 47
48 close(fd); 48 close(fd);
49 return buf; 49 return buf;
50 } 50 }
51 51
52 RSAPublicKey* RSAPublicKeyFromFile(const char* input_file) { 52 RSAPublicKey* RSAPublicKeyFromFile(const char* input_file) {
53 uint32_t len; 53 uint32_t len;
54 RSAPublicKey* key; 54 RSAPublicKey* key = NULL;
55 uint8_t* buf = BufferFromFile(input_file, &len); 55 uint8_t* buf = BufferFromFile(input_file, &len);
56 if (buf) 56 if (buf)
57 key = RSAPublicKeyFromBuf(buf, len); 57 key = RSAPublicKeyFromBuf(buf, len);
58 Free(buf); 58 Free(buf);
59 return key; 59 return key;
60 } 60 }
61 61
62 uint8_t* SignatureFile(const char* input_file, const char* key_file, 62 uint8_t* SignatureFile(const char* input_file, const char* key_file,
63 int algorithm) { 63 int algorithm) {
64 char* sign_utility = "./sign_data.sh"; 64 char* sign_utility = "./sign_data.sh";
(...skipping 25 matching lines...) Expand all
90 if (fread(signature, signature_size, 1, cmd_out) != 1) { 90 if (fread(signature, signature_size, 1, cmd_out) != 1) {
91 fprintf(stderr, "Couldn't read signature.\n"); 91 fprintf(stderr, "Couldn't read signature.\n");
92 pclose(cmd_out); 92 pclose(cmd_out);
93 Free(signature); 93 Free(signature);
94 return NULL; 94 return NULL;
95 } 95 }
96 96
97 pclose(cmd_out); 97 pclose(cmd_out);
98 return signature; 98 return signature;
99 } 99 }
OLDNEW
« no previous file with comments | « src/platform/vboot_reference/tests/rsa_verify_benchmark.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698