mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-26 19:25:02 +00:00
cleanup: remove a couple of unused functions and files
scripts/sign_data.sh is just a wrapper to do this:
./signature_digest_utility $1 $3 \
| openssl rsautl -sign -pkcs -inkey $2
AFAICT, that script is only invoked by the SignatureFile()
function in host/lib/file_keys.c, which is not referenced by
anything. I think I can remove both of those things.
Also remove utility/gbb_utility.cc, which should have been done
long ago in commit 6f39615.
BUG=none
BRANCH=ToT
TEST=make runalltests
Also ran it on daisy_spring-paladin and link-tot-paladin.
Change-Id: I16de5022765806f11bf6144d7ffd8cc849578a68
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/216719
Reviewed-by: Mike Frysinger <vapier@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
a1d9fe6eec
commit
bc3f0b74f9
@@ -79,42 +79,3 @@ uint8_t* DigestFile(char* input_file, int sig_algorithm) {
|
||||
close(input_fd);
|
||||
return digest;
|
||||
}
|
||||
|
||||
uint8_t* SignatureFile(const char* input_file, const char* key_file,
|
||||
unsigned int algorithm) {
|
||||
char* sign_utility = "./sign_data.sh";
|
||||
char* cmd; /* Command line to invoke. */
|
||||
int cmd_len;
|
||||
FILE* cmd_out; /* File descriptor to command output. */
|
||||
uint8_t* signature = NULL;
|
||||
int signature_size = siglen_map[algorithm];
|
||||
|
||||
/* Build command line:
|
||||
* sign_data.sh <algorithm> <key file> <input file>
|
||||
*/
|
||||
cmd_len = (strlen(sign_utility) + 1 + /* +1 for space. */
|
||||
2 + 1 + /* For [algorithm]. */
|
||||
strlen(key_file) + 1 + /* +1 for space. */
|
||||
strlen(input_file) +
|
||||
1); /* For the trailing '\0'. */
|
||||
cmd = (char*) malloc(cmd_len);
|
||||
snprintf(cmd, cmd_len, "%s %u %s %s", sign_utility, algorithm, key_file,
|
||||
input_file);
|
||||
cmd_out = popen(cmd, "r");
|
||||
free(cmd);
|
||||
if (!cmd_out) {
|
||||
VBDEBUG(("Couldn't execute: %s\n", cmd));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
signature = (uint8_t*) malloc(signature_size);
|
||||
if (fread(signature, signature_size, 1, cmd_out) != 1) {
|
||||
VBDEBUG(("Couldn't read signature.\n"));
|
||||
pclose(cmd_out);
|
||||
free(signature);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pclose(cmd_out);
|
||||
return signature;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user