Skip to content

Commit a4a4204

Browse files
Replace trussed-rsa-alloc dependency with trussed-rsa-types
trussed-rsa-alloc is only required if both the rsa and the virt feature are enabled. We cannot express this currently, but always pulling it in for the virt feature should be fine too.
1 parent 12b320b commit a4a4204

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
[Unreleased]: https://github.com/trussed-dev/piv-authenticator/compare/v0.5.3...HEAD
66

7-
-
7+
- Replace `trussed-rsa-alloc` dependency with `trussed-rsa-types` for most use cases.
8+
(Only the `virt` feature still requires `trussed-rsa-alloc`.)
89

910
## [v0.5.3][] (2025-07-31)
1011

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ heapless-bytes = "0.3.0"
3030
subtle = { version = "2", default-features = false }
3131
# TODO: only enable rsa features when needed
3232
trussed-core = { version = "0.1.0-rc.1", features = ["aes256-cbc", "chacha8-poly1305", "crypto-client", "ed255", "filesystem-client", "p256", "p384", "rsa2048", "rsa3072", "rsa4096", "shared-secret", "tdes", "x255"] }
33+
trussed-rsa-types = { version = "0.1", optional = true }
3334
trussed-rsa-alloc = { version = "0.3", features = ["raw"], optional = true }
3435
trussed-chunked = "0.2.0"
3536
trussed-hpke = "0.2.0"
@@ -64,11 +65,11 @@ apdu-dispatch = ["dep:apdu-app"]
6465
strict-pin = []
6566
std = []
6667
vpicc = ["std", "dep:vpicc", "virt", "dep:trussed-auth-backend"]
67-
virt = ["std", "trussed/virt", "dep:trussed-staging", "dep:trussed-auth-backend"]
68+
virt = ["std", "trussed/virt", "dep:trussed-staging", "dep:trussed-auth-backend", "dep:trussed-rsa-alloc"]
6869
pivy-tests = []
6970
opensc-tests = []
7071
alloc = []
71-
rsa = ["trussed-rsa-alloc", "alloc"]
72+
rsa = ["dep:trussed-rsa-types", "alloc"]
7273
delog = ["dep:delog"]
7374

7475
log-all = []

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -935,7 +935,7 @@ impl<T: Client> LoadedAuthenticator<'_, T> {
935935
AsymmetricAlgorithms::Rsa2048
936936
| AsymmetricAlgorithms::Rsa3072
937937
| AsymmetricAlgorithms::Rsa4096 => {
938-
use trussed_rsa_alloc::RsaPublicParts;
938+
use trussed_rsa_types::RsaPublicParts;
939939
reply.expand(&[0x7F, 0x49])?;
940940
let offset = reply.len();
941941
let tmp = syscall!(self.trussed.serialize_key(
@@ -1088,7 +1088,7 @@ impl<T: Client> LoadedAuthenticator<'_, T> {
10881088
| AsymmetricAlgorithms::Rsa4096,
10891089
AsymmetricKeyReference::PivAuthentication,
10901090
) => {
1091-
use trussed_rsa_alloc::RsaImportFormat;
1091+
use trussed_rsa_types::RsaImportFormat;
10921092
let p = tlv::get_do(&[0x01], data).ok_or(Status::IncorrectDataParameter)?;
10931093
let q = tlv::get_do(&[0x02], data).ok_or(Status::IncorrectDataParameter)?;
10941094
let e = tlv::get_do(&[0x03], data).ok_or(Status::IncorrectDataParameter)?;

0 commit comments

Comments
 (0)