pinweaver: Use new error code for biometrics try_auth

We treat a successful try_auth for biometrics rate-limiter (which still
increases attempt counter) as success now. But the log_replay logic
depends on the return code to decide whether the attempt counter should
be increased. Therefore, introduce a new error code that is specifically
used for the success case for biometrics try_auth.

BUG=b:246653798
TEST=added unittests in https://crrev.com/c/3870665

Change-Id: I370329060e3842fb2b600d1ade4789556e37b1bd
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/pinweaver/+/3892082
Tested-by: Howard Yang <hcyang@google.com>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
Commit-Queue: Howard Yang <hcyang@google.com>
2 files changed
tree: 61bfc2c1d215152f5df1cf9571d70e5ab9e8a26a
  1. eal/
  2. fuzzer/
  3. BUILD.gn
  4. LICENSE
  5. OWNERS
  6. pinweaver.c
  7. pinweaver.h
  8. pinweaver_eal.h
  9. pinweaver_types.h
  10. PRESUBMIT.cfg
  11. README.md
README.md

Common PinWeaver Code

This directory contains reference PinWeaver code that can be used across implementation platforms.

It consists of:

  • PinWeaver reference code:
    • pinweaver.h - PinWeaver embedded API definition
    • pinweaver.c - implementation
    • pinweaver_eal.h - API for Environment Abstraction Layer (EAL) used by PinWeaver
      • note that some types used in this API are platform-specific and are defined in eal/**/pinweaver_eal_types.h
    • pinweaver_types.h - header that is shared by PinWeaver implementation and PinWeaver clients that call it through platform-specific interface.
  • Environment Abstraction Layer (EAL) implementations - in eal/ folder
    • eal/cr50 - implementation for cr50
      • pinweaver_eal_types.h - cr50-specific EAL API types
      • pinweaver_eal.c - cr50 implementation of EAL
    • eal/tpm_storage - implementation for platforms that use TPM as PinWeaver data storage
      • pinweaver_eal_types.h - TPM-storage-specific EAL API types
      • pinweaver_eal_tpm.h - additional EAL functions required by TPM storage
      • pinweaver_eal_linux.c - implementation of non-storage EAL methods for Linux case
      • tpm_storage_stubs.c - empty implementation of storage EAL methods
      • tpm_storage.c - implementation of storage EAL methods on top of TSS
      • mini_trunks/ - mini-TSS (TPM client software stack) used by TPM storage implementation
        • created from trunks TSS used by ChromeOS reduced to the minimal required set of TPM commands and ported from C++ to C
        • relies on pinweaver_eal.h + pinweaver_eal_tpm.h EAL methods
        • TSS API is defined in tss.h + *authorization_delegate.h

A platform implementation that uses TPM storage EAL option needs to implement all EAL methods implemented in pinweaver_eal_linux.c (or use it as-is, if Linux compatible).