diff --git a/docs/Signing.md b/docs/Signing.md index fd04f032..cf358c0d 100644 --- a/docs/Signing.md +++ b/docs/Signing.md @@ -90,14 +90,14 @@ If none of the following is used, '--sha256' is assumed by default. If none of the following is used, "--id=1" is assumed by default. On systems with a single image to verify (e.g. microcontroller with a single active -partitions), ID=1 is the default identifier for the firmware image to stage. +partition), ID=1 is the default identifier for the firmware image to stage. ID=0 is reserved for wolfBoot 'self-update', and refers to the partition where the bootloader itself is stored. * `--id N` Set image partition id to "N". * `--wolfboot-update` Indicate that the image contains a signed self-update -package for the bootloader. Equivalent to `--id=0`. +package for the bootloader. Equivalent to `--id 0`. #### Encryption using a symmetric key diff --git a/tools/keytools/sign.c b/tools/keytools/sign.c index cd254d96..e48b8497 100755 --- a/tools/keytools/sign.c +++ b/tools/keytools/sign.c @@ -1157,12 +1157,6 @@ cleanup: return ret; } -static const char Hashes_str[] = "[--sha256 | --sha384 | --sha3]"; -static const char Enc_str[] = "[--chacha | --aes128 | --aes256]"; -static const char Sign_algo_str[] = "[--ed25519 | --ed447 | --ecc256 | --ecc384 | --ecc521 | --rsa2048 | --rsa2048enc | --rsa4096 | --rsa4096enc | --no-CMD.sign]"; - - - int main(int argc, char** argv) { int ret = 0; @@ -1185,18 +1179,9 @@ int main(int argc, char** argv) /* Check arguments and print usage */ if (argc < 4 || argc > 12) { - printf("Usage: %s %s %s [--wolfboot-update] [--encrypt enc_key.bin] %s" - " [--delta image_vX_signed.bin] " - "image key.der fw_version\n", - argv[0], Hashes_str, Sign_algo_str, Enc_str); - printf(" - or - \n"); - printf(" %s %s [--wolfboot-update] image pub_key.der fw_version\n", - argv[0], Hashes_str); - printf(" - or - \n"); - printf(" %s %s %s [--manual-CMD.sign] image pub_key.der" - "fw_version signature.sig\n", - argv[0], Hashes_str, Sign_algo_str); - return 0; + printf("Usage: %s [options] image key version\n", argv[0]); + printf("For full usage manual, see 'docs/Signing.md'\n"); + exit(1); } /* Parse Arguments */ diff --git a/tools/keytools/sign.py b/tools/keytools/sign.py index 874b99ef..8b712963 100755 --- a/tools/keytools/sign.py +++ b/tools/keytools/sign.py @@ -295,11 +295,8 @@ print("wolfcrypt-py version: " + wolfcrypt.__version__) if (argc < 4) or (argc > 12): - print("Usage: %s [--ed25519 | --ed448 | --ecc256 | --rsa2048 | --rsa4096 | --no-sign] [--sha256 | --sha384 | --sha3] [--wolfboot-update] [--encrypt key.bin] [--delta base_file.bin] image key.der fw_version\n" % sys.argv[0]) - print(" - or - ") - print(" %s [--sha256 | --sha384 | --sha3] [--sha-only] [--wolfboot-update] [--encrypt key.bin] [--delta base_file.bin] image pub_key.der fw_version\n" % sys.argv[0]) - print(" - or - ") - print(" %s [--ed25519 | --ed448 | --ecc256 | --rsa2048 | --rsa4096 ] [--sha256 | --sha384 | --sha3] [--manual-sign] [--chacha | --aes128 | --aes256 ] [--encrypt key.bin] [--delta base_file.bin] image pub_key.der fw_version signature.sig\n" % sys.argv[0]) + print("Usage: "+argv[0]+" [options] image key version"); + print("For full usage manual, see 'docs/Signing.md'"); sys.exit(1) i = 1