mirror of
https://github.com/trussed-dev/trussed-rsa-backend.git
synced 2026-06-20 04:16:22 -07:00
Update to trussed v0.2.0-rc.1
This commit is contained in:
+1
-1
@@ -9,7 +9,7 @@ SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
[Unreleased]: https://github.com/trussed-dev/trussed-rsa-backend/compare/v0.4.0...HEAD
|
||||
|
||||
-
|
||||
- Update to `trussed` v0.2.0-rc.1
|
||||
|
||||
## [v0.4.0][] (2026-03-23)
|
||||
|
||||
|
||||
+2
-3
@@ -31,7 +31,7 @@ delog = "0.1.6"
|
||||
num-bigint-dig = { version = "0.8.2", default-features = false }
|
||||
rsa = { version = "0.9", default-features = false, features = ["sha2"]}
|
||||
|
||||
trussed = { version = "0.1", default-features = false }
|
||||
trussed = { version = "=0.2.0-rc.1", default-features = false }
|
||||
trussed-core = { workspace = true, features = ["crypto-client", "rsa2048", "rsa3072", "rsa4096"] }
|
||||
trussed-rsa-types = "0.2"
|
||||
|
||||
@@ -42,7 +42,7 @@ delog = { version = "0.1.6", features = ["std-log"] }
|
||||
test-log = "0.2.11"
|
||||
env_logger = "0.10.0"
|
||||
rand = "0.8.5"
|
||||
trussed = { version = "0.1", default-features = false, features = ["certificate-client", "crypto-client"] }
|
||||
trussed = { version = "=0.2.0-rc.1", default-features = false, features = ["certificate-client", "crypto-client"] }
|
||||
|
||||
[features]
|
||||
virt = ["std", "trussed/virt"]
|
||||
@@ -60,7 +60,6 @@ log-warn = []
|
||||
log-error = []
|
||||
|
||||
[patch.crates-io]
|
||||
trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "0b65280d69be541b8771f7756139826332c7d674" }
|
||||
trussed-rsa-types.path = "types"
|
||||
|
||||
[profile.dev.package.rsa]
|
||||
|
||||
+6
-8
@@ -17,14 +17,12 @@ use rsa::{
|
||||
Pkcs1v15Sign, RsaPrivateKey, RsaPublicKey,
|
||||
};
|
||||
use trussed::{
|
||||
backend::Backend, key, platform::Platform, service::ServiceResources, store::Keystore,
|
||||
types::CoreContext,
|
||||
};
|
||||
use trussed_core::{
|
||||
api::{reply, request, Reply, Request},
|
||||
backend::Backend,
|
||||
key,
|
||||
platform::Platform,
|
||||
service::{Keystore, ServiceResources},
|
||||
types::{
|
||||
CoreContext, KeyId, KeySerialization, Mechanism, Message, Signature, SignatureSerialization,
|
||||
},
|
||||
types::{KeyId, KeySerialization, Mechanism, Message, Signature, SignatureSerialization},
|
||||
Error,
|
||||
};
|
||||
use trussed_rsa_types::{RsaImportFormat, RsaPublicParts};
|
||||
@@ -205,7 +203,7 @@ fn serialize_key(
|
||||
Error::InternalError
|
||||
})?
|
||||
}
|
||||
KeySerialization::Pkcs8Der => pub_key_der.into(),
|
||||
KeySerialization::Pkcs8Der => pub_key_der,
|
||||
_ => {
|
||||
return Err(Error::InvalidSerializationFormat);
|
||||
}
|
||||
|
||||
+2
-2
@@ -16,9 +16,9 @@ impl Dispatch for Dispatcher {
|
||||
&mut self,
|
||||
_backend: &Self::BackendId,
|
||||
ctx: &mut trussed::types::Context<Self::Context>,
|
||||
request: &trussed::api::Request,
|
||||
request: &trussed_core::api::Request,
|
||||
resources: &mut trussed::service::ServiceResources<P>,
|
||||
) -> Result<trussed::Reply, trussed::Error> {
|
||||
) -> Result<trussed_core::api::Reply, trussed_core::Error> {
|
||||
SoftwareRsa.request(&mut ctx.core, &mut ctx.backends, request, resources)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
//! Test that the core backend is still reachable.
|
||||
//! Tests imported from the trussed repo
|
||||
|
||||
use trussed::{client::CertificateClient as _, syscall, try_syscall, types::Location::*};
|
||||
use trussed_core::{syscall, try_syscall, types::Location::*, CertificateClient as _};
|
||||
use trussed_rsa_alloc::virt;
|
||||
|
||||
#[test]
|
||||
|
||||
+7
-8
@@ -5,12 +5,12 @@
|
||||
|
||||
use rsa::sha2::Sha256;
|
||||
use rsa::{traits::PublicKeyParts, Pkcs1v15Encrypt, Pkcs1v15Sign};
|
||||
use trussed::syscall;
|
||||
use trussed::types::KeyId;
|
||||
use trussed::types::KeySerialization;
|
||||
use trussed::types::Location::*;
|
||||
use trussed::types::Mechanism;
|
||||
use trussed::types::StorageAttributes;
|
||||
use trussed_core::syscall;
|
||||
use trussed_core::types::KeyId;
|
||||
use trussed_core::types::KeySerialization;
|
||||
use trussed_core::types::Location::*;
|
||||
use trussed_core::types::Mechanism;
|
||||
use trussed_core::types::StorageAttributes;
|
||||
use trussed_core::CryptoClient;
|
||||
|
||||
use trussed_rsa_alloc::*;
|
||||
@@ -47,8 +47,7 @@ fn rsa2048pkcs_derive_key() {
|
||||
fn rsa2048pkcs_exists_key() {
|
||||
virt::with_ram_client("rsa test", |mut client| {
|
||||
let sk = syscall!(client.generate_rsa2048pkcs_private_key(Internal)).key;
|
||||
let key_exists =
|
||||
syscall!(client.exists(trussed::types::Mechanism::Rsa2048Pkcs1v15, sk)).exists;
|
||||
let key_exists = syscall!(client.exists(Mechanism::Rsa2048Pkcs1v15, sk)).exists;
|
||||
|
||||
assert!(key_exists);
|
||||
})
|
||||
|
||||
+7
-8
@@ -5,12 +5,12 @@
|
||||
|
||||
use rsa::sha2::Sha384;
|
||||
use rsa::{traits::PublicKeyParts, Pkcs1v15Encrypt, Pkcs1v15Sign};
|
||||
use trussed::syscall;
|
||||
use trussed::types::KeyId;
|
||||
use trussed::types::KeySerialization;
|
||||
use trussed::types::Location::*;
|
||||
use trussed::types::Mechanism;
|
||||
use trussed::types::StorageAttributes;
|
||||
use trussed_core::syscall;
|
||||
use trussed_core::types::KeyId;
|
||||
use trussed_core::types::KeySerialization;
|
||||
use trussed_core::types::Location::*;
|
||||
use trussed_core::types::Mechanism;
|
||||
use trussed_core::types::StorageAttributes;
|
||||
use trussed_core::CryptoClient;
|
||||
|
||||
use trussed_rsa_alloc::*;
|
||||
@@ -47,8 +47,7 @@ fn rsa3072pkcs_derive_key() {
|
||||
fn rsa3072pkcs_exists_key() {
|
||||
virt::with_ram_client("rsa test", |mut client| {
|
||||
let sk = syscall!(client.generate_rsa3072pkcs_private_key(Internal)).key;
|
||||
let key_exists =
|
||||
syscall!(client.exists(trussed::types::Mechanism::Rsa3072Pkcs1v15, sk)).exists;
|
||||
let key_exists = syscall!(client.exists(Mechanism::Rsa3072Pkcs1v15, sk)).exists;
|
||||
|
||||
assert!(key_exists);
|
||||
})
|
||||
|
||||
+7
-8
@@ -5,12 +5,12 @@
|
||||
|
||||
use rsa::sha2::Sha512;
|
||||
use rsa::{traits::PublicKeyParts, Pkcs1v15Encrypt, Pkcs1v15Sign};
|
||||
use trussed::syscall;
|
||||
use trussed::types::KeyId;
|
||||
use trussed::types::KeySerialization;
|
||||
use trussed::types::Location::*;
|
||||
use trussed::types::Mechanism;
|
||||
use trussed::types::StorageAttributes;
|
||||
use trussed_core::syscall;
|
||||
use trussed_core::types::KeyId;
|
||||
use trussed_core::types::KeySerialization;
|
||||
use trussed_core::types::Location::*;
|
||||
use trussed_core::types::Mechanism;
|
||||
use trussed_core::types::StorageAttributes;
|
||||
use trussed_core::CryptoClient;
|
||||
|
||||
use trussed_rsa_alloc::*;
|
||||
@@ -47,8 +47,7 @@ fn rsa4096pkcs_derive_key() {
|
||||
fn rsa4096pkcs_exists_key() {
|
||||
virt::with_ram_client("rsa test", |mut client| {
|
||||
let sk = syscall!(client.generate_rsa4096pkcs_private_key(Internal)).key;
|
||||
let key_exists =
|
||||
syscall!(client.exists(trussed::types::Mechanism::Rsa4096Pkcs1v15, sk)).exists;
|
||||
let key_exists = syscall!(client.exists(Mechanism::Rsa4096Pkcs1v15, sk)).exists;
|
||||
|
||||
assert!(key_exists);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user