summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Norvez <norvez@chromium.org>2018-11-04 17:32:44 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-11-07 20:27:34 -0800
commitd20f90a205e86bf49307402a12c49226ae1ee03d (patch)
tree95bd79857befc6d6cbe42463b52b7c6b6d51efb9
parent5ffa5f9a44c9f392ac90849fe5146892796594bf (diff)
downloadchrome-ec-d20f90a205e86bf49307402a12c49226ae1ee03d.tar.gz
fpsensor: Move the definition of FP_TEMPLATE_FORMAT_VERSION
Move it to ec_commands.h so it's accessible to tools. BRANCH=nocturne BUG=b:73337313 TEST=make BOARD=nocturne_fp -j Change-Id: Ib7eecee599dde2d755357c2543ad860b64258f3f Signed-off-by: Nicolas Norvez <norvez@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1316706 Reviewed-by: Prashant Malani <pmalani@google.com>
-rw-r--r--common/fpsensor.c1
-rw-r--r--include/ec_commands.h3
-rw-r--r--util/ectool.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/common/fpsensor.c b/common/fpsensor.c
index d2f4a6297f..1899537649 100644
--- a/common/fpsensor.c
+++ b/common/fpsensor.c
@@ -42,7 +42,6 @@
#define FP_MAX_FINGER_COUNT 0
#endif
#define SBP_ENC_KEY_LEN 16
-#define FP_TEMPLATE_FORMAT_VERSION 3
#define FP_ALGORITHM_ENCRYPTED_TEMPLATE_SIZE \
(FP_ALGORITHM_TEMPLATE_SIZE + \
sizeof(struct ec_fp_template_encryption_metadata))
diff --git a/include/ec_commands.h b/include/ec_commands.h
index d26f159bde..7e37a2ad94 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -5066,6 +5066,9 @@ struct __ec_align4 ec_response_fp_info {
#define FP_FRAME_GET_BUFFER_INDEX(offset) ((offset) >> FP_FRAME_INDEX_SHIFT)
#define FP_FRAME_OFFSET_MASK 0x0FFFFFFF
+/* Version of the format of the encrypted templates. */
+#define FP_TEMPLATE_FORMAT_VERSION 3
+
/* Constants for encryption parameters */
#define FP_CONTEXT_NONCE_BYTES 12
#define FP_CONTEXT_USERID_WORDS (32 / sizeof(uint32_t))
diff --git a/util/ectool.c b/util/ectool.c
index 3d3cf21693..b78331f638 100644
--- a/util/ectool.c
+++ b/util/ectool.c
@@ -1485,7 +1485,7 @@ int cmd_fp_seed(int argc, char *argv[])
return 1;
}
printf("Setting seed '%s'\n", seed);
- p.struct_version = 3;
+ p.struct_version = FP_TEMPLATE_FORMAT_VERSION;
memcpy(p.seed, seed, FP_CONTEXT_TPM_BYTES);
rv = ec_command(EC_CMD_FP_SEED, 0, &p, sizeof(p), NULL, 0);