| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=b:180546850
TEST=none
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I2730d8c6be88c924cfe794e38434f40bce289c07
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2702501
Reviewed-by: Craig Hesling <hesling@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Almost all of the console commands were already static. This change
makes all of them static for consistency.
BRANCH=none
BUG=b:172020503
TEST=make buildall -j
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I0ac46358b6fbafa65504c648ce4de0365cdbf723
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3224372
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When fp_finger_match() function returns code which indicates that
match failed it also sets number of matched template to -1.
Until now, in fp_process_match() we set internal error code when
finger number was invalid (fgr variable was set to -1). This resulted
in overwriting MATCH_NO, MATCH_LOW_QUALITY, MATCH_LOW_COVERAGE with
MATCH_NO_INTERNAL error code when match failed. As a result, biod was
receiving only internal errors always when match failed.
Now we overwrite error code with internal error only when
fp_finger_match() returns negative value or when it returns success,
but finger template number is outside range. In other cases we pass
unchanged error code to biod.
BUG=b:184843581
BRANCH=none
TEST=Flash FPMCU firmware on Chromebook. Reboot Chromebook, make sure
your firmware is running. Cover up part of sensor with paper and
try to unlock device. Compare biod and cros_fp logs, make sure
that biod reports the same reason on failed attempts.
Signed-off-by: Patryk Duda <pdk@semihalf.com>
Change-Id: I64e6cb2850c0bf4700482c35899f23b8102a480b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3135425
Tested-by: Patryk Duda <patrykd@google.com>
Commit-Queue: Patryk Duda <patrykd@google.com>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit ac08c9d1dbc9f587df3ee6b15d58c0203f7e356e.
Reason for revert: Breaks public build
Original change's description:
> fpsensor: Support building firmware that works for both sensors
>
> This is a refactoring to allow building FPMCU firmware that works for
> one FPC sensor and one ELAN sensor.
>
> 1. When both drivers implement our common functions, e.g. fp_sensor_init(),
> rename them to fp_sensor_init_fpc() and fp_sensor_init_elan().
> 2. There are a few functions implemented not in FPC driver but in FPC
> private library, e.g. fp_sensor_finger_status(). I kept this as-is for
> FPC but renamed the one in ELAN driver to fp_sensor_finger_status_elan()
> 3. If building for ELAN, need to hardcode elan=1 in hatch_fp/board.c
> because the sensor type GPIO always says FPC.
>
> BRANCH=none
> BUG=b:175158241
> TEST=make run-fpsensor; make run-fpsensor_status;
> make run-fpsensor_crypto
> TEST=make -j BOARD=dartmonkey
> TEST=add CONFIG_FP_SENSOR_ELAN515 to board/hatch_fp/board.h;
> make -j BOARD=bloonchipper
> Firmware binary fully works on Dragonair (FPC) and Voema (ELAN)
> TEST=run device tests with http://crrev/c/2750547 and
> http://crrev/i/3654297 on Dragonclaw, all pass
>
> Change-Id: I789090dbdfe35ac6aefd6a629fa4c7bde89dc437
> Signed-off-by: Yicheng Li <yichengli@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2727971
> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
> Commit-Queue: Tom Hughes <tomhughes@chromium.org>
Bug: b:175158241, b:184616069
Change-Id: I2a02a6eefc316e7e13aa188f1ae16672dce2babd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809521
Auto-Submit: Tom Hughes <tomhughes@chromium.org>
Tested-by: Tom Hughes <tomhughes@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: caveh jalali <caveh@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a refactoring to allow building FPMCU firmware that works for
one FPC sensor and one ELAN sensor.
1. When both drivers implement our common functions, e.g. fp_sensor_init(),
rename them to fp_sensor_init_fpc() and fp_sensor_init_elan().
2. There are a few functions implemented not in FPC driver but in FPC
private library, e.g. fp_sensor_finger_status(). I kept this as-is for
FPC but renamed the one in ELAN driver to fp_sensor_finger_status_elan()
3. If building for ELAN, need to hardcode elan=1 in hatch_fp/board.c
because the sensor type GPIO always says FPC.
BRANCH=none
BUG=b:175158241
TEST=make run-fpsensor; make run-fpsensor_status;
make run-fpsensor_crypto
TEST=make -j BOARD=dartmonkey
TEST=add CONFIG_FP_SENSOR_ELAN515 to board/hatch_fp/board.h;
make -j BOARD=bloonchipper
Firmware binary fully works on Dragonair (FPC) and Voema (ELAN)
TEST=run device tests with http://crrev/c/2750547 and
http://crrev/i/3654297 on Dragonclaw, all pass
Change-Id: I789090dbdfe35ac6aefd6a629fa4c7bde89dc437
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2727971
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Commit-Queue: Tom Hughes <tomhughes@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ideally this should be enabled for all the EC code, but that requires
making more changes. For now enable it for the fingerprint sensor code
to make sure we don't accidentally introduce variable length arrays.
BRANCH=none
BUG=b:172020413
TEST=make buildall
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I80fe4acade2c84886142ef795e54be004d1663be
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2792699
Commit-Queue: Yicheng Li <yichengli@chromium.org>
Reviewed-by: Yicheng Li <yichengli@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=b:177908650
TEST=Flash icetower v0.2, observed FP_SPI_SEL on console
TEST=Flash nocturne, observed FP_SPI_SEL on console
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I2b221139fed817de4c58db3b6c8198942ab86e7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2648731
Reviewed-by: Craig Hesling <hesling@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=b:175431356
TEST=cat OWNERS
# Visually inspected each character with my eyes.
# Confirmed that each character looked like it contributed to a
# word that could be the Gerrit email of a SWE on the Chrome OS
# Fingerprint team.
Signed-off-by: Craig Hesling <hesling@chromium.org>
Change-Id: Ieba1f54c9c88ed438bb44d4d4f1bfd2c0d9a5ac2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2596047
Commit-Queue: Tom Hughes <tomhughes@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Emails have been sorted.
BRANCH=none
BUG=b:175431356
TEST=cat OWNERS
# Visually inspected each character with my eyes.
# Confirmed that each character looked like it contributed to a
# word that could be the Gerrit email of a SWE on the Chrome OS
# Fingerprint team.
Signed-off-by: Craig Hesling <hesling@chromium.org>
Change-Id: I73764cfb6d7a797f9b4cb59d01d446a583097465
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2594429
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is an option in the task_set_event function which force
the calling task to wait for an event. However, the option is never
used thus remove it.
This also will help in the Zephyr migration process.
BUG=b:172360521
BRANCH=none
TEST=make buildall
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: Ic152fd3d6862d487bcc0024c48d136556c0b81bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521599
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rename atomic_read_clear to atomic_clear to be consistent with the rest
of the atomic functions, which return the previous value of the
variable.
BUG=b:169151160
BRANCH=none
TEST=buildall
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: I2588971bd7687879a28ec637cf5f6c3d27d393f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2505143
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CONFIG_FP_SENSOR was only enabled for RW, but we need a way to know
whether the board is a fingerprint MCU when in RO as well.
"FINGERPRINT_MCU" is a bit more generic than FP_SENSOR. We still only
build the matching-related code for RW.
BRANCH=none
BUG=b:171370392
TEST=make buildall
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I808faa7a16522791cfb4eb9cc2e163d9eb994804
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2508860
Reviewed-by: Bhanu Prakash Maiya <bhanumaiya@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is done as a part of porting to Zephyr.
Since the implementation of atomic functions is done for all architectures
use atomic_* instead of deprecated_atomic_*.
Sometimes there was a compilation error "discards 'volatile' qualifier"
due to dropping "volatile" in the argument of the functions, thus
some pointers casts need to be made. It shouldn't cause any issues,
because we are sure about generated asm (store operation will be
performed).
BUG=b:169151160
BRANCH=none
TEST=buildall
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: I98f590c323c3af52035e62825e8acfa358e0805a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2478949
Tested-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We will move to an API compatible with Zephyr's API. See the bug for
complete rationale and plan.
BUG=b:169151160
BRANCH=none
TEST=buildall
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: Id611f663446abf00b24298a669f2ae47fef7f632
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2427507
Tested-by: Dawid Niedźwiecki <dn@semihalf.com>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=b:144957935
TEST=make buildall
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I1b4fa0a715869ccc37e48d75316ef52c367aa64a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2417529
Reviewed-by: Craig Hesling <hesling@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=b:76037094
TEST=make buildall -j
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Ibe8649c3cf77ef4542b5fc46d7df5eee03293b56
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2364755
Commit-Queue: Craig Hesling <hesling@chromium.org>
Reviewed-by: Craig Hesling <hesling@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This repairs building bloonchipper and dartmonkey builds
when private lib is unavailable.
There are two issues this remedies:
1) Redefinition of sensor info macros, like FP_SENSOR_RES_X
2) Undefined reference to fp_sensor_maintenance when building
bloonchipper/dartmonkey non-private image.
All of these issues stem from the way we handle code
when HAVE_FP_PRIVATE_DRIVER is set or faked by a test.
This is a fundamental issues that needs some thought and refactoring.
BRANCH=none
BUG=b:164174822,b:163109916, b:163411883
TEST=# With private
time make buildall -j
TEST=# Without private
time make buildall -j
TEST=# With private libs
# Cherry-pick https://crrev.com/c/2357870 first, then
# this patch.
./util/compare_build.sh -b all -o
# This confirms that the all output binaries with private-lib
# did not change at all
Signed-off-by: Craig Hesling <hesling@chromium.org>
Change-Id: If71e3376fb7a904b77f2fc9fc56c8e0daf54db3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2357430
Reviewed-by: Andrew de los Reyes <adlr@chromium.org>
Reviewed-by: YH Lin <yueherngl@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new console command "fpmaintenance" for testing.
BRANCH=none
BUG=b:76037094
TEST=With dragonclaw v0.2 connected to Segger J-Trace and servo micro:
./util/flash_jlink.py
On FP console:
> fpmaintenance
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I7125f8783d3dd7e815612d20742c9d949d00ba71
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2323709
Reviewed-by: Yicheng Li <yichengli@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1. USART host command layer in chip/stm32
2. Fix usart implementation in stm32
BUG=b:147849609
BRANCH=none
TEST=1. make BOARD=bloonchipper -j
2. usart request and response works on dragonclaw
Change-Id: Idd89d3e490f23aa528ecaf6510c13d16b405de13
Signed-off-by: Bhanu Prakash Maiya <bhanumaiya@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2190531
Tested-by: Bhanu Prakash Maiya <bhanumaiya@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-by: Craig Hesling <hesling@chromium.org>
Commit-Queue: Bhanu Prakash Maiya <bhanumaiya@chromium.org>
Auto-Submit: Bhanu Prakash Maiya <bhanumaiya@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:147849609
BRANCH=none
TEST=1. make buildall -j
Change-Id: I35146070ec20a3605588792fc19595dc1c1ea3cf
Signed-off-by: Bhanu Prakash Maiya <bhanumaiya@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2191733
Tested-by: Bhanu Prakash Maiya <bhanumaiya@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Commit-Queue: Bhanu Prakash Maiya <bhanumaiya@chromium.org>
Auto-Submit: Bhanu Prakash Maiya <bhanumaiya@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bloonchipper (aka hatch_fp aka dragonclaw) has a voltage divider that
can be used to select the sensor and the transport type.
Supported designs:
* Dragonclaw rev 0.2 (green with Google logo):
go/dragonclaw-schematic-rev-0.2
* Hatch reference v3.0:
go/hatch-schematic-rev-3.0
The selection lines are connected to ADC inputs, so a future change will
use the ADC to allow more than two transports or sensors.
BRANCH=none
BUG=b:147113851
TEST=flash dragonclaw rev 0.2 and view console output
Change-Id: If2e4b150d34cfe41477be528c70e1645043d4d82
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1986322
Reviewed-by: Craig Hesling <hesling@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=none
TEST=none
Change-Id: I6259eec96f96f1108df150d4d4e875a5ee96f241
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1976002
Commit-Queue: Nicolas Norvez <norvez@chromium.org>
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There should be no functional difference to fpcapture or fpenroll,
since the restricted console command feature is implemented in a
similar manor.
The only noticeable difference is that the list of commands provided
by the "help" command should denote when these commands are restricted.
Note, each board requires a configuration, similar
to crrev.com/c/1867388, in order to activate restricted
console commands. Otherwise, this restricted flag has no
restricting effect.
BRANCH=nocturne
BRANCH=hatch
BUG=b:142559996, b:142505927
TEST=# Test on nocturne_fp
make BOARD=nocturne_fp
scp build/nocturne_fp/ec.bin dut1:~/
ssh dut1 flash_fp_mcu ./ec.bin
# From FPMCU UART console
version
# Ensure that version is custom based on workstation
help
# Ensure that fpcapture and fpenroll are not prefixed
# with "-"
help list
# Ensure that a "Flags" column exists and that
# fpcapture and fpenroll both have a 1 in the column.
fpcapture
fpenroll
# Ensure that both commands above succeed in their
# own operations
syslock
fpcapture
fpenroll
# Ensure that both commands above fail with "Access Denied"
help
# Ensure that fpcapture and fpenroll are now prefixed
# with "-" in the help message
Change-Id: Icbb74a1afece66db9ebd071de0770650d42bd553
Signed-off-by: Craig Hesling <hesling@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1869400
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These source files have been approved to be released publicly (see
http://b/137848573#comment20). There were no source changes in the move,
except for small changes to the Makefiles to adjust for the move.
For future "git blame"s refer to the history of the files in the private
repo if you need to access the full history.
BRANCH=none
BUG=b:137848573
TEST=make buildall -j
Cq-Depend: chrome-internal:2005127
Change-Id: I1a809ac5a4d95637840ee47712e9c80a40a445c5
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1869531
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL enables the fpsensor task and adds the following
remaining fingerprint host commands to the fuzzer:
* EC_CMD_FP_PASSTHRU
* EC_CMD_FP_INFO
* EC_CMD_FP_FRAME
* EC_CMD_FP_STATS
* EC_CMD_FP_TEMPLATE
BRANCH=none
BUG=b:116065496
TEST=make buildall -j
TEST=make run-host_command_fuzz
TEST=# Pull in TEST_COVERAGE fix
git fetch "https://chromium.googlesource.com/chromiumos/platform/ec" \
refs/changes/86/1725186/1 && git cherry-pick FETCH_HEAD
make host-host_command_fuzz TEST_COVERAGE=1
timeout 5m ./build/host/host_command_fuzz/host_command_fuzz.exe
llvm-profdata merge -sparse default.profraw -o default.profdata
llvm-cov show build/host/host_command_fuzz/host_command_fuzz.exe \
--instr-profile=default.profdata --format=html --output-dir=cov
# Inspect cov/.../common/fpsensor/fpsensor_state.c.html to verify
Change-Id: Icad9493ba41cd4daa61a30246d01afd1dbe16c56
Signed-off-by: Craig Hesling <hesling@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1682945
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Commit-Queue: Sean Abraham <seanabraham@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=b:116065496
TEST=make buildall -j
Change-Id: Ia723d98354ca027f41f1b3c00d6a2dac500edbf8
Signed-off-by: Craig Hesling <hesling@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1715633
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Commit-Queue: Sean Abraham <seanabraham@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On receiving an template, if the template has format version 3 and
has empty positive match salt, then generate positive match salt for
this template so that it has positive match secret on the next match.
BRANCH=nocturne
BUG=chromium:927095
TEST=make -j buildall
TEST=tested enrollment, matching, deletion, multifinger on DUT nocturne
TEST=tested migration on DUT nocturne, specifically, enrolled template
with old FPMCU firmware, then updated firmware, verified that templates
are migrated and continue to work.
Change-Id: If8020acfb60a03269af9ddb41023796920116fca
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1769395
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On enrollment success, generate new positive_match_salt and send it as part
of the encrypted blob. Also enable positive match secret to be read.
The positive_match_salt is used to derive positive_match_secret and
is different from the encryption salt for encrypting the templates.
The positive_match_salt needs to be sent to biod and stored with templates
because it needs to be re-uploaded to FPMCU the next time the user logs in.
The positive match secret needs to be sent to biod so that it knows what to
compare against at a match.
BRANCH=nocturne
BUG=chromium:927095
TEST=make -j buildall
TEST=tested enrollment, matching and multifinger on DUT nocturne
Change-Id: I3e44a972ee17c5a93bddd52340f8f2249836463a
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1828058
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement derivation of positive match secret for a template. This
derivation will be used when biod sends a command to ask for
positive match secret and the secret readable bit is set. Also add
unit tests for this derivation.
BRANCH=nocturne
BUG=chromium:927095
TEST=make -j buildall
TEST=tested enrollment, matching and multifinger on DUT nocturne
Change-Id: Ife477a98573284f69c5fb07e814d9a3d09f92127
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1639440
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On enrollment success, generate random positive match salt. This will
be used in the derivation of positive match secret.
BRANCH=nocturne
BUG=chromium:927095
TEST=make -j buildall
TEST=tested enrollment, matching, deletion and multifinger on DUT
nocturne.
Change-Id: I4ad55a0221c4aa1f6e3cc56b66c2165ad9455ba0
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1719385
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This can be used to replace hkdf_expand_one_step in more general cases
of HKDF. Also add unit tests for this.
BRANCH=nocturne
BUG=none
TEST=make -j buildall
Change-Id: Ie116b13ee33d171298eccabb8a37b59e702d0218
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1719871
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add stubs for fp_sensor_init and fp_sensor_deinit when building without
the private FP sensor files.
BRANCH=none
BUG=b:124773209,b:141924178
TEST=make buildall -j
Change-Id: Ie85a4bb0e568b205ada0d378ae658e8fe478c0a9
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1834274
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Setting the context now triggers a reset of the sensor library (see
I3e25bdf7eaaf99f3801547e11a6c524f924f4726), which in turn will end up
calling fp_sensor_open to re-initialize the sensor. Since some
calibration is performed in that command, it takes ~173 ms, which is
close enough to the EC command timeout (200 ms) that it often fails.
This change makes the command "asynchronous" so that userspace can poll
for the result and avoid the command timeout.
BRANCH=nocturne
BUG=b:137288498
TEST=make buildall -j
TEST=ectool --name=cros_fp fpcontext 01234567890123456789012345678901
Change-Id: I997bf9c5b9e90eceb5375dccffcb535529a86e47
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1819115
Reviewed-by: Yicheng Li <yichengli@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the host command handler callback function returns an int, it's easy
to accidentally mix up the enum ec_error_list and enum ec_status types.
The host commands always expect an enum ec_status type, so we change the
return value to be of that explicit type. Compilation will then fail if
you accidentally try to return an enum ec_error_list value.
Ran the following commands and then manually fixed up a few remaining
instances that were not caught:
git grep --name-only 'static int .*(struct host_cmd_handler_args \*args)' |\
xargs sed -i 's#static int \(.*\)(struct host_cmd_handler_args \*args)#\
static enum ec_status \1(struct host_cmd_handler_args \*args)##'
git grep --name-only 'int .*(struct host_cmd_handler_args \*args)' |\
xargs sed -i 's#int \(.*\)(struct host_cmd_handler_args \*args)#\
enum ec_status \1(struct host_cmd_handler_args \*args)##'
BRANCH=none
BUG=chromium:1004831
TEST=make buildall -j
Cq-Depend: chrome-internal:1872675
Change-Id: Id93df9387ac53d016a1594dba86c6642babbfd1e
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1816865
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The opaque context contains sensor state that we can't nuke from
underneath the sensor library. Calling fp_sensor_deinit will release
this context and allow us to safely clear the context.
BRANCH=none
BUG=b:124773209
TEST="fpenroll" followed by "fpclear" in the FP console
TEST=On nocturne, in the UI, enroll finger, log out, and log in
=> then lock and unlock with finger
TEST=make buildall -j
Change-Id: I3e25bdf7eaaf99f3801547e11a6c524f924f4726
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1647294
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
Commit-Queue: Yicheng Li <yichengli@chromium.org>
Tested-by: Yicheng Li <yichengli@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In fpsensor code, use always_memset() in place of memset().
BRANCH=nocturne
BUG=chromium:968809,chromium:989594,b:130238794
TEST=make -j buildall
TEST=tested enrollment, matching and multifinger on nocturne DUT
Change-Id: I29e32bd2838c1f240607799e61f29759aaee7600
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1737206
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
EC_RES_SUCCESS and EC_RES_ERROR are meant to be returned in EC command
handler to represent command result, so change crypto functions to
return EC_SUCCESS and EC error codes instead.
BRANCH=nocturne
BUG=none
TEST=make -j buildall
TEST=tested enrollment, matching, deletion and multifinger on
nocturne DUT
Change-Id: Ia98fa7469ab4e5dba00ede19dd34c5007d17b054
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1715512
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
All the other console commands have help descriptions except for the
fingerprint sensor commands.
BRANCH=none
BUG=none
TEST="help list" in hatch_fp console
Change-Id: I601c7e49a28693f4b7f4344a6030febb87c2ae20
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1674808
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Console commands return different error code types than host commands.
When the host command return value is returned for a console command,
the error message that is printed on the console is wrong, which is
confusing.
BRANCH=none
BUG=chromium:978078
TEST="syslock" in hatch FP console so system_is_locked returns true
"fpcapture" in hatch FP console => Access Denied
"fpenroll" in hatch FP console => Access Denied
Change-Id: I18dbc093011743d4a9469eb5843c1464496bdd53
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1674049
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fix applies to both the console command and the host (when
switching to FP_MODE_ENROLL_SESSION).
BRANCH=nocturne
BUG=b:124773209
TEST="fpenroll" multiple times in FP console
=> verify we get error after 5 attempts
TEST=ectool --name=cros_fp fpmode enroll
=> verify we get error after 5 attempts
TEST=make buildall -j
Change-Id: I4e1d50f5e72d65d707e1889dee3036334f07f1eb
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1650036
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This refactoring allows us to call fp_command_mode from the debug
console commands and ensure that we're testing the same underlying code
path that the host commands use.
BRANCH=nocturne
BUG=b:124773209
TEST="fpenroll" in hatch FP console
"fpmatch" in hatch FP console
"fpclear" in hatch FP console
TEST=On nocturne:
flash_fp_mcu ec.bin
Enroll fingerprint via UI, lock/unlock, Remove fingerprint via UI
Change-Id: I5e1e314c7f1d67dc663795cafe751545516e9f89
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1652285
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move HKDF extract and HKDF expand code to two helper functions.
This is in preparation for future change to implement positive
match secret.
BRANCH=nocturne
BUG=chromium:927095
TEST=ran unittests, including unit test for derive_encryption_key()
TEST=tested enrollment, matching and multifinger on DUT nocturne
Change-Id: Ia7c67ef8339a3617b0177334ba824b4c805047c8
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1641962
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Delete extra slashes in build.mk so that the build target names are
correct.
BRANCH=nocturne
BUG=chromium:973618
TEST=make -j buildall
TEST=no more extra slashes:
CC RW/common/fpsensor/fpsensor.o
CC RW/common/fpsensor/fpsensor_state.o
CC RW/common/fpsensor/fpsensor.o
CC RW/common/fpsensor/fpsensor_state.o
CC RO/common/fpsensor/fpsensor_state.o
Change-Id: Ibb8a975462242487c9dfbf84558cbbc97d31e87f
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1658516
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Although the code is moved from files created in 2017, these are new
files, so change the year to 2019.
BRANCH=nocturne
BUG=none
TEST=make -j buildall
Change-Id: I15015c7ad1a713437b04395fd09e6641019f5ff7
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1660092
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mock rollback_get_secret() and use it to test derive_encryption_key().
BRANCH=nocturne
BUG=chromium:927095
TEST=make -j buildall
TEST=tested enrollment, matching and multifinger on nocturne DUT
TEST=verified test key vectors by running boringSSL's HKDF
(https://boringssl.googlesource.com/boringssl/+/c0b4c72b6d4c6f4828a373ec454bd646390017d4/crypto/hkdf/)
locally
Change-Id: Ie2f51e4f64788d938e43d0c5c18685d1cfdd001c
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1652495
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move crypto-related code to common/fpsensor/fpsensor_state.c. This
facilitates unittesting because we can control whether to link in
crypto-related code, and also facilitates mocking the encryption
engine.
BRANCH=nocturne
BUG=chromium:927095
TEST=ran unittests
TEST=tested enrollment, matching and multifinger on DUT nocturne
Change-Id: I5bffc1460cbe2c9e3d6294ea5fff41f14019f0eb
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1648922
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add EC command for the host to query FP sensor encryption status.
Currently it's just FP TPM seed has been set or not.
Add unit test for this command. Also add ectool command for querying
encryption status.
BRANCH=nocturne
BUG=chromium:952275
TEST=ran unittests
TEST=tested enrollment, matching and multifinger on DUT nocturne.
TEST=tested querying sensor encryption status using ectool.
Change-Id: I07d1e471ead85a517105b38d1ddd793c3046ce8f
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1633272
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The CCPRINTF/S macro provides more control over the logging output and
we already use it everywhere else in the file.
BRANCH=none
BUG=b:124773209
TEST=make buildall -j
TEST=view log messages in FP console
Change-Id: Idbdbfe7a5fdb590288e9926aabf21412cfe50549
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1646883
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also increase timeout to provide enough time to hit enter when download
prompt pops up.
BRANCH=none
BUG=b:124996507
TEST=fpcapture from fingerprint console
Change-Id: I1e608161aceae4431dedcaffd648d20549b97a8b
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1593956
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
|