mirror of
https://github.com/trussed-dev/trussed-rsa-backend.git
synced 2026-06-20 04:16:22 -07:00
This fixes a clippy warning from a new lint introduced in 1.70.0 and a rustdoc warning.
27 lines
917 B
Rust
27 lines
917 B
Rust
// Copyright (C) Nitrokey GmbH
|
|
// SPDX-License-Identifier: Apache-2.0 or MIT
|
|
|
|
#![cfg(feature = "virt")]
|
|
|
|
//! 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_rsa_alloc::virt;
|
|
|
|
#[test]
|
|
fn certificate_client() {
|
|
virt::with_ram_client("rsa test", |mut client| {
|
|
let fake_der = &[1u8, 2, 3];
|
|
let id = syscall!(client.write_certificate(Volatile, fake_der)).id;
|
|
|
|
let loaded_der = syscall!(client.read_certificate(id)).der;
|
|
assert_eq!(loaded_der, fake_der);
|
|
|
|
assert!(try_syscall!(client.read_certificate(id)).is_ok());
|
|
assert!(try_syscall!(client.delete_certificate(id)).is_ok());
|
|
assert!(try_syscall!(client.read_certificate(id)).is_err());
|
|
assert!(try_syscall!(client.delete_certificate(id)).is_err());
|
|
});
|
|
}
|