Browse Source

Added constant for maximum key text length + "/"

PASS1-98_PASS1-114
coreylakey 4 years ago
parent
commit
f4923b85fd
  1. 6
      ports/stm32/boards/Passport/tools/cosign/cosign.c

6
ports/stm32/boards/Passport/tools/cosign/cosign.c

@ -24,6 +24,10 @@
#include "uECC.h"
#endif /* USE_CRYPTO */
// This is the maximum length of "-key" + "-user", "00", "01", "02", or "03"
// Also, + 1 for the folder "/"
#define KEY_NAME_MAX_LENGTH 15
static char *firmware;
static char *version;
static bool help;
@ -500,7 +504,7 @@ static void sign_firmware(
return;
}
output = (char *)calloc(1, strlen(path) + 1 + strlen(final_file) + 14);
output = (char *)calloc(1, strlen(path) + strlen(final_file) + KEY_NAME_MAX_LENGTH);
if (output == NULL)
{
printf("insufficient memory (output)\n");

Loading…
Cancel
Save