Commit Graph
320 Commits
Author SHA1 Message Date
Sosthène Guédon 9aad0641ac Delete all empty parent directories if they are empty
This saves a lot of memory since each directory takes at least one block
We are starting to see this as an issue because the filesystems are now
much deeper due to the SE050
2024-12-11 18:02:55 +01:00
sosthene-nitrokey a39c6705f5 Merge pull request #45 from trussed-dev/main
Add secp256k1 to mechanism enum
2024-10-28 16:18:04 +01:00
Sosthène Guédon ccbbe3b39e Add secp256k1 to mechanism enum 2024-10-28 16:13:26 +01:00
Robin Krahl 92dd7f010e Merge branch 'main' into nitrokey-main 2024-10-25 11:11:04 +02:00
Robin Krahl 046478b7a4 Update littlefs2 to v0.5.0 2024-10-25 11:06:51 +02:00
Robin Krahl 1a54da2482 Avoid unnecessary path allocation 2024-10-24 20:02:18 +02:00
Robin Krahl 629ecb1bcc types: Add Id::hex_path helper function 2024-10-24 20:02:17 +02:00
Robin Krahl 6a7c43835c store: Use DynFilesystem::create_dir_all
Instead of re-implementing the same functionality in Trussed, use the
DynFilesystem::create_dir_all implementation from littlefs2.
2024-10-24 20:02:17 +02:00
Robin Krahl be5fa72073 Merge remote-tracking branch 'upstream/main' into nitrokey-main 2024-10-24 19:16:00 +02:00
Robin Krahl 721d1eb5b6 Update cbor-smol to v0.5.0 2024-10-22 14:27:20 +02:00
Robin Krahl a566b63586 Remove unused code 2024-08-13 15:44:16 +02:00
Sosthène Guédon 7b065dd316 Remove old unused types
These types are here from the first commit of trussed and are never used
2024-08-06 10:04:13 +02:00
Sosthène Guédon 732877eaba Remove unused Extensions struct
This structure is meant to be used with the attestation feature,
It is therefore unused, and unuseable due to a missing contructor and
being commented out in the `TbsCertificate` struct

If needed we can add it back in the future.
2024-08-06 10:04:13 +02:00
Sosthène Guédon d26a9a74e7 Remove doc warning 2024-08-06 10:04:13 +02:00
Sosthène Guédon 329d77d610 Remove cfg semihosting feature reference 2024-08-06 10:04:13 +02:00
Sosthène Guédon 3e031006df key deletion: delete first the faster volatile storage and test public keys first
Most key deletions are for volatile public keys (temporary keys for FIDO pin protocol, PIN keys from trussed-auth etc...).
In any cases, persistent keys are more rarely deleted, and volatile is the fastest storage,
so it being first is overall a performance improvement.

I think long term (once we have the builder-pattern based syscall implementation maybe?)
we should add optional location and secrecy arguments to the syscall. It is rare that the caller
would not know the kind of key it is deleting.
2024-08-05 14:00:34 +02:00
sosthene-nitrokey 66e8fa7293 Merge pull request #43 from trussed-dev/main
Merge Upstream Trussed
2024-07-31 11:58:05 +02:00
Sosthène Guédon 8b8beee0fa Add brainpool mechanisms 2024-07-26 15:25:40 +02:00
Sosthène Guédon 07fe70ab75 Add p384 and p521 tests to CI 2024-07-26 15:25:40 +02:00
Sosthène Guédon 31095c519c Fix clippy warnings 2024-07-26 15:25:40 +02:00
Sosthène Guédon 85972abcb7 Add support for p384 and p521 nist curves 2024-07-26 15:25:40 +02:00
sosthene-nitrokey 40e312859a Merge pull request #41 from trussed-dev/main
Merge upstream
2024-06-07 11:06:16 +02:00
sosthene-nitrokey 720006dd16 Merge pull request #42 from Nitrokey/fix-clippy-warnings
Fix warning
2024-06-07 11:02:13 +02:00
Sosthène Guédon c12172b804 Fix warning 2024-06-07 10:16:23 +02:00
Sosthène Guédon a055e4f79a Service: add (mut) getter for the dispatcher 2024-06-06 09:10:19 +02:00
Robin Krahl 5eed121ce9 derive: Add no_core option to ExtensionDispatch
This patch adds an option to skip a backend when dispatching core
requests.
2024-05-17 10:16:50 +02:00
Robin Krahl fb842e8ab0 derive: Add skip option to ExtensionDispatch
This patch adds a skip option to the ExtensionDispatch macro that makes
it possible to ignore some fields.
2024-05-17 10:16:50 +02:00
Robin Krahl b1e18041fd derive: Add delegate_to option for ExtensionDispatch
This patch adds a delegate_to option to the ExtensionDispatch derive
macro that makes it possible to create an alias for a backend using a
different set of extensions.  To avoid misunderstandings, delegating
backends are forced to use the unit type ().
2024-05-17 10:16:45 +02:00
Sosthène Guédon bfae7c1eca Fix p256 tests not running
The p256 tests were not running due to a typo
2024-04-19 11:47:43 +02:00
Sosthène Guédon 2e7dd7c30b Merge branch 'trussed-main' 2024-04-04 16:34:00 +02:00
Robin Krahl 83cf940ac4 Reduce wildcard imports
This patch removes some wildcard imports to make the dependencies
between modules clearer and to refactoring easier.
2024-04-03 22:28:03 +02:00
Robin Krahl 20b0acb958 Remove unnecessary qualifications 2024-04-03 21:48:41 +02:00
Robin Krahl 667d60c019 Add OptionalBackend wrapper
Backends can be activated at runtime depending on the configuration or
execution environment.  This patch adds an OptionalBackend wrapper that
implements Backend and ExtensionImpl but returns a RequestNotAvailable
error if the inner backend is not set.
2024-04-02 16:16:09 +02:00
Sosthène Guédon b548d379dc Remove serde-cbor dependency 2024-03-28 17:54:12 +01:00
Sosthène Guédon 06d0c6fc47 not_before: introduce enum to clarify API 2024-03-28 16:47:20 +01:00
Sosthène Guédon 2950600ad5 read_dir_first: stop at the first file that is alphabetically "after" not_before
In fido-authenticator, if we change the paths of RK  to be:
"rp_id.rk_id" instead of the current "rp_id/rk_id", we still want to be able
to iterate over the keys even though we only  know the "rp_id" and not the
"rk_id". Therefore we need to be able to stop at "rp_id.***" when giving "rp_id" in `not_before`

This is technically a breaking change because now, given the files:

- "aaa"
- "aaabbb"

 "read_dir_first"  with "aaa" as `not_before` would only yield "aaa"
due to https://github.com/littlefs-project/littlefs/issues/923.
Now this will yield both files, and yield "aaabbb" first.

I beleive this behaviour is technically more correct as it is likely what
would be expected to be yield expecting alphabetical order
(though the order of the entries is still incorrect).
2024-03-28 16:47:20 +01:00
Sosthène Guédon 2fbe0c9504 Fix pipeline
We will want to get rid of the static mut altogether,
But that will be done when moving to Rust 2024. For now just fix the CI
2024-03-28 16:16:05 +01:00
Sosthène Guédon 2d0e667087 ClientFilestore: make the dat folder optional 2024-03-28 15:40:52 +01:00
Robin Krahl 9ca8866d05 derive: Allow multiple extensions attributes for ExtensionDispatch
This makes it easier to select the supported extensions using
conditional compilation (cfg_attr).
2024-03-25 14:07:36 +01:00
Robin Krahl 594c23586c derive: Add ExtensionId derive macro
This patch adds the ExtensionId derive macro to trussed-derive that
implements From<T> for u8 and TryFrom<u8> for T.
2024-03-25 14:07:35 +01:00
Robin Krahl de219205f0 derive: Make extensions optional for backends in ExtensionDispatch
Backends may only implement core requests and no extensions, therefore
the extensions attribute should not be required for backends.
2024-03-25 14:07:35 +01:00
Robin Krahl 2d7f632197 Add derive macros for Dispatch, ExtensionDispatch
This patch adds a new derive crate that can be used to derive
implementations of the trussed::backend::Dispatch and
trussed::serde_extensions::ExtensionDispatch traits.
2024-03-25 14:07:35 +01:00
Robin Krahl 8b52bcafe9 Fix serde-cbor dependency 2024-03-21 10:28:47 +01:00
Robin Krahl cb7bd32854 Merge pull request #37 from trussed-dev/main
Merge upstream changes
2024-03-04 10:47:04 +01:00
Robin Krahl cff2e66384 Use nonce as IV for Aes256Cbc mechanism 2024-03-01 17:24:49 +01:00
Robin Krahl 6492abafb6 Add nonce to wrap_key and unwrap_key syscalls
This patch adds a nonce argument to the wrap_key and unwrap_key syscalls
to be able to use the Aes256Cbc mechanism with a non-zero IV in the
future.
2024-03-01 17:20:22 +01:00
Sosthène Guédon 2a2b209159 Add must_use attributes on futures.
Prior to that there would be no warning when forgetting to use `(try_)syscall`.
2024-02-21 12:01:40 +01:00
Sosthène Guédon 7f4e12db5a Fix clippy warnings 2024-02-21 11:44:42 +01:00
Sosthène Guédon 1012a9beb5 Run cargo fmt
Older version of Rust failed to format `service.rs` file.
2024-02-21 11:44:42 +01:00
sosthene-nitrokey 2583e099b8 Merge pull request #32 from Nitrokey/fmt
Run cargo fmt
2024-02-02 09:01:25 +01:00