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" | |
19 #include "file_keys.h" | 18 #include "file_keys.h" |
| 19 #include "sha_utility.h" |
| 20 #include "padding.h" |
| 21 #include "rsa.h" |
| 22 #include "rsa_utility.h" |
20 #include "verify_data.h" | 23 #include "verify_data.h" |
21 | 24 |
22 /* ANSI Color coding sequences. */ | 25 /* ANSI Color coding sequences. */ |
23 #define COL_GREEN "\e[1;32m" | 26 #define COL_GREEN "\e[1;32m" |
24 #define COL_RED "\e[0;31m]" | 27 #define COL_RED "\e[0;31m]" |
25 #define COL_STOP "\e[m" | 28 #define COL_STOP "\e[m" |
26 | 29 |
27 uint8_t* read_signature(char* input_file, int len) { | 30 uint8_t* read_signature(char* input_file, int len) { |
28 int i, sigfd; | 31 int i, sigfd; |
29 uint8_t* signature = NULL; | 32 uint8_t* signature = NULL; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 } | 89 } |
87 else | 90 else |
88 return_code = -1; | 91 return_code = -1; |
89 | 92 |
90 free(key); | 93 free(key); |
91 free(signature); | 94 free(signature); |
92 free(digest); | 95 free(digest); |
93 | 96 |
94 return return_code; | 97 return return_code; |
95 } | 98 } |
OLD | NEW |