Commit Graph

10 Commits

Author SHA1 Message Date
hcyang
078e565ac1 Add basic setup for multi-PIN (#530)
* Add basic setup for multi-PIN

- Reserve the storage keys for maximum of 8 user slots.
- Modify the storage functions to take a slot_id parameter.
- Add the slot_count() customization.
- Assume slot_id as a parameter when needed except these places:
  - Entrance functions of command processing that directly takes the
    command parameter structure. slot_id is set as 0, and will be
    parsed from the parameters when we enable the feature.
  - MakeCredential/GetAssertion/AuthenticatorConfig will take the
    slot_id from active token state when we enable the feature,
    resulting in an `Option<usize>`. Below code will act on the option
    value correctly. When the feature isn't enabled, we're always
    referring to the only PIN slot so set slot_id as Some(0).
  - GetInfo returns verdict of whether PIN is supported and enabled, and
    whether PIN needs to be forced changed. There will be new fields to
    represent those values when the feature is enabled, and the old
    fields will not be populated. So when the feature isn't enabled, we
    can treat slot_id as 0.

Not covered in this commit:
- Unittests for other slots. The existing tests all pass and I plan to
  add unittests for multi-slot case after the codebase allows enabling
  the feature.
- Persisting and checking the slot_id in credentials. This is planned to
  come in the next commit.

* Fix storage and some other style

* Add support for concatenated values

* Switch some storage entries back to multi-entry

* Set bumpalo version for fuzzing (#532)

* maximum working bumpalo version

* explicit comment to explain version locking

* removes incorrect comment

* moves serde version lock to dev dependencies

* removes serde dependencies

* reverts serde removal in crypto library

* Make PIN_PROPERTIES use concatenated storage entry

* Fix bumpalo issue

* Use concatenated storage entry for force_pin_change too

* Fix cargofmt

Co-authored-by: Julien Cretin <cretin@google.com>
Co-authored-by: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com>
2022-08-23 23:01:13 +08:00
hcyang
85fe9cd29d Add sturctured get assertion and client pin fuzzers (#482) 2022-05-27 10:34:38 +08:00
Howard Yang
17ecd46b04 Generate valid structure for MakeCredential params
* Add crate arbitrary as ctap's optional dependency, when feature "fuzz"
  is activated.

* Derive Arbitrary for all the necessary types in order to generate the
  concrete types from random bytes.

* Add a fuzz target that transforms the input to valid format for
  MakeCredential.
2022-03-22 19:06:20 +08:00
kaczmarczyck
40e912f8ac fixes the serde version (#407)
* fixes the serde version

* explicitly sets the version in the main Cargo.toml
2021-11-15 13:09:40 +01:00
mingxguo27
f79a659e69 Resolved PR comments and added more fuzz targets. 2020-09-29 16:30:41 +00:00
mingxguo27
e8e52ff58a Added more fuzz targets 2020-09-25 19:05:07 +00:00
Guillaume Endignoux
85a34ad085 Migrate import statements and macros to Rust 2018. 2020-09-24 11:28:24 +02:00
mingxguo27
d0a1f707bc Fixed dependencies 2020-09-23 14:33:05 +00:00
mingxguo27
6e8eecce59 Resolved comments 2020-09-23 14:33:05 +00:00
mingxguo27
69a440fddb Added first fuzzing target 2020-09-23 14:33:05 +00:00