sim: allow generation of non-signed + encrypted EC images
Signed-off-by: Fabio Utzig <utzig@apache.org>
This commit is contained in:
parent
729139f80f
commit
66b4caac45
|
@ -1267,8 +1267,11 @@ fn make_tlv() -> TlvGen {
|
|||
TlvGen::new_enc_rsa()
|
||||
}
|
||||
} else if Caps::EncEc256.present() {
|
||||
//FIXME: should fail with RSA signature?
|
||||
TlvGen::new_ecdsa_ecies_p256()
|
||||
if Caps::EcdsaP256.present() {
|
||||
TlvGen::new_ecdsa_ecies_p256()
|
||||
} else {
|
||||
TlvGen::new_ecies_p256()
|
||||
}
|
||||
} else {
|
||||
// The non-encrypted configuration.
|
||||
if Caps::RSA2048.present() {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue