sim: Add RSA signature verification to simulator
Using the published debug keypair, generate a signature with it, to add
to the TLV. This verifies that signature verification works as
expected.
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/sim/src/main.rs b/sim/src/main.rs
index 89be7ff..acd15a9 100644
--- a/sim/src/main.rs
+++ b/sim/src/main.rs
@@ -4,9 +4,11 @@
#[macro_use] extern crate bitflags;
extern crate docopt;
extern crate libc;
+extern crate pem;
extern crate rand;
extern crate rustc_serialize;
extern crate simflash;
+extern crate untrusted;
use docopt::Docopt;
use rand::{Rng, SeedableRng, XorShiftRng};
@@ -601,7 +603,7 @@
fn install_image(flash: &mut Flash, offset: usize, len: usize) -> Vec<u8> {
let offset0 = offset;
- let mut tlv = TlvGen::new_hash_only();
+ let mut tlv = TlvGen::new_rsa_pss();
// Generate a boot header. Note that the size doesn't include the header.
let header = ImageHeader {