trussed-dev / trussed

Modern Cryptographic Firmware
https://trussed.dev
Apache License 2.0
405 stars 26 forks source link

virt: Add possiblity to run with multiple clients #137

Closed sosthene-nitrokey closed 10 months ago

sosthene-nitrokey commented 10 months ago

Motivated by testing: https://github.com/trussed-dev/trussed-staging/pull/11

Example of what is allowed by this PR:

with_ram_clients(["client1", "client2"], |[mut client1, mut client2]| {
    let key = syscall!(client1.generate_ed255_private_key(Location::Internal)).key;
    // The clients are distinct
    assert!(!syscall!(client2.exists(Mechanism::Ed255, key)).exists);
})    
sosthene-nitrokey commented 10 months ago

Based on #137 for trussed-staging.