OLD | NEW |
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 | 5 |
6 /* Routines for verifying a file's signature. Useful in testing the core | 6 /* Routines for verifying a file's signature. Useful in testing the core |
7 * RSA verification implementation. | 7 * RSA verification implementation. |
8 */ | 8 */ |
9 | 9 |
10 #include <fcntl.h> | 10 #include <fcntl.h> |
11 #include <stdio.h> | 11 #include <stdio.h> |
12 #include <stdlib.h> | 12 #include <stdlib.h> |
13 #include <string.h> | 13 #include <string.h> |
14 #include <sys/stat.h> | 14 #include <sys/stat.h> |
15 #include <sys/types.h> | 15 #include <sys/types.h> |
16 #include <unistd.h> | 16 #include <unistd.h> |
17 | 17 |
| 18 #include "cryptolib.h" |
18 #include "file_keys.h" | 19 #include "file_keys.h" |
19 #include "sha_utility.h" | |
20 #include "padding.h" | |
21 #include "rsa.h" | |
22 #include "rsa_utility.h" | |
23 #include "verify_data.h" | 20 #include "verify_data.h" |
24 | 21 |
25 /* ANSI Color coding sequences. */ | 22 /* ANSI Color coding sequences. */ |
26 #define COL_GREEN "\e[1;32m" | 23 #define COL_GREEN "\e[1;32m" |
27 #define COL_RED "\e[0;31m]" | 24 #define COL_RED "\e[0;31m]" |
28 #define COL_STOP "\e[m" | 25 #define COL_STOP "\e[m" |
29 | 26 |
30 uint8_t* read_signature(char* input_file, int len) { | 27 uint8_t* read_signature(char* input_file, int len) { |
31 int i, sigfd; | 28 int i, sigfd; |
32 uint8_t* signature = NULL; | 29 uint8_t* signature = NULL; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 86 } |
90 else | 87 else |
91 return_code = -1; | 88 return_code = -1; |
92 | 89 |
93 free(key); | 90 free(key); |
94 free(signature); | 91 free(signature); |
95 free(digest); | 92 free(digest); |
96 | 93 |
97 return return_code; | 94 return return_code; |
98 } | 95 } |
OLD | NEW |