1279 Commits

Author SHA1 Message Date
kaczmarczyck
893faa5113 Ask contributors to go to develop (#677)
* Ask contributors to go to develop

* Enables CI on other branches
2024-01-15 14:57:58 +01:00
kaczmarczyck
5bfd198278 Corrects the README for the 2.1 branch. (#664) 2023-11-09 17:32:14 +01:00
kaczmarczyck
c160b034ef Latest compiler and package versions (#663)
* Move to latest compiler and package versions

We also add cargo audit to the desktop tests.

* Install cargo audit differently in workflow

* Removes leftover nightly references

* Removes install check from deploy.py

The toolchain should be correctly setup after setup.sh.

* Removes rust component install from workflow

Now that the nightly version is fixed, this should work ootb.

* Moves cargo audit install to setup.sh

* Updates cargo bloat workflow to default features
2023-11-09 15:00:37 +01:00
kaczmarczyck
6ed83c34c7 Fixes cargo audit (#662) 2023-11-09 10:37:36 +01:00
kaczmarczyck
e5ba9db644 Reworks workflows into script (#661)
* Reworks some workflows to run a script instead

Advantages are:
- Only one set of tests needs maintenance.
- Local results match workflows, no surprises.
- Reduced reliance on GitHub actions.

Fixes #50, #168, #169, #171, #507

* Adds macos to the test matrix
2023-11-08 17:24:15 +01:00
kaczmarczyck
3a5adfc5af Reworks the README (#659)
* Reworks the README

Takes over content from the archived 2.0 branch. Some of it will need
another update after forking off 2.1.

Fixes #391 and replaces #652.

* Rewording README
2023-11-08 16:59:49 +01:00
kaczmarczyck
09a6b3ce1a Updates the metadata to MDS 3 (#655) 2023-11-08 00:45:39 +01:00
kaczmarczyck
778102712f venv for Python setup (#653)
* Python uses venv

* Small fixes to python calls
2023-11-07 05:13:21 +01:00
kaczmarczyck
67e3d46291 Cleans up warnings, unused functions and features (#643) 2023-08-14 13:59:54 +02:00
kaczmarczyck
8a53986961 CBOR API changes (#639)
* adds extract_* functions to CBOR library

* hides Value implementation details

* CBOR API fixes

* README adapted to API changes
2023-08-11 17:28:59 +02:00
kaczmarczyck
87f0711284 New key wrapping API (#642)
* New key wrapping API

Allows key wrapping to be different between persistent and server-side
storage.

To accomplish this, the PrivateKey now always stores the fully
reconstructed key, and has different methods to serialize it for the
respective use case.

* Cleans up legacy credential parsing

This is a backwards incompatible change. This PR already introduces
backwards incompatible new credential parsing, and therefore we can also
remove all other legacy parsing.

* Correct credential minimum size

* wider public interface to allow custom PrivateKey construction
2023-08-10 14:20:39 +02:00
Zach Halvorsen
96af5e81a5 Add more transparency into some EC structures. (#641)
This adds the ability to create ECDH keys from raw bytes and export
signatures as raw bytes.
2023-08-09 17:48:05 +02:00
Jean-Michel Picod
e3d2e7d778 Fix USB enumeration on OS X (#640)
Hopefully without breaking the others.

Summary of the changes:
- Device descriptor reports the device is bus powered and requires
  100mA max.
- HID descriptor version bumped to 1.11 (was 1.10)
- Added string index for Interface and HID descriptors (which seems to
  make OS X happy)
2023-07-26 14:21:55 +02:00
Zach Halvorsen
8868752e37 Remove duplicated alarm syscall. (#636)
The alarm syscall is implemented in libtock-rs, but was duplicated here.
This removes the duplicated code and changes the references to point to
libtock-rs directly.

Co-authored-by: kaczmarczyck <43844792+kaczmarczyck@users.noreply.github.com>
2023-07-11 17:42:50 +02:00
Zach Halvorsen
a274a512f7 Add ability to get more storage information. (#637)
This adds parameters to the storage location syscalls to specify which
storage location to get the address and size for.
2023-06-29 19:46:36 +02:00
kaczmarczyck
f0e87ee813 resolves old TODO unlocked by new compiler and spec (#634) 2023-06-13 15:31:54 +02:00
kaczmarczyck
3813cacea7 moves storage syscalls to libtock-drivers (#633) 2023-06-12 23:50:10 +02:00
kaczmarczyck
e9ea05f888 fixes new clippy lints (#632) 2023-06-12 11:11:00 +02:00
kaczmarczyck
55f7e47423 Only requires enabling EP when the command exists (#630) 2023-05-10 13:27:13 +02:00
kaczmarczyck
fbf07d7476 Fixes credProtect checking in CTAP1 (#629)
We accidentally lost this check in #516. I refactored some of the
filters for better style.

The actual difference in logic is just one line in CTAP1 authenticate,
everything else is style, a test and the order in which we convert and
filter the credentials:

```
let credential_source = filter_listed_credential(credential_source, false)
            .ok_or(Ctap1StatusCode::SW_WRONG_DATA)?;
```
2023-05-09 22:44:29 +02:00
kaczmarczyck
6fb7e194eb Compile flag for AuthenticatorConfig (#628)
* Adds a compile flag for AuthenticatorConfig

The command can be disabled for authenticators that don't want users to
change their configuration.

* adds tool for calling Config

* std now implies config_command

* removes obsolete comment
2023-05-08 15:45:32 +02:00
kaczmarczyck
94b0beed4b macos-latest for GitHub workflows (#626)
Workflows stopped running since we were on old MacOS versions. Using
latest should fix this longer-term.
2023-05-07 04:36:13 +02:00
kaczmarczyck
99f81adc55 RustCrypto in TockEnv (#625)
* Adds a rust_crypto feature to Tock

* -O3 for RustCrypto
2023-05-05 22:38:56 +02:00
kaczmarczyck
cae2088f36 Credential wrapping in Env (#624)
* Moves credential wrapping to Env

* visibility of constants

* moves PrivateKey to api

* fixes docs and imports
2023-05-05 17:09:31 +02:00
kaczmarczyck
f25cdd6acc Tock V2 port - rebased and updated (#620)
* Changes from #580

* fixes USB cancel panic

* style fixes

* Update src/env/tock/storage.rs

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

---------

Co-authored-by: Zach Halvorsen <zhalvorsen@google.com>
2023-05-05 09:55:16 +02:00
kaczmarczyck
645c1ba3a7 Vendor Command + HID fix (#618)
* Fixes CBOR message passing through Vendor HID

I did all my tests on hardware with this fix, and now I'm surprised that
it didn't end up on develop. So should have been part of a former PR.

* vendor channel test

* forward vendor HID correctly for upgrades

* fixes cargo fmt

* removes script and updates documentation to match
2023-04-26 14:59:22 +02:00
kaczmarczyck
bcd382e5e9 Moves CTAP secrets to the key store (#617)
The PIN hash can be encrypted and decrypted, and CredRandom is part of
the master secrets.
2023-04-21 16:32:58 +02:00
kaczmarczyck
a88a1b2a22 Adds a hardware failure state for user presence (#616)
Introduced in https://github.com/google/OpenSK/pull/580

The conversion to libtock's ErrorCode has to happen outside of the
library.
2023-04-21 08:03:46 +02:00
kaczmarczyck
5f7eb3177b Cryptographic Secret type (#615)
* Adds a type for cryptographic secrets

* default implementations and zeroize documentation

* removes whitespace
2023-04-19 18:02:48 +02:00
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