mirror of https://github.com/wolfSSL/wolfBoot.git
Fix for C keygen tool RSA len variable and the ED25519 generated key. Added description to C sign defaults. Added template Cypress PSoC6 configuration file.
parent
28e29cb20b
commit
1adb2bcae0
|
@ -0,0 +1,30 @@
|
|||
ARCH?=ARM
|
||||
TARGET?=psoc6
|
||||
SIGN?=ED25519
|
||||
HASH?=SHA256
|
||||
CYPRESS_PDL?=./lib/psoc6pdl
|
||||
CYPRESS_TARGET_LIB?=./lib/TARGET_CY8CKIT-062S2-43012
|
||||
CYPRESS_CORE_LIB?=./lib/core-lib
|
||||
DEBUG?=1
|
||||
VTOR?=1
|
||||
CORTEX_M0?=1
|
||||
NO_ASM?=0
|
||||
EXT_FLASH?=0
|
||||
SPI_FLASH?=0
|
||||
NO_XIP?=0
|
||||
UART_FLASH?=0
|
||||
ALLOW_DOWNGRADE?=0
|
||||
NVM_FLASH_WRITEONCE?=1
|
||||
WOLFBOOT_VERSION?=0
|
||||
V?=0
|
||||
SPMATH?=1
|
||||
RAM_CODE?=0
|
||||
DUALBANK_SWAP?=0
|
||||
IMAGE_HEADER_SIZE?=256
|
||||
PKA?=1
|
||||
WOLFTPM?=0
|
||||
WOLFBOOT_PARTITION_SIZE?=0x80000
|
||||
WOLFBOOT_SECTOR_SIZE?=4096
|
||||
WOLFBOOT_PARTITION_BOOT_ADDRESS?=0x10080000
|
||||
WOLFBOOT_PARTITION_UPDATE_ADDRESS?=0x10100000
|
||||
WOLFBOOT_PARTITION_SWAP_ADDRESS?=10010000
|
|
@ -583,14 +583,16 @@ wolfBoot configures PLL1 to run at 100 MHz and is driving `CLK_FAST`, `CLK_PERI`
|
|||
The following configuration has been tested on the PSoC CY8CKIT-62S2-43012:
|
||||
|
||||
```
|
||||
make TARGET=psoc6
|
||||
NVM_FLASH_WRITEONCE=1
|
||||
CYPRESS_PDL=/home/dan/src/psoc6pdl
|
||||
CYPRESS_TARGET_LIB=/home/dan/src/TARGET_CY8CKIT-062S2-43012
|
||||
CYPRESS_CORE_LIB=/home/dan/src/core-lib
|
||||
make TARGET=psoc6 \
|
||||
NVM_FLASH_WRITEONCE=1 \
|
||||
CYPRESS_PDL=./lib/psoc6pdl \
|
||||
CYPRESS_TARGET_LIB=./lib/TARGET_CY8CKIT-062S2-43012 \
|
||||
CYPRESS_CORE_LIB=./lib/core-lib \
|
||||
WOLFBOOT_SECTOR_SIZE=4096
|
||||
```
|
||||
|
||||
Note: A reference `.config` can be found in `./config/examples/cypsoc6.config`.
|
||||
|
||||
#### OpenOCD installation
|
||||
|
||||
Compile and install the customized OpenOCD.
|
||||
|
|
|
@ -130,7 +130,6 @@ static void keygen_rsa(WC_RNG *rng, char *pubkeyfile, int size)
|
|||
exit(4);
|
||||
}
|
||||
fwrite(priv_der, privlen, 1, fpriv);
|
||||
fwrite(pub, 32, 1, fpriv);
|
||||
fclose(fpriv);
|
||||
|
||||
fpub = fopen(pubkeyfile, "w");
|
||||
|
@ -146,7 +145,7 @@ static void keygen_rsa(WC_RNG *rng, char *pubkeyfile, int size)
|
|||
|
||||
fwritekey(pub_der, publen, fpub);
|
||||
fprintf(fpub, "\n};\n");
|
||||
fprintf(fpub, "const uint32_t ecc256_pub_key_len = %d;\n", publen);
|
||||
fprintf(fpub, "const uint32_t rsa%d_pub_key_len = %d;\n", size, publen);
|
||||
fclose(fpub);
|
||||
}
|
||||
#endif
|
||||
|
@ -233,6 +232,7 @@ static void keygen_ed25519(WC_RNG *rng, char *pubkfile)
|
|||
exit(3);
|
||||
}
|
||||
fwrite(priv, 32, 1, fpriv);
|
||||
fwrite(pub, 32, 1, fpriv);
|
||||
fclose(fpriv);
|
||||
fpub = fopen(pubkfile, "w");
|
||||
if (fpub == NULL) {
|
||||
|
|
|
@ -126,8 +126,8 @@ int main(int argc, char** argv)
|
|||
const char* signature_file = NULL;
|
||||
char output_image_file[PATH_MAX];
|
||||
char* tmpstr;
|
||||
const char* sign_str = NULL;
|
||||
const char* hash_str = NULL;
|
||||
const char* sign_str = "AUTO";
|
||||
const char* hash_str = "SHA256";
|
||||
FILE *f, *f2;
|
||||
uint8_t* key_buffer = NULL;
|
||||
size_t key_buffer_sz = 0;
|
||||
|
|
Loading…
Reference in New Issue