Commit 75c7c310 authored by Roland Mikhel's avatar Roland Mikhel Committed by Dávid Vincze
Browse files

sim: Remove P224 curve references



MCUBoot dropped P224 curve support as
there is little interest in using it.
The simulator threw an error as P224
was never supported, this was removed.

Signed-off-by: default avatarRoland Mikhel <roland.mikhel@arm.com>
Change-Id: I96011e9b00dbc3a6f7590db365a5f480d85394e1
parent 3d92a6cb
Loading
Loading
Loading
Loading
+18 −19
Original line number Original line Diff line number Diff line
// Copyright (c) 2017-2021 Linaro LTD
// Copyright (c) 2017-2021 Linaro LTD
// Copyright (c) 2019 JUUL Labs
// Copyright (c) 2019 JUUL Labs
// Copyright (c) 2019-2021 Arm Limited
// Copyright (c) 2019-2023 Arm Limited
//
//
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: Apache-2.0


@@ -11,23 +11,22 @@
#[allow(unused)]
#[allow(unused)]
pub enum Caps {
pub enum Caps {
    RSA2048              = (1 << 0),
    RSA2048              = (1 << 0),
    EcdsaP224            = (1 << 1),
    EcdsaP256            = (1 << 1),
    EcdsaP256            = (1 << 2),
    SwapUsingScratch     = (1 << 2),
    SwapUsingScratch     = (1 << 3),
    OverwriteUpgrade     = (1 << 3),
    OverwriteUpgrade     = (1 << 4),
    EncRsa               = (1 << 4),
    EncRsa               = (1 << 5),
    EncKw                = (1 << 5),
    EncKw                = (1 << 6),
    ValidatePrimarySlot  = (1 << 6),
    ValidatePrimarySlot  = (1 << 7),
    RSA3072              = (1 << 7),
    RSA3072              = (1 << 8),
    Ed25519              = (1 << 8),
    Ed25519              = (1 << 9),
    EncEc256             = (1 << 9),
    EncEc256             = (1 << 10),
    SwapUsingMove        = (1 << 10),
    SwapUsingMove        = (1 << 11),
    DowngradePrevention  = (1 << 11),
    DowngradePrevention  = (1 << 12),
    EncX25519            = (1 << 12),
    EncX25519            = (1 << 13),
    Bootstrap            = (1 << 13),
    Bootstrap            = (1 << 14),
    Aes256               = (1 << 14),
    Aes256               = (1 << 15),
    RamLoad              = (1 << 15),
    RamLoad              = (1 << 16),
    DirectXip            = (1 << 16),
    DirectXip            = (1 << 17),
}
}


impl Caps {
impl Caps {
@@ -38,7 +37,7 @@ impl Caps {


    /// Does this build have ECDSA of some type enabled for signatures.
    /// Does this build have ECDSA of some type enabled for signatures.
    pub fn has_ecdsa() -> bool {
    pub fn has_ecdsa() -> bool {
        Caps::EcdsaP256.present() || Caps::EcdsaP224.present()
        Caps::EcdsaP256.present()
    }
    }


    /// Query for the number of images that have been configured into this
    /// Query for the number of images that have been configured into this
+1 −4
Original line number Original line Diff line number Diff line
// Copyright (c) 2019-2021 Linaro LTD
// Copyright (c) 2019-2021 Linaro LTD
// Copyright (c) 2019-2020 JUUL Labs
// Copyright (c) 2019-2020 JUUL Labs
// Copyright (c) 2019-2021 Arm Limited
// Copyright (c) 2019-2023 Arm Limited
//
//
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: Apache-2.0


@@ -1853,9 +1853,6 @@ fn install_no_image() -> ImageData {
/// Construct a TLV generator based on how MCUboot is currently configured.  The returned
/// Construct a TLV generator based on how MCUboot is currently configured.  The returned
/// ManifestGen will generate the appropriate entries based on this configuration.
/// ManifestGen will generate the appropriate entries based on this configuration.
fn make_tlv() -> TlvGen {
fn make_tlv() -> TlvGen {
    if Caps::EcdsaP224.present() {
        panic!("Ecdsa P224 not supported in Simulator");
    }
    let aes_key_size = if Caps::Aes256.present() { 256 } else { 128 };
    let aes_key_size = if Caps::Aes256.present() { 256 } else { 128 };


    if Caps::EncKw.present() {
    if Caps::EncKw.present() {
+2 −4
Original line number Original line Diff line number Diff line
// Copyright (c) 2017-2021 Linaro LTD
// Copyright (c) 2017-2021 Linaro LTD
// Copyright (c) 2017-2020 JUUL Labs
// Copyright (c) 2017-2020 JUUL Labs
// Copyright (c) 2021 Arm Limited
// Copyright (c) 2021-2023 Arm Limited
//
//
// SPDX-License-Identifier: Apache-2.0
// SPDX-License-Identifier: Apache-2.0


@@ -51,7 +51,6 @@ pub enum TlvKinds {
    KEYHASH = 0x01,
    KEYHASH = 0x01,
    SHA256 = 0x10,
    SHA256 = 0x10,
    RSA2048 = 0x20,
    RSA2048 = 0x20,
    ECDSA224 = 0x21,
    ECDSA256 = 0x22,
    ECDSA256 = 0x22,
    RSA3072 = 0x23,
    RSA3072 = 0x23,
    ED25519 = 0x24,
    ED25519 = 0x24,
@@ -451,8 +450,7 @@ impl ManifestGen for TlvGen {
            // signature verification can be validated.
            // signature verification can be validated.
            let mut corrupt_hash = self.gen_corrupted;
            let mut corrupt_hash = self.gen_corrupted;
            for k in &[TlvKinds::RSA2048, TlvKinds::RSA3072,
            for k in &[TlvKinds::RSA2048, TlvKinds::RSA3072,
                TlvKinds::ECDSA224, TlvKinds::ECDSA256,
                TlvKinds::ECDSA256, TlvKinds::ED25519]
                TlvKinds::ED25519]
            {
            {
                if self.kinds.contains(k) {
                if self.kinds.contains(k) {
                    corrupt_hash = false;
                    corrupt_hash = false;