Skip to content

Commit

Permalink
added more debug printfs in verbose mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bigbrett committed Nov 4, 2024
1 parent 122d76d commit affda77
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/wh_client_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1195,6 +1195,10 @@ int wh_Client_Curve25519ImportKey(whClientContext* ctx, curve25519_key* key,
if (inout_keyId != NULL) {
*inout_keyId = key_id;
}
#if defined(DEBUG_CRYPTOCB) && defined(DEBUG_CRYPTOCB_VERBOSE)
printf("[client] importKey: cached keyid=%u\n", key_id);
wh_Utils_Hexdump("[client] importKey: key=", buffer, buffer_len);
#endif
}
return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion src/wh_server_crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -1588,7 +1588,7 @@ static int _HandleSha256Dma(whServerContext* server, whPacket* packet,
if (ret == WH_ERROR_OK) {
#ifdef DEBUG_CRYPTOCB_VERBOSE
printf("[server] wc_Sha256Update: inAddr=%p, sz=%llu\n", inAddr,
req->input.sz);
(long long unsigned int)req->input.sz);
#endif
ret = wc_Sha256Update(sha256, inAddr, req->input.sz);
}
Expand Down
4 changes: 4 additions & 0 deletions src/wh_server_keystore.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,10 @@ int hsmCacheKey(whServerContext* server, whNvmMetadata* meta, uint8_t* in)
} else {
server->cache[foundIndex].commited = 1;
}
#if defined(DEBUG_CRYPTOCB) && defined(DEBUG_CRYPTOCB_VERBOSE)
printf("[server] cacheKey: caching keyid=%u\n", meta->id);
wh_Utils_Hexdump("[server] cacheKey: key=", in, meta->len);
#endif
}
} else {
/* try big key cache, don't put small keys into big cache if full */
Expand Down

0 comments on commit affda77

Please sign in to comment.