diff options
author | Louis Collard <louiscollard@chromium.org> | 2019-01-07 10:08:51 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-01-09 11:55:46 -0800 |
commit | 4b718f963d4263365ffffc3e0675a3487bc0b8af (patch) | |
tree | ec548197d85af0c61fb77b3530451de044f8af2e | |
parent | d95b1ab9e50b298d938d6bbcfe7e9ef6f68ce64a (diff) | |
download | chrome-ec-4b718f963d4263365ffffc3e0675a3487bc0b8af.tar.gz |
ec: Move some U2F constants from u2f_impl.h to u2f.h
These constants are extensions to the U2F protocol, and as such,
form part of the API. Moving them to u2f.h so they can be re-used
by U2F clients.
TEST=build
BUG=b:112603199
BRANCH=none
Change-Id: I1cad417bfbd109c253876cbb762f5119ff39da06
Signed-off-by: Louis Collard <louiscollard@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1397099
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
-rw-r--r-- | include/u2f.h | 14 | ||||
-rw-r--r-- | include/u2f_impl.h | 11 |
2 files changed, 14 insertions, 11 deletions
diff --git a/include/u2f.h b/include/u2f.h index cf7d92fa4f..e0b70d9751 100644 --- a/include/u2f.h +++ b/include/u2f.h @@ -99,6 +99,20 @@ typedef struct { #define U2F_SW_COMMAND_NOT_ALLOWED 0x6986 // SW_COMMAND_NOT_ALLOWED #define U2F_SW_INS_NOT_SUPPORTED 0x6D00 // SW_INS_NOT_SUPPORTED +// Protocol extensions + +// Non-standardized command status responses +#define U2F_SW_CLA_NOT_SUPPORTED 0x6E00 +#define U2F_SW_WRONG_LENGTH 0x6700 +#define U2F_SW_WTF 0x6f00 + +// Additional flags for P1 field +#define G2F_ATTEST 0x80 // Fixed attestation key +#define G2F_CONSUME 0x02 // Consume presence + +// Vendor command to enable/disable the extensions +#define U2F_VENDOR_MODE U2F_VENDOR_LAST + #ifdef __cplusplus } #endif diff --git a/include/u2f_impl.h b/include/u2f_impl.h index 0effc2dd8d..8e4e80fa4f 100644 --- a/include/u2f_impl.h +++ b/include/u2f_impl.h @@ -103,17 +103,6 @@ int u2f_gen_kek_seed(int commit); /* Use non-standard extensions to the U2F protocol */ int use_g2f(void); -/* Non-standardized command status responses */ -#define U2F_SW_CLA_NOT_SUPPORTED 0x6E00 -#define U2F_SW_WRONG_LENGTH 0x6700 -#define U2F_SW_WTF 0x6f00 -/* Additional flags for the P1 fields */ -#define G2F_ATTEST 0x80 /* fixed attestation cert */ -#define G2F_CONSUME 0x02 /* consume presence */ - -/* Vendor command to enable/disable the extensions */ -#define U2F_VENDOR_MODE U2F_VENDOR_LAST - /* call extensions for unsupported U2F INS */ unsigned u2f_custom_dispatch(uint8_t ins, struct apdu apdu, uint8_t *buf, unsigned *ret_len) __attribute__((weak)); |