iot-safe: Fixed debug printf, updated slot number for 16-bit demo

This commit is contained in:
Daniele Lacamera
2021-12-07 11:40:41 +01:00
parent 23982e4fb3
commit 9e73c324a4
2 changed files with 9 additions and 5 deletions

View File

@ -40,7 +40,7 @@
#define CRT_SERVER_FILE_ID 0x3330
#define PRIVKEY_ID 0x3230 /* pre-provisioned */
#define ECDH_KEYPAIR_ID 0x3330
#define PEER_PUBKEY_ID 0x3530
#define PEER_PUBKEY_ID 0x3730
#define PEER_CERT_ID 0x3430
/* In this version of the demo, the server certificate is
@ -75,7 +75,9 @@
/* Debugging */
#define WOLFSSL_LOG_PRINTF
#if 1
/* Change to "if 1" to enable debug */
#if 0
#define DEBUG_WOLFSSL
#define WOLFSSL_DEBUG_TLS
#define DEBUG_IOTSAFE

View File

@ -140,8 +140,6 @@ static int expect_tok(const char *cmd, int size, const char *tok, char **repl)
#ifdef DEBUG_IOTSAFE
if (ret > 0)
printf("<<< %s\n", csim_read_buf);
else
printf("<<< csim_read returned %d\n", ret);
#endif
if (tok && (ret > 0) && !r_found) {
/* Mark the beginning of the match in the reply. */
@ -462,7 +460,9 @@ static int iotsafe_readfile(uint8_t *file_id, uint16_t file_id_sz,
return -1;
file_sz = (fs_msb << 8) + fs_lsb;
WOLFSSL_MSG("Stat successful on file");
#ifdef DEBUG_IOTSAFE
printf("File size: %d (%04x)", file_sz, file_sz);
#endif
}
if (file_sz > max_size) {
@ -1056,7 +1056,9 @@ static int wolfIoT_ecc_verify(WOLFSSL *ssl,
/* Store public key in IoT-safe slot */
ret = iotsafe_put_public_key(pubkey_slot, id_size, key);
if (ret < 0) {
#ifdef DEBUG_IOTSAFE
printf("IOTSAFE: put public key failed\n");
#endif
}
}
if (ret == 0) {