Commit Graph

1250 Commits

Author SHA1 Message Date
kaczmarczyck
3091b5a29d Moves vendor commands into TockEnv (#614)
This move changes the Env trait: It removes all functionality that is
used only in vendor commands (`FirmwareProtection`, `UpgradeStorage`)
and adds a function to call when parsing CBOR commands.

The abstraction necessary to test these commands is instead realized
through compile flags. The mock upgrade storage is active when compiled
for std for example.
2023-04-17 00:17:37 +02:00
kaczmarczyck
a1d6ed0223 Makes our CredRandom derivation FIPS compliant (#613)
* Makes our CredRandom derivation FIPS compliant

This change breaks existing usage of CredRandom.

* fixes rust_crypto and HKDF test style
2023-04-11 14:48:42 +02:00
kaczmarczyck
be42b47caf Replaces Rng256 with new Rng API (#612)
* Replaces the Rng256 with RngCore from rand_core

The old trait was designed with our software crypto in mind. We should
use a more standard API going forward.

- Removes libraries/rng256/
- Ports libraries/crypto/ to rand_core
- Moves the used RNG trait to api/

* Use StdRng directy in TestEnv
2023-04-11 10:23:38 +02:00
kaczmarczyck
4cc1b4fddf Adds AES256 to the Crypto trait (#611) 2023-04-06 10:27:33 +02:00
kaczmarczyck
d0cdbec5ce Adds HKDF to the Crypto trait (#610) 2023-04-04 17:48:56 +02:00
kaczmarczyck
22192a37d2 SHA and HMAC for the Crypto trait (#609)
* Implements SHA256 into the Crypto trait

* Fixes documentation

* Descriptive documentation
2023-04-04 17:12:05 +02:00
kaczmarczyck
c168141b60 Adds a trait for crypto, porting EC first (#606)
* Adds a trait for crypto, porting EC first

* Moves crypto implementation next to its trait

* Renames constants and types
2023-04-04 13:54:41 +02:00
kaczmarczyck
80b82ffd42 LTO fix and toml cleanup (#608)
* Removes redundant entries from Cargo.toml

This also fixes a compilation problem we have in debug mode with LTO
enabled.

* fix output-path triple dash
2023-04-04 13:40:42 +02:00
kaczmarczyck
6d5ea16f2d CTAP HID Lock (#605)
* Implements the CTAP HID Lock command

This is a direct translation of our internal implementation.

* adds more HID Lock tests
2023-03-17 17:22:36 +01:00
kaczmarczyck
2560b6661c Fixes configuration failure modes in deploy.py (#604) 2023-03-11 10:12:20 +01:00
kaczmarczyck
752db8cc90 Fixes new clippy lints on the latest nightly (#603)
* Fixes new clippy lints on the latest nightly

We didn't see these before because of our old Rust toolchain.

* fixes nit
2023-03-09 12:08:34 +01:00
kaczmarczyck
ca65902a8f CTAP library move (#602)
* Moves all CTAP logic into its own library

* workflows fix test

* more coveralls workflow tests
2023-03-07 15:56:46 +01:00
kaczmarczyck
03031e6970 Maintenance PR for clippy, license and authors (#601)
* Maintenance PR for clippy, license and authors

* remove author from libraries
2023-03-06 12:45:01 +01:00
kaczmarczyck
7769e783bb AAGUID customization (#600)
* Moves the AAGUID to Customization

* Removes the AAGUID from storage

The commit is optional on top of the Customization move. I didn't see
the point in storing the AAGUID in persistent storage anymore, so I
removed it.
2023-03-06 11:42:56 +01:00
kaczmarczyck
3135c13e6b Moves the TockEnv implementation of RNG to env/ (#599)
This change removes the tock dependencies from non-Tock envs.
2023-03-06 11:21:48 +01:00
kaczmarczyck
d8512b4417 Moves Endpoint from libtock to API (#598)
The main benefit is that we removed all mentions of "tock" from all
source code that is not `main.rs` or inside `env/`.

This change makes libtock-drivers oblivious to how many endpoints are
supported. The endpoint is now checked a bit later in the stack.
2023-03-01 14:58:40 +01:00
kaczmarczyck
9a2ef0bf75 Removes timer updates from CTAP API (#597)
* Removes timer updates from CTAP API

* helper function for timer check
2023-03-01 14:30:04 +01:00
kaczmarczyck
73c60d8740 Clock trait (#596)
* adds generic Env parameters

* adds Clock type to Env

* use new Clock

* TockTimer improvements

* new Clock interface

* addressed comments

* renames constants to milliseconds, other style fixes

* removes all cargo fmt artifacts
2023-02-28 17:35:42 +01:00
kaczmarczyck
963549f9bb Removes nrfutil from default install (#595)
* remove nrfutil from the default install

* run CI Fuzz after merging, so changes are reflected
2023-02-13 17:49:29 +01:00
kaczmarczyck
98ecdec453 fixes parameter order for config (#594) 2023-02-13 17:03:08 +01:00
kaczmarczyck
a222986995 adds requirements.txt for setup (#591) 2023-02-08 11:36:01 +01:00
kaczmarczyck
8733d6585f Version string for CTAP 2.1 (#590)
* new version string for 2.1

* fixes new Python linter problems
2023-02-08 09:20:59 +01:00
浅香ジュン
684d37fa03 error-message: fix the incorrect output of low nrfutil version. (#581) 2023-01-25 15:32:37 +01:00
kaczmarczyck
0db393bd1e adds style fix and updates Cargo.lock (#576) 2023-01-04 15:19:26 +01:00
kaczmarczyck
6b5f6e53eb upgrades linked_list_allocator (#574) 2022-12-12 16:42:49 +01:00
Julien Cretin
f6e9e00b87 Add linear view into a storage (#571) 2022-12-07 13:00:41 +01:00
Julien Cretin
0d0460f016 Fix pylint versions (#572) 2022-12-07 09:53:31 +01:00
L0g4n
9ab3bc977c Respect CARGO_TARGET_DIR env var (#564)
* Respect `CARGO_TARGET_DIR` env var

This change resolves `CARGO_TARGET_DIR` when set instead of hardcoding
Cargos `target/` dir.

* Fix pylint offenses

* Simplify env query

* Fix yapf offenses
2022-10-24 06:30:32 +02:00
kaczmarczyck
44cafb9566 introduces customization for PIN protcol v1 (#559) 2022-10-13 16:13:07 +02:00
kaczmarczyck
3c28ff49ee Simplifies Env upgrade API (#551)
* removes read_partition and partition_length from upgrade API

* renames partition to bundle, also data type change from slice to Vec

* removes hash from Env API

* fixes comment
2022-10-03 16:33:34 +02:00
kaczmarczyck
6610a29a67 Fixed proc-macro2 version (#550)
* fixes proc-macro2 in dependencies

* adds missing locked versions, and a verbose print for cargo check

* commits Cargo.lock files

* removes unnecessary Cargo.lock entries

* adds missing Cargo.lock
2022-09-27 10:12:45 +02:00
kaczmarczyck
f2fac83124 Fix once_cell dependency (#548)
* fixed version of once_cell

* fixes comments

* removes unnecessary fuzz dependency
2022-09-21 19:32:09 +02:00
kaczmarczyck
d6994e3bc3 New Upgrade Interface (#543)
* includes metadata inside partition, introduces the partition helper

* style improvements
2022-09-13 10:06:58 +02:00
kaczmarczyck
8288bb0860 Firmware version for upgrades (#542)
* shows and checks the firmware version

* merges metadata ranges in boards

* simplifies locations loop
2022-09-01 18:28:03 +02:00
kaczmarczyck
771ce7635b moves metadata parsing to Env (#541) 2022-08-31 16:58:49 +02:00
kaczmarczyck
1b360662ee Public Key plain byte encoding (#540)
* public key is encoded in bytes

* ECDSA pubkey in uncompressed format
2022-08-31 15:51:40 +02:00
kaczmarczyck
598c21071e New metadata format (#539)
* new metadata format is used

* Update bootloader/src/main.rs

Co-authored-by: ztoked <zhalvorsen@google.com>

* splits the metadata signed and unsigned parts evenly

* fixes pylint

Co-authored-by: ztoked <zhalvorsen@google.com>
2022-08-31 14:35:45 +02:00
kaczmarczyck
932924ea85 removes metadata storage type (#538) 2022-08-29 12:05:58 +02:00
kaczmarczyck
01cc8333e5 Tool fixes (#537)
* private key type is str, some fixes

* catches file exceptions for private key

* adds exception type

* adds exception message
2022-08-29 11:00:31 +02:00
Julien Cretin
2dc44984ed Merge pull request #534 from ia0/bumpalo
Fix bumpalo issue
2022-08-23 11:11:34 +02:00
Julien Cretin
a44d961e7e Fix bumpalo issue 2022-08-23 10:43:44 +02:00
Julien Cretin
5509e3f072 Merge pull request #531 from ia0/concat
Add support for concatenated values
2022-08-22 17:09:08 +02:00
kaczmarczyck
d2037a4bbe Merge branch 'develop' into concat 2022-08-22 15:55:29 +02:00
kaczmarczyck
6bb12252f8 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
2022-08-22 15:53:50 +02:00
Julien Cretin
e52adf04c7 Add support for concatenated values 2022-08-19 12:47:29 +02:00
kaczmarczyck
4442998b64 Vendor HID for upgrades (#529)
* vendor-hid for upgrades

* empty argument fix

* same vendor-hid usage in both deploys

* forgot one board

* aaand also forgot the quotes
2022-08-17 10:29:26 +02:00
hcyang
87839af572 Support credBlob for non-resident credentials (#518)
* Support credBlob for non-resident credentials

- Add a upper limit of max_cred_blob_length
- Add test cases for cred_blob in non-resident flows
- Modify the test helper functions in ctap/mod.rs a bit

* Fix some styles in credential_id.rs

Co-authored-by: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com>
2022-08-16 22:23:49 +08:00
kaczmarczyck
5daf5f81d1 uses latest in workflows (#528) 2022-08-15 10:44:05 +02:00
Julien Cretin
d3e01d22fb Duplicate the credential management command as a vendor command (#527)
* Duplicate the credential management command as a vendor command

This permits to work with libfido2 and thus ssh-add. Fix #526.

* fix deploy_partition script
2022-08-13 06:27:31 +02:00
Liam Murphy
c6d3f51b5f Add configure-only mode to deploy.py script (#471)
* Add configure-only mode to deploy.py script

* Default configure flag to true
2022-08-09 08:12:37 +02:00