From 38114b5cd983113eb61c9458890757ef8482cb8f Mon Sep 17 00:00:00 2001 From: bunnie Date: Tue, 15 Feb 2022 22:24:03 +0800 Subject: [PATCH] add a facility to dump keys for Renode integration (or to steal keys if you can patch the firmware) the code is commented out so it's not accidentally compiled in. --- services/root-keys/src/implementation.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/root-keys/src/implementation.rs b/services/root-keys/src/implementation.rs index d4654ac34..57a60d5a1 100644 --- a/services/root-keys/src/implementation.rs +++ b/services/root-keys/src/implementation.rs @@ -266,6 +266,13 @@ impl<'a> RootKeys { jtag, fake_key, }; + /* + // dumps the key enclave -- in a format for Renode integration. Or if you just wanted to steal all the keys. + // PS: you still need to know the passwords to decrypt the keys + for i in 0..256 { + keys.keyrom.wfo(utra::keyrom::ADDRESS_ADDRESS, i); + log::info!("this.data[0x{:x}] = 0x{:x};", i, keys.keyrom.rf(utra::keyrom::DATA_DATA)); + } */ keys }