Skip to content

Commit c907f44

Browse files
authored
minor fixes: remove extra printfs and allow to compile with NO_AES (#260)
* ed25519: remove prints in the normal path * tests: allow to build with NO_AES
1 parent 86bea6c commit c907f44

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

src/wh_server_crypto.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,10 +1929,6 @@ static int _HandleEd25519Sign(whServerContext* ctx, uint16_t magic,
19291929
if (ret != 0) {
19301930
return ret;
19311931
}
1932-
WOLFHSM_CFG_PRINTF(
1933-
"[server] Ed25519Sign req: options=0x%08X key_id=0x%X msgSz=%u\n",
1934-
(unsigned int)req.options, (unsigned int)req.keyId,
1935-
(unsigned int)req.msgSz);
19361932

19371933
uint32_t available = inSize - sizeof(req);
19381934
if (req.msgSz > available) {
@@ -2029,10 +2025,6 @@ static int _HandleEd25519Verify(whServerContext* ctx, uint16_t magic,
20292025
if (ret != 0) {
20302026
return ret;
20312027
}
2032-
WOLFHSM_CFG_PRINTF("[server] Ed25519Verify req: options=0x%08X key_id=0x%X "
2033-
"sigSz=%u msgSz=%u\n",
2034-
(unsigned int)req.options, (unsigned int)req.keyId,
2035-
(unsigned int)req.sigSz, (unsigned int)req.msgSz);
20362028

20372029
uint32_t available = inSize - sizeof(req);
20382030
if (req.sigSz > available) {

test/wh_test_crypto.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2417,6 +2417,7 @@ static int whTest_KeyCache(whClientContext* ctx, int devId, WC_RNG* rng)
24172417
return ret;
24182418
}
24192419

2420+
#define WH_TEST_KEYSTORE_TEST_SZ (32)
24202421
static int whTest_NonExportableKeystore(whClientContext* ctx, int devId,
24212422
WC_RNG* rng)
24222423
{
@@ -2425,11 +2426,11 @@ static int whTest_NonExportableKeystore(whClientContext* ctx, int devId,
24252426

24262427
int ret = 0;
24272428
whKeyId keyId = WH_KEYID_ERASED;
2428-
uint8_t key[AES_256_KEY_SIZE] = {
2429+
uint8_t key[WH_TEST_KEYSTORE_TEST_SZ] = {
24292430
0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x11, 0x22, 0x33, 0x44, 0x55,
24302431
0x66, 0x77, 0x88, 0x99, 0x00, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF,
24312432
0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0x00};
2432-
uint8_t exportedKey[AES_256_KEY_SIZE] = {0};
2433+
uint8_t exportedKey[WH_TEST_KEYSTORE_TEST_SZ] = {0};
24332434
uint8_t label[WH_NVM_LABEL_LEN] = "NonExportableTestKey";
24342435
uint8_t exportedLabel[WH_NVM_LABEL_LEN] = {0};
24352436
uint16_t exportedKeySize;

0 commit comments

Comments
 (0)