Skip to content

Commit 15a164f

Browse files
committed
Fix --signature
1 parent fa51e66 commit 15a164f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

main.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ int main(int argc, char **argv) {
288288
printf("- Key file: %s\n", context.keyfile);
289289
}
290290
if (context.sigfile) {
291-
printf("- Signature file: %s\n", context.keyfile);
291+
printf("- Signature file: %s\n", context.sigfile);
292292
}
293293
}
294294

@@ -334,7 +334,7 @@ int main(int argc, char **argv) {
334334
uint8_t *signature = NULL;
335335
size_t siglen;
336336
if (context.sigfile) {
337-
FILE *sig = fopen(context.sigfile, NULL);
337+
FILE *sig = fopen(context.sigfile, "r");
338338
if (!sig) {
339339
fprintf(stderr, "Unable to open specified signature file.\n");
340340
exit(1);
@@ -347,6 +347,7 @@ int main(int argc, char **argv) {
347347
fprintf(stderr, "Unable to allocate signature. Is it too big?\n");
348348
exit(1);
349349
}
350+
fread(signature, 1, siglen, sig);
350351
fclose(sig);
351352
} else if (context.keyfile) {
352353
signature = sign_os(os_header, len, os_data, page_count * 0x4000, context.key, &siglen);

0 commit comments

Comments
 (0)