Commit Graph

339 Commits

Author SHA1 Message Date
Egor Duda
983bc5c5b2 Add support for ed25519 keys (#335) 2022-05-12 22:56:33 +03:00
kaczmarczyck
f95ae1f5ab Make private keys extensible (#476)
* adds PrivateKey to handle different algorithms

* fixes input check problem of decrypt_credential_source

* addresses comments

* version number not encrypted

* version number test

* adds a credential size test

* removes the algorithm from credential encoding
2022-05-10 14:31:29 +02:00
hcyang
3a39c4dff1 Add test_helpers (#474)
* Add set_enterprise_attestation in TestEnv

* Add test_helpers for Test Unification

* Used it in structured fuzzer and enterprise attestation unittests

* Restructure test_helpers

* Rename setup_enterprise_attestation to enable_
2022-05-10 18:50:18 +08:00
kaczmarczyck
8979af6ca4 adds Eq to PartialEq (#477) 2022-05-05 15:50:28 +02:00
hcyang
a0e11bd5aa Move remaining customizations to new file (#473) 2022-04-28 13:33:34 +02:00
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
kaczmarczyck
360efa4eaf replaces ThreadRng with env RNG (#469) 2022-04-27 15:49:45 +02:00
kaczmarczyck
8dc6dab450 Enterprise attestation testing (#465)
* fix enterprise attestation check

* returns storage errors
2022-04-26 12:24:43 +02:00
hcyang
2b6424360c Move enterprise mode related customizations to new file (#463)
* Move enterprise mode related customizations to new file

* Fix cargo clippy error

* Add is_enterpris_rp_id API to avoid cloning

* Only expose enterprise_rp_id_list API in std
2022-04-25 09:45:59 +08: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
Howard Yang
bbc51af042 Change some constant name in comments to snake case 2022-04-18 11:42:33 +08:00
Howard Yang
ee56024206 Return Vec<String> for rp_ids() 2022-04-15 11:08:26 +08:00
Howard Yang
ab67d14e93 Move 3 pure constants to new file 2022-04-14 19:21:51 +08:00
Howard Yang
eb8eccabc4 Separate tests 2022-04-14 19:17:45 +08:00
Howard Yang
f7d30827a5 Change assert comparison to assert_eq 2022-04-14 18:35:15 +08:00
Howard Yang
777623371a Add testing for TestCustomization 2022-04-14 18:32:20 +08:00
Howard Yang
4da060f799 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.
2022-04-14 18:21:03 +08:00
hcyang
74b472d9cb Move more customization constants to new file (#459)
* Move DEFAULT_CRED_PROTECT to customization api

* Fix format

* Remove blank line
2022-04-14 12:00:31 +02: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
kaczmarczyck
b33ffb7979 Vendor HID for libtock-drivers (#452)
* multi HID interface for libtock-drivers

* proper u8 print
2022-04-05 05:52:33 +02:00
kaczmarczyck
990c2b3ea6 Merge branch 'develop' into add_doc 2022-03-28 16:50:50 +02:00
Julien Cretin
f862d4cc18 Address all occurrences of statement expression attributes 2022-03-28 16:29:22 +02:00
Julien Cretin
6e2f076e24 Add documentation for #[cfg] work-around on expressions 2022-03-28 15:29:15 +02:00
kaczmarczyck
8331aa1378 allows Make before Reset (#449) 2022-03-28 14:29:32 +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
Fabian Kaczmarczyck
d6a2080cd5 adds channels to CTAP logic 2022-03-16 17:03:00 +01:00
kaczmarczyck
0b564d4a8a Vendor HID (#446)
* introduces vendor HID

* updates workflows with new feature

* feature renaming and variant covering
2022-03-15 14:41:48 +01:00
kaczmarczyck
7e7d5e38a1 enforces Module imports granularity (#445) 2022-03-14 20:44:48 +01:00
kaczmarczyck
ba0c583617 introduces Transport and Channel (#444) 2022-03-14 18:40:24 +01:00
kaczmarczyck
1372fd0b1a Separates HID command logic (#443)
* moves HID logic related to CTAP state out of the HID mod

* fixes license headers
2022-03-14 17:41:00 +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
Julien Cretin
0acafb107f Merge branch 'firmware_protection' into env_console 2022-03-08 15:02:34 +01:00
Julien Cretin
95ba81b9ed Merge branch 'develop' into firmware_protection 2022-03-08 11:25:44 +01:00
Julien Cretin
dc00b94ee8 Remove steal_storage 2022-03-07 19:43:58 +01:00
Julien Cretin
3211342934 Not all tock boards have upgrade storage 2022-03-07 15:59:37 +01:00
Julien Cretin
f08be3d57d Merge branch 'develop' into env_store 2022-03-07 15:34:17 +01:00
Fabian Kaczmarczyck
7c1ddcda0a fixes doc 2022-03-07 15:19:49 +01:00
Fabian Kaczmarczyck
2df7164c1f adds a versatile API to make removing CtapState easier 2022-03-07 15:19:49 +01:00
Fabian Kaczmarczyck
c595980a3b new process_message function and command enum 2022-03-07 15:19:49 +01:00
Julien Cretin
732523d380 Use Store instead of Storage in Env 2022-03-07 12:48:33 +01:00
Julien Cretin
2e3034193e Address comments 2022-03-04 16:09:04 +01:00
Julien Cretin
f09e5a77e8 Add write to the environment 2022-03-04 15:16:34 +01:00
Julien Cretin
dcc053c6cb Fix lock in Tock when error is EALREADY 2022-03-04 12:23:22 +01:00
Julien Cretin
bb40e3244a Add firmware protection to the environment 2022-03-04 11:24:10 +01:00
Julien Cretin
b80b67e2cf Factorize tock storage in assert_once 2022-03-04 10:23:44 +01:00
Julien Cretin
c4a27bf935 Add Storage and UpgradeStorage to Env 2022-03-03 17:37:28 +01:00
Julien Cretin
d6e4c66562 Move check_user_presence to env::tock 2022-03-03 17:37:10 +01:00
Julien Cretin
5c59e809c2 Make user feedback fields private 2022-03-03 17:34:49 +01:00
Julien Cretin
7d39d4e2e8 Create a tock environment 2022-03-03 17:32:48 +01:00