summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis Collard <louiscollard@chromium.org>2020-07-01 17:41:59 +0800
committerCommit Bot <commit-bot@chromium.org>2020-07-10 23:34:25 +0000
commit6863b3943c7eb72199374a2e0eb9fe5721ac2bd0 (patch)
treea0f95dfd2a02afaf8cc594003e65ca0198d9518d
parente908fcc943d0bfec701c8c510c13dfb5793ca404 (diff)
downloadchrome-ec-6863b3943c7eb72199374a2e0eb9fe5721ac2bd0.tar.gz
cr50: Remove dummy U2F_ADPU vendor command.
This was added to support u2fd on M77, and can be removed iff the version of cr50 this change is included in will not be expected to work with M77. BUG=b:158268336 TEST=build Signed-off-by: Louis Collard <louiscollard@chromium.org> Change-Id: I6bbbae44a86c1a70fef4c8e1da1c1116f9909aa8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2275504 Reviewed-by: Yicheng Li <yichengli@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Yicheng Li <yichengli@chromium.org> Tested-by: Yicheng Li <yichengli@chromium.org>
-rw-r--r--board/cr50/u2f.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/board/cr50/u2f.c b/board/cr50/u2f.c
index 3e6e0c3a69..7c6273823c 100644
--- a/board/cr50/u2f.c
+++ b/board/cr50/u2f.c
@@ -309,59 +309,3 @@ int u2f_gen_kek_seed(int commit)
return EC_SUCCESS;
}
-
-/*
- * We need to keep a dummy version of this function around, as u2fd on M77 will
- * call it and not start up or send commands unless it receives a success
- * response. cr50 has been updated to no longer require the commands being sent,
- * so we don't need to do anything other than return a valid success response.
- */
-static enum vendor_cmd_rc vc_u2f_apdu_dummy(enum vendor_cmd_cc code, void *body,
- size_t cmd_size,
- size_t *response_size)
-{
- uint8_t *cmd = body;
-
- if (cmd_size < 3)
- return VENDOR_RC_BOGUS_ARGS;
-
- /*
- * The incoming APDUs are in the following format:
- *
- * CLA INS P1 P2 Le
- * 00 <ins> ?? ?? ??
- */
-
- if (cmd[1] == 0xbf /* U2F_VENDOR_MODE */) {
- /*
- * The u2fd code that call this command expects confirmation
- * that the mode was correctly set in the return message.
- *
- * The incoming APDU is in the following format:
- *
- * CLA INS P1 P2 Le
- * 00 bf 01 <mode> 00
- */
- cmd[0] = cmd[3];
- } else if (cmd[1] == 0x03 /* U2F_VERSION */) {
- /*
- * The returned value for U2F_VERSION is not checked; return
- * a known string just to be safe.
- */
- cmd[0] = '2';
- } else {
- /* We're not expecting any other commands. */
- *response_size = 0;
- return VENDOR_RC_NO_SUCH_SUBCOMMAND;
- }
-
- /*
- * Return U2F_SW_NO_ERROR status.
- */
- cmd[1] = 0x90;
- cmd[2] = 0x00;
- *response_size = 3;
-
- return VENDOR_RC_SUCCESS;
-}
-DECLARE_VENDOR_COMMAND(VENDOR_CC_U2F_APDU, vc_u2f_apdu_dummy);