summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2021-12-16 13:09:06 -0600
committerCommit Bot <commit-bot@chromium.org>2021-12-17 00:19:33 +0000
commitffaa0ec9abfe736347200d0fe53d84743b3bdb86 (patch)
tree00f640b555f96b23e117fe14ac3e789e710b2497
parentcd0879ec4660a9b7f580e8242fd146de07eeb27f (diff)
downloadchrome-ec-stabilize-14411.B-cr50_stab.tar.gz
CRYPTO_TEST: modify the hash_command_handler print statementsstabilize-14411.B-cr50_stab
Modify the hash_command_handler print statements, so it's easy to tell the difference between firmware and hardware hash commands with the console output. BUG=b:210879337 TEST=make -j BOARD=cr50 CRYPTO_TEST=1 Change-Id: I0fca79c102cd284b564fe6ca8464c22c1629e2a0 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3345983 Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org>
-rw-r--r--board/cr50/tpm2/hash.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/board/cr50/tpm2/hash.c b/board/cr50/tpm2/hash.c
index 98b60e760b..6f1a6551a7 100644
--- a/board/cr50/tpm2/hash.c
+++ b/board/cr50/tpm2/hash.c
@@ -369,9 +369,11 @@ static void hash_command_handler(void *cmd_body,
return;
}
+ CPRINTF("%s:", __func__);
switch (hash_cmd) {
case CMD_HASH_START: /* Start a new hash context. */
process_start(alg, handle, cmd_body, response_size);
+ CPRINTF("%d start", __LINE__);
if (*response_size)
break; /* Something went wrong. */
process_continue(handle, cmd, text_len,
@@ -379,6 +381,7 @@ static void hash_command_handler(void *cmd_body,
break;
case CMD_HASH_CONTINUE:
+ CPRINTF("%d contd", __LINE__);
process_continue(handle, cmd, text_len,
cmd_body, response_size);
break;
@@ -386,12 +389,11 @@ static void hash_command_handler(void *cmd_body,
case CMD_HASH_FINISH:
process_continue(handle, cmd, text_len,
cmd_body, response_size);
+ CPRINTF("%d finish", __LINE__);
if (*response_size)
break; /* Something went wrong. */
process_finish(handle, cmd_body, response_size);
- CPRINTF("%s:%d response size %d\n", __func__, __LINE__,
- *response_size);
break;
case CMD_HASH: /* Process a buffer in a single shot. */
@@ -401,8 +403,7 @@ static void hash_command_handler(void *cmd_body,
*/
*response_size = _cpri__HashBlock(alg, text_len,
cmd, response_room, cmd_body);
- CPRINTF("%s:%d response size %d\n", __func__,
- __LINE__, *response_size);
+ CPRINTF("%d hash", __LINE__);
break;
case CMD_SW_HMAC: /* SW HMAC SHA-256 (key, value) in a single shot. */
/*
@@ -411,8 +412,7 @@ static void hash_command_handler(void *cmd_body,
*/
*response_size = do_software_hmac(alg, text_len, cmd,
response_room, cmd_body);
- CPRINTF("%s:%d hmac response size %d\n", __func__, __LINE__,
- *response_size);
+ CPRINTF("%d sw hmac", __LINE__);
break;
case CMD_HW_HMAC: /* HW HMAC SHA-256 (key, value) in a single shot */
/*
@@ -421,13 +421,13 @@ static void hash_command_handler(void *cmd_body,
*/
*response_size = do_dcrypto_hmac(alg, text_len, cmd,
response_room, cmd_body);
- CPRINTF("%s:%d hmac response size %d\n", __func__, __LINE__,
- *response_size);
+ CPRINTF("%d hw hmac", __LINE__);
break;
default:
break;
}
+ CPRINTF(" resp (%d)\n", *response_size);
}
DECLARE_EXTENSION_COMMAND(EXTENSION_HASH, hash_command_handler);