sim: allow generation of non-signed + encrypted EC images

Signed-off-by: Fabio Utzig <utzig@apache.org>
This commit is contained in:
Fabio Utzig 2020-01-04 20:19:28 -03:00 committed by Fabio Utzig
parent 729139f80f
commit 66b4caac45
2 changed files with 15 additions and 2 deletions

View File

@ -1267,8 +1267,11 @@ fn make_tlv() -> TlvGen {
TlvGen::new_enc_rsa()
}
} else if Caps::EncEc256.present() {
//FIXME: should fail with RSA signature?
if Caps::EcdsaP256.present() {
TlvGen::new_ecdsa_ecies_p256()
} else {
TlvGen::new_ecies_p256()
}
} else {
// The non-encrypted configuration.
if Caps::RSA2048.present() {

View File

@ -214,6 +214,16 @@ impl TlvGen {
}
}
#[allow(dead_code)]
pub fn new_ecies_p256() -> TlvGen {
TlvGen {
flags: TlvFlags::ENCRYPTED as u32,
kinds: vec![TlvKinds::SHA256, TlvKinds::ENCEC256],
size: 4 + 32 + 4 + 32 + 4 + 113,
..Default::default()
}
}
#[allow(dead_code)]
pub fn new_ecdsa_ecies_p256() -> TlvGen {
TlvGen {