36 Commits

Author SHA1 Message Date
Sosthène Guédon
7fd09fc762 When factory-resetting the device, mark empty filesystems for reformatting 2025-04-28 16:41:33 +02:00
Robin Krahl
7922d67e96 Update trussed to use the simplified Store trait 2025-03-05 14:05:50 +01:00
Robin Krahl
91e1d88cb8 Update trussed 2025-03-03 15:35:21 +01:00
Robin Krahl
9355f70083 Remove unnecessary explicit lifetimes
This fixes a new clippy lint.
2025-01-06 17:40:55 +01:00
Robin Krahl
92191cdc13 Replace trussed dependency with trussed-core 2025-01-06 17:40:55 +01:00
Robin Krahl
53eba84d2c Update littlefs2 to v0.5.0 2024-10-25 11:21:43 +02:00
Robin Krahl
52ae72e003 Avoid unnecessary path allocations 2024-10-21 21:11:02 +02:00
Sosthène Guédon
e27ad91471 Add HPKE extension
This will be useful for PIV encryption, working together with
https://github.com/trussed-dev/trussed-auth/pull/41

This implements the standard HPKE from
[RFC 9180](https://www.rfc-editor.org/rfc/rfc9180.html). This uses a
custom implmentation instead of the `hpke` crate because this crate
seals the trait to implement custom ciphers, and we want to use
`ChaCha8` and not `ChaCha20`.

The implementation is tested against the RFC test vectors for
`ChaCha20`, and is made generic so that the same code can be used for
`ChaCha8` in the backend.

For ChaCha8Poly1305 AEAD ID, I used a custom `0xFFFE`, which is probably
unused. I need to look if there is somewhere someone already using
ChaCha8Poly1305 for HPKE and if there is a specified ID.
2024-10-17 21:25:33 +02:00
Sosthène Guédon
7b5ebb660f Add fsinfo to virt implementation 2024-07-24 17:21:42 +02:00
Sosthène Guédon
0a7c962a14 Add filesystem info extension and backend implementation 2024-07-24 16:06:29 +02:00
Sosthène Guédon
c5371af973 Fix CI 2024-07-24 16:05:41 +02:00
Robin Krahl
e016b25fbc Import HkdfExtension from Nitrokey/trussed-hkdf-backend
The HkdfExtension was previously maintained in a separate repository and
together with a custom backend.  Every additional backend adds some
overhead, both in the firmware and for maintenance.  Therefore this
patch moves the trussed-hkdf crate with the HkdfExtension as an
extension into this repository and implements it for the StagingBackend,
replacing the HkdfBackend.

This patch also releases trussed-hkdf v0.2.0 and trussed-staging v0.3.0.

Fixes: https://github.com/Nitrokey/trussed-hkdf-backend/issues/6
2024-03-25 13:14:12 +01:00
Robin Krahl
1a964539e6 Remove encrypted-chunked feature
This patch always enables the syscalls that previously were behind the
encrypted-chunked feature.  This makes sure that enabling the feature in
one crate does not break another crate that also depends on
trussed-chunked.  In practice, the feature is always enabled anyway so
separating the encrypted syscalls does not bring any benefits.

Fixes: https://github.com/trussed-dev/trussed-staging/issues/20
2024-03-15 11:10:42 +01:00
Robin Krahl
06bf42cfd6 Extract extensions into crates
Previously, this repository contained one crate with all extension
definitions and the backend implementation.  This is problematic if
semantic versioning is used as a breaking change in the backend or in a
single extension would also affect all users of any other extension.

This patch moves the extensions into separate crates that can be
versioned independently so that clients only have to depend on the
extension crates they really need.

Fixes: https://github.com/trussed-dev/trussed-staging/issues/3
2024-03-15 10:53:13 +01:00
Sosthène Guédon
f2cfa2ea24 Fix compilation with virt and no-default-features 2024-03-05 10:58:22 +01:00
Sosthène Guédon
05ac73b44a Fix clippy warnings 2024-02-16 10:25:00 +01:00
Robin Krahl
6687f0a28f Use DynFilesystem trait 2023-12-15 22:03:46 +01:00
Robin Krahl
818adfce28 chunked: Add AppendFile syscall 2023-11-23 12:37:36 +01:00
Robin Krahl
a059198b2b chunked: Add PartialReadFile syscall 2023-11-23 10:12:37 +01:00
Sosthène Guédon
59dda984e4 Fix visibility of FactoryResetClientRequest field 2023-11-16 14:33:22 +01:00
Sosthène Guédon
26978b28cf Fix clippy warnings and compilation 2023-11-09 16:52:59 +01:00
Sosthène Guédon
24c4601258 Move manage/mod.rs -> manage.rs 2023-11-09 16:16:57 +01:00
Sosthène Guédon
df6d9c5198 Add tests and document format for should_preserve function 2023-11-09 16:13:08 +01:00
Sosthène Guédon
489400644f Improve factory reset preservation logic 2023-11-09 10:56:02 +01:00
Sosthène Guédon
bfde40403c Add manage extension 2023-11-09 10:28:52 +01:00