Skip to content

Commit ca85bdc

Browse files
committed
review feedback
1 parent 7e8b7e5 commit ca85bdc

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

hal/aurix_tc3xx.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,8 @@ static int _connectCb(void* context, whCommConnected connect)
592592

593593
int hal_hsm_init_connect(void)
594594
{
595-
int rc = 0;
595+
int rc = 0;
596+
size_t i;
596597

597598
/* init shared memory buffers */
598599
uint32_t* req = (uint32_t*)hsmShmCore0CommBuf;
@@ -625,7 +626,7 @@ int hal_hsm_init_connect(void)
625626
}
626627

627628
/* init shared memory buffers */
628-
for (size_t i=0; i<HSM_SHM_CORE0_COMM_BUF_WORDS; i++) {
629+
for (i = 0; i < HSM_SHM_CORE0_COMM_BUF_WORDS; i++) {
629630
hsmShmCore0CommBuf[i] = 0;
630631
}
631632

src/image.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ static void wolfBoot_verify_signature_ecc(uint8_t key_slot,
235235
size_t tmpSigSz = sizeof(tmpSigBuf);
236236

237237
#if defined(WOLFBOOT_USE_WOLFHSM_PUBKEY_ID)
238+
(void)key_slot;
239+
238240
/* hardcoded, since not using keystore */
239241
const int point_sz = ECC_IMAGE_SIGNATURE_SIZE / 2;
240242

@@ -396,6 +398,7 @@ static void wolfBoot_verify_signature_rsa(uint8_t key_slot,
396398
return;
397399
}
398400
#if defined(WOLFBOOT_USE_WOLFHSM_PUBKEY_ID)
401+
(void)key_slot;
399402
/* public key is stored on server at hsmClientKeyIdPubKey*/
400403
ret = wh_Client_RsaSetKeyId(&rsa, hsmClientKeyIdPubKey);
401404
if (ret != 0) {

tools/keytools/keygen.c

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -358,22 +358,27 @@ static int generated_keypairs_type[MAX_KEYPAIRS];
358358
static uint32_t generated_keypairs_id_mask[MAX_KEYPAIRS];
359359
static int n_generated = 0;
360360

361-
static char *append_pub_to_fname(const char *filename) {
362-
const char pubSuffix[] = "_pub";
361+
static char* append_pub_to_fname(const char* filename)
362+
{
363+
const char pubSuffix[] = "_pub";
363364
const size_t pubSuffixLength = strlen(pubSuffix);
365+
const char* dotPosition;
366+
size_t prefixLength;
367+
char* newFilename;
368+
size_t newFilenameLength;
364369

365-
const char *dotPosition = strchr(filename, '.');
366-
367-
size_t prefixLength;
370+
dotPosition = strchr(filename, '.');
368371
if (dotPosition != NULL) {
369372
prefixLength = dotPosition - filename;
370-
} else {
373+
}
374+
else {
371375
prefixLength = strlen(filename);
372376
}
373377

374-
size_t newFilenameLength = prefixLength + pubSuffixLength + (dotPosition ? strlen(dotPosition) : 0) + 1;
378+
newFilenameLength = prefixLength + pubSuffixLength +
379+
(dotPosition ? strlen(dotPosition) : 0) + 1;
375380

376-
char *newFilename = (char *)malloc(newFilenameLength);
381+
newFilename = (char*)malloc(newFilenameLength);
377382
if (newFilename == NULL) {
378383
return NULL;
379384
}
@@ -387,8 +392,10 @@ static char *append_pub_to_fname(const char *filename) {
387392
/* Append the rest of the original filename if a period was found */
388393
if (dotPosition != NULL) {
389394
strcpy(newFilename + prefixLength + pubSuffixLength, dotPosition);
390-
} else {
391-
newFilename[prefixLength + pubSuffixLength] = '\0'; /* Null-terminate the string if no period */
395+
}
396+
else {
397+
/* Null-terminate the string if no period */
398+
newFilename[prefixLength + pubSuffixLength] = '\0';
392399
}
393400

394401
return newFilename;

0 commit comments

Comments
 (0)