diff options
author | Yicheng Li <yichengli@chromium.org> | 2019-06-14 18:21:17 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-09 03:43:59 +0000 |
commit | 83e0848263313dbdaf10ebc887dea548faaf251a (patch) | |
tree | 9e5175d0fdee0265ef0d96fc6705fded4917c246 /common/mock/timer_mock.c | |
parent | 635f21d41c095f138cb711118a7866fcd0b5bcc4 (diff) | |
download | chrome-ec-83e0848263313dbdaf10ebc887dea548faaf251a.tar.gz |
fpsensor: Implement command to read positive_match_secret.
Add EC command to read positive_match_secret on match success.
If the attempt to read is 5 seconds after the match, the read is not
allowed (the readable bit for positive match secret is cleared).
Test that the command can read the data correctly and can
read for each finger only once. Test that attempt to read secret
after deadline will be rejected.
BRANCH=nocturne
BUG=chromium:927095
TEST=make buildall
TEST=tested enrollment, matching and multifinger on DUT nocturne
TEST=tested that if biod requests to download template and secret
for a finger that's not currently matched, reading secret will fail.
Change-Id: Idc734c6392d271e2aaee1cddf7c2c5b81b727b4a
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1679372
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
Diffstat (limited to 'common/mock/timer_mock.c')
-rw-r--r-- | common/mock/timer_mock.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/common/mock/timer_mock.c b/common/mock/timer_mock.c new file mode 100644 index 0000000000..21408b7fe6 --- /dev/null +++ b/common/mock/timer_mock.c @@ -0,0 +1,18 @@ +/* Copyright 2019 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "mock/timer_mock.h" + +static timestamp_t now; + +void set_time(timestamp_t now_) +{ + now = now_; +} + +timestamp_t get_time(void) +{ + return now; +}; |