Commit 66b4caac authored by Fabio Utzig's avatar Fabio Utzig Committed by Fabio Utzig
Browse files

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

Signed-off-by: default avatarFabio Utzig <utzig@apache.org>
parent 729139f8
Loading
Loading
Loading
Loading
+4 −1
Changes for sim/src/image.rs: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -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() {
+10 −0
Changes for sim/src/tlv.rs: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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 {