diff options
author | Louis Collard <louiscollard@chromium.org> | 2019-09-04 13:18:31 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-24 14:54:32 +0000 |
commit | 82064ca887f74b6f4a424dd9ec228c28478560a4 (patch) | |
tree | 325fb6d0ff7b2b5c5ec3f2719bee509caa93df32 /board/cr50/u2f.c | |
parent | 1e3f77703e9b7a929f5ac3ee7e23ebfd0998f738 (diff) | |
download | chrome-ec-82064ca887f74b6f4a424dd9ec228c28478560a4.tar.gz |
cr50: Remove concept of U2F mode
This was previously used to enable/disable U2F
or the extended mode. This was never used to
disable U2F, and the distinction between U2F and
extended mode is no longer required.
BRANCH=none
BUG=b:133275654
TEST=build, U2FTest,
enable g2f mode in u2fd, check attestation certification
does not change across multiple registrations
Change-Id: I323fa245bf23fb12ffed75fb8dcfc81913bafff7
Signed-off-by: Louis Collard <louiscollard@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1786886
Reviewed-by: Andrey Pronin <apronin@chromium.org>
Diffstat (limited to 'board/cr50/u2f.c')
-rw-r--r-- | board/cr50/u2f.c | 57 |
1 files changed, 1 insertions, 56 deletions
diff --git a/board/cr50/u2f.c b/board/cr50/u2f.c index 327c00378c..6d186ae2bd 100644 --- a/board/cr50/u2f.c +++ b/board/cr50/u2f.c @@ -54,22 +54,7 @@ enum touch_state pop_check_presence(int consume) return recent ? POP_TOUCH_YES : POP_TOUCH_NO; } -/* ---- non-volatile U2F parameters ---- */ - -/* - * Current mode defining the behavior of the U2F feature. - * Identical to the one defined on the host side by the enum U2fMode - * in the chrome_device_policy.proto protobuf. - */ -enum u2f_mode { - MODE_UNSET = 0, - /* Feature disabled */ - MODE_DISABLED = 1, - /* U2F as defined by the FIDO Alliance specification */ - MODE_U2F = 2, - /* U2F plus extensions for individual attestation certificate */ - MODE_U2F_EXTENDED = 3, -}; +/* ---- non-volatile U2F state ---- */ struct u2f_state { uint32_t salt[8]; @@ -77,7 +62,6 @@ struct u2f_state { uint32_t salt_kh[8]; }; -static uint8_t u2f_mode = MODE_UNSET; static const uint8_t k_salt = NVMEM_VAR_G2F_SALT; static const uint8_t k_salt_deprecated = NVMEM_VAR_U2F_SALT; @@ -165,45 +149,6 @@ static struct u2f_state *get_state(void) return state_loaded ? &state : NULL; } -static int use_u2f(void) -{ - /* - * TODO(b/62294740): Put board ID check here if needed - * if (!board_id_we_want) - * return 0; - */ - - if (u2f_mode == MODE_UNSET) { - if (get_state()) - /* Start without extension enabled, host will set it */ - u2f_mode = MODE_U2F; - } - - return u2f_mode >= MODE_U2F; -} - -int use_g2f(void) -{ - return use_u2f() && u2f_mode == MODE_U2F_EXTENDED; -} - -static enum vendor_cmd_rc set_u2f_mode(enum vendor_cmd_cc code, void *buf, - size_t input_size, size_t *response_size) -{ - uint8_t *mode = (uint8_t *)buf; - - if (input_size != 1) - return VENDOR_RC_BOGUS_ARGS; - - u2f_mode = *mode; - - *mode = use_u2f() ? u2f_mode : 0; - *response_size = 1; - - return VENDOR_RC_SUCCESS; -} -DECLARE_VENDOR_COMMAND(VENDOR_CC_U2F_MODE, set_u2f_mode); - /* ---- chip-specific U2F crypto ---- */ static int _derive_key(enum dcrypto_appid appid, const uint32_t input[8], |