diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2013-06-13 02:27:30 +0200 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2013-06-13 02:27:30 +0200 |
commit | 1dae3a82e2e709d0ff37687caba70b6154940636 (patch) | |
tree | 838db5f1e1d8e3f96ab01a075ae8f83e576d89dd /utils/imxtools/sbtools | |
parent | f9cb5de58020936812653c578c79c79a13bc626c (diff) | |
download | rockbox-1dae3a82e2e709d0ff37687caba70b6154940636.tar.gz rockbox-1dae3a82e2e709d0ff37687caba70b6154940636.zip |
sbtools: fix encryption and cosmetics
Change-Id: Id302f236ad3ec13a5166de4e22a3fc85b2a6c64f
Diffstat (limited to 'utils/imxtools/sbtools')
-rw-r--r-- | utils/imxtools/sbtools/elftosb1.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/utils/imxtools/sbtools/elftosb1.c b/utils/imxtools/sbtools/elftosb1.c index be8cec7a99..1f33058eca 100644 --- a/utils/imxtools/sbtools/elftosb1.c +++ b/utils/imxtools/sbtools/elftosb1.c | |||
@@ -473,9 +473,14 @@ CMD_FN(cmd_component) | |||
473 | 473 | ||
474 | CMD_FN(cmd_keyfile) | 474 | CMD_FN(cmd_keyfile) |
475 | { | 475 | { |
476 | (void) sb; | ||
477 | if(!add_keys_from_file(args[0].str)) | 476 | if(!add_keys_from_file(args[0].str)) |
478 | bug("Cannot add keys from file '%s'\n", args[0].str); | 477 | bug("Cannot add keys from file '%s'\n", args[0].str); |
478 | for(int i = 0; i < g_nr_keys; i++) | ||
479 | if(g_key_array[i].method == CRYPTO_XOR_KEY) | ||
480 | { | ||
481 | memcpy(&sb->key, &g_key_array[i], sizeof(sb->key)); | ||
482 | break; | ||
483 | } | ||
479 | return 0; | 484 | return 0; |
480 | } | 485 | } |
481 | 486 | ||
@@ -501,6 +506,7 @@ struct cmd_entry_t g_cmds[] = | |||
501 | CMD("-N", cmd_clear_strict, 0) | 506 | CMD("-N", cmd_clear_strict, 0) |
502 | CMD("-nonstrict", cmd_clear_strict, 0) | 507 | CMD("-nonstrict", cmd_clear_strict, 0) |
503 | CMD("-call", cmd_call, 1, ARG_UINT) | 508 | CMD("-call", cmd_call, 1, ARG_UINT) |
509 | CMD("-jump", cmd_jump, 1, ARG_UINT) | ||
504 | CMD("-jumparg", cmd_jumparg, 1, ARG_UINT) | 510 | CMD("-jumparg", cmd_jumparg, 1, ARG_UINT) |
505 | CMD("-f", cmd_load, 1, ARG_STR) | 511 | CMD("-f", cmd_load, 1, ARG_STR) |
506 | CMD("-load", cmd_load, 1, ARG_STR) | 512 | CMD("-load", cmd_load, 1, ARG_STR) |
@@ -515,7 +521,6 @@ struct cmd_entry_t g_cmds[] = | |||
515 | CMD("-v", cmd_component, 1, ARG_STR) | 521 | CMD("-v", cmd_component, 1, ARG_STR) |
516 | CMD("-component", cmd_component, 1, ARG_STR) | 522 | CMD("-component", cmd_component, 1, ARG_STR) |
517 | CMD("-k", cmd_keyfile, 1, ARG_STR) | 523 | CMD("-k", cmd_keyfile, 1, ARG_STR) |
518 | CMD("-jump", cmd_jump, 1, ARG_UINT) | ||
519 | }; | 524 | }; |
520 | #undef CMD | 525 | #undef CMD |
521 | 526 | ||
@@ -579,8 +584,8 @@ static void usage(void) | |||
579 | printf(" -C/-noncritical\t\tClear critical flag\n"); | 584 | printf(" -C/-noncritical\t\tClear critical flag\n"); |
580 | printf(" -n/-strict\t\t\tSet strict flag\n"); | 585 | printf(" -n/-strict\t\t\tSet strict flag\n"); |
581 | printf(" -N/-nonstrict\t\t\tClear strict flag\n"); | 586 | printf(" -N/-nonstrict\t\t\tClear strict flag\n"); |
582 | printf(" -call <addr>\t\tCall an address\n"); | 587 | printf(" -call <addr>\t\t\tCall code at a specified address\n"); |
583 | printf(" -jump <addr>\t\tJump to an address\n"); | 588 | printf(" -jump <addr>\t\t\tJump to code at a specified address\n"); |
584 | 589 | ||
585 | exit(1); | 590 | exit(1); |
586 | } | 591 | } |