diff options
Diffstat (limited to 'utils/imxtools/sbtools/elftosb.c')
-rw-r--r-- | utils/imxtools/sbtools/elftosb.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/utils/imxtools/sbtools/elftosb.c b/utils/imxtools/sbtools/elftosb.c index 2a96aecad7..ebfa033fcb 100644 --- a/utils/imxtools/sbtools/elftosb.c +++ b/utils/imxtools/sbtools/elftosb.c | |||
@@ -324,13 +324,13 @@ static void usage(void) | |||
324 | { | 324 | { |
325 | printf("Usage: elftosb [options | file]...\n"); | 325 | printf("Usage: elftosb [options | file]...\n"); |
326 | printf("Options:\n"); | 326 | printf("Options:\n"); |
327 | printf(" -?/--help\tDisplay this message\n"); | 327 | printf(" -h/--help\tDisplay this message\n"); |
328 | printf(" -o <file>\tSet output file\n"); | 328 | printf(" -o <file>\tSet output file\n"); |
329 | printf(" -c <file>\tSet command file\n"); | 329 | printf(" -c <file>\tSet command file\n"); |
330 | printf(" -d/--debug\tEnable debug output\n"); | 330 | printf(" -d/--debug\tEnable debug output\n"); |
331 | printf(" -k <file>\tAdd key file\n"); | 331 | printf(" -k <file>\tAdd key file\n"); |
332 | printf(" -z\t\tAdd zero key\n"); | 332 | printf(" -z\t\tAdd zero key\n"); |
333 | printf(" --add-key <key>\tAdd single key (hex or usbotp)\n"); | 333 | printf(" --add-key <key>\tAdd single key\n"); |
334 | printf(" --real-key <key>\tOverride real key\n"); | 334 | printf(" --real-key <key>\tOverride real key\n"); |
335 | printf(" --crypto-iv <iv>\tOverride crypto IV\n"); | 335 | printf(" --crypto-iv <iv>\tOverride crypto IV\n"); |
336 | exit(1); | 336 | exit(1); |
@@ -342,14 +342,19 @@ int main(int argc, char **argv) | |||
342 | char *output_filename = NULL; | 342 | char *output_filename = NULL; |
343 | struct crypto_key_t real_key; | 343 | struct crypto_key_t real_key; |
344 | struct crypto_key_t crypto_iv; | 344 | struct crypto_key_t crypto_iv; |
345 | memset(&real_key, 0, sizeof(real_key)); | ||
346 | memset(&crypto_iv, 0, sizeof(crypto_iv)); | ||
345 | real_key.method = CRYPTO_NONE; | 347 | real_key.method = CRYPTO_NONE; |
346 | crypto_iv.method = CRYPTO_NONE; | 348 | crypto_iv.method = CRYPTO_NONE; |
347 | 349 | ||
350 | if(argc == 1) | ||
351 | usage(); | ||
352 | |||
348 | while(1) | 353 | while(1) |
349 | { | 354 | { |
350 | static struct option long_options[] = | 355 | static struct option long_options[] = |
351 | { | 356 | { |
352 | {"help", no_argument, 0, '?'}, | 357 | {"help", no_argument, 0, 'h'}, |
353 | {"debug", no_argument, 0, 'd'}, | 358 | {"debug", no_argument, 0, 'd'}, |
354 | {"add-key", required_argument, 0, 'a'}, | 359 | {"add-key", required_argument, 0, 'a'}, |
355 | {"real-key", required_argument, 0, 'r'}, | 360 | {"real-key", required_argument, 0, 'r'}, |
@@ -357,7 +362,7 @@ int main(int argc, char **argv) | |||
357 | {0, 0, 0, 0} | 362 | {0, 0, 0, 0} |
358 | }; | 363 | }; |
359 | 364 | ||
360 | int c = getopt_long(argc, argv, "?do:c:k:za:", long_options, NULL); | 365 | int c = getopt_long(argc, argv, "hdo:c:k:za:", long_options, NULL); |
361 | if(c == -1) | 366 | if(c == -1) |
362 | break; | 367 | break; |
363 | switch(c) | 368 | switch(c) |
@@ -365,7 +370,7 @@ int main(int argc, char **argv) | |||
365 | case 'd': | 370 | case 'd': |
366 | g_debug = true; | 371 | g_debug = true; |
367 | break; | 372 | break; |
368 | case '?': | 373 | case 'h': |
369 | usage(); | 374 | usage(); |
370 | break; | 375 | break; |
371 | case 'o': | 376 | case 'o': |