From 1dae3a82e2e709d0ff37687caba70b6154940636 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Thu, 13 Jun 2013 02:27:30 +0200 Subject: sbtools: fix encryption and cosmetics Change-Id: Id302f236ad3ec13a5166de4e22a3fc85b2a6c64f --- utils/imxtools/sbtools/elftosb1.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'utils/imxtools/sbtools/elftosb1.c') 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) CMD_FN(cmd_keyfile) { - (void) sb; if(!add_keys_from_file(args[0].str)) bug("Cannot add keys from file '%s'\n", args[0].str); + for(int i = 0; i < g_nr_keys; i++) + if(g_key_array[i].method == CRYPTO_XOR_KEY) + { + memcpy(&sb->key, &g_key_array[i], sizeof(sb->key)); + break; + } return 0; } @@ -501,6 +506,7 @@ struct cmd_entry_t g_cmds[] = CMD("-N", cmd_clear_strict, 0) CMD("-nonstrict", cmd_clear_strict, 0) CMD("-call", cmd_call, 1, ARG_UINT) + CMD("-jump", cmd_jump, 1, ARG_UINT) CMD("-jumparg", cmd_jumparg, 1, ARG_UINT) CMD("-f", cmd_load, 1, ARG_STR) CMD("-load", cmd_load, 1, ARG_STR) @@ -515,7 +521,6 @@ struct cmd_entry_t g_cmds[] = CMD("-v", cmd_component, 1, ARG_STR) CMD("-component", cmd_component, 1, ARG_STR) CMD("-k", cmd_keyfile, 1, ARG_STR) - CMD("-jump", cmd_jump, 1, ARG_UINT) }; #undef CMD @@ -579,8 +584,8 @@ static void usage(void) printf(" -C/-noncritical\t\tClear critical flag\n"); printf(" -n/-strict\t\t\tSet strict flag\n"); printf(" -N/-nonstrict\t\t\tClear strict flag\n"); - printf(" -call \t\tCall an address\n"); - printf(" -jump \t\tJump to an address\n"); + printf(" -call \t\t\tCall code at a specified address\n"); + printf(" -jump \t\t\tJump to code at a specified address\n"); exit(1); } -- cgit v1.2.3