Commit Graph

18 Commits

Author SHA1 Message Date
kaczmarczyck
4782d7e186 Separate RNG library (#470)
* seperates the RNG library

* fixes crypto tests

* adds rng256 workflow

* fixes formatting
2022-04-28 11:36:43 +02:00
hcyang
aca1f35170 Make rng in TestEnv deterministic and seedable (#461)
* Move three dependent customizations into new file

* default_min_pin_length(_rp_ids) and max_rp_ids_length

* Did some backing store tricks to make the list configurable in
  TestCustomization.

* Add testing for TestCustomization

* Change assert comparison to assert_eq

* Separate tests

* Move 3 pure constants to new file

* Return Vec<String> for rp_ids()

* Make rng in TestEnv deterministic and seedable

* Move seed method to TestRng256

* Change some constant name in comments to snake case

* Move seed rng of env to the start

* Fix unused warning

* Make rng in TestEnv deterministic and seedable

* Move seed method to TestRng256

* Move seed rng of env to the start

* Fix unused warning

* Seed rng in all fuzz targets

* Fix error introduced when merging

Co-authored-by: Julien Cretin <cretin@google.com>
2022-04-20 15:49:17 +08:00
hcyang
1ef9a4447d Introduce Customization struct (#458)
* Introduce Customization trait

* Introduce Customization trait including the customization accessors
  that control various behaviors.

* Expose Customization through a getter API in Env, and make the code
  that directly access the constants currently switch to accessing the
  customizations via Env.

* TockEnv's customization getter implementation directly returns the
  reference of the global DEFAULT_CUSTOMIZATION constant, so the
  constant values are still inlined and dead code won't be compiled.

* We'll add the customizations from global constants to the struct
  one-by-one, only MAX_MSG_SIZE in this commit.

* Small fixes

* Fix deploy script
* put is_valid under std gate
2022-04-14 08:57:18 +02: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
ba0c583617 introduces Transport and Channel (#444) 2022-03-14 18:40:24 +01:00
kaczmarczyck
163057daf0 Clean public HID interface (#442)
* clear public HID interface and tests

* fixes nits
2022-03-14 12:08:44 +01:00
Shiling Wang
2050f9f272 Replaced Libtock driver clock with embedded_time::Clock (#422)
* Replaced Libtock driver clock with embedded_time::Clock

* Add unittest and address some comments

* Add unittest and address some comments
2022-03-10 16:18:47 +01:00
Fabian Kaczmarczyck
c595980a3b new process_message function and command enum 2022-03-07 15:19:49 +01:00
Julien Cretin
18faf9f38f Introduce a trait to abstract the CTAP environment
The end goal is to provide users with:
- the Env trait that they should implement
- the Ctap struct that they can use
2022-03-03 17:32:48 +01:00
Julien Cretin
b5b9d3f6e0 Fix ctap2 fuzz targets to use prod cbor parsing
This fixes a left-over from #329.
2021-08-11 16:00:30 +02:00
David Drysdale
7719078d46 cbor: rename crate to sk-cbor
In anticipation of publishing to crates.io, which already has a `cbor`
crate.
2021-06-16 17:16:05 +02:00
David Drysdale
f2812e4fe2 cbor: drop std feature, use core in tests (#327) 2021-06-16 15:40:18 +02:00
Julien Cretin
4253854cf1 Remove ram_storage feature
We don't need to build a production key without persistent storage. Tests and
fuzzing continue to use the std feature to use the RAM implementation (that does
sanity checks).
2020-12-10 13:06:05 +01:00
Fabian Kaczmarczyck
ed59ebac0d command timeout for GetNextAssertion 2020-11-26 14:56:52 +01:00
mingxguo27
9493014b13 Resolved PR comments 2020-10-02 17:18:36 +00:00
mingxguo27
f79a659e69 Resolved PR comments and added more fuzz targets. 2020-09-29 16:30:41 +00:00
mingxguo27
8231c89207 Formatting 2020-09-25 19:26:35 +00:00
mingxguo27
3a42ab15ae Added fuzzing helper library to increase code reusability and refactored first fuzz target 2020-09-25 19:03:45 +00:00