From 45e2a1160f93a04f8741b9c31c3b8a6422824d62 Mon Sep 17 00:00:00 2001 From: GroM Date: Thu, 10 Oct 2024 11:31:14 +0200 Subject: [PATCH 1/2] Add assert to check heap_size --- ledger_secure_sdk_sys/build.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ledger_secure_sdk_sys/build.rs b/ledger_secure_sdk_sys/build.rs index 801efe87..8247fb95 100644 --- a/ledger_secure_sdk_sys/build.rs +++ b/ledger_secure_sdk_sys/build.rs @@ -600,6 +600,14 @@ impl SDKBuilder { // Read the HEAP_SIZE environment variable, default to 8192 if not set let heap_size = env::var("HEAP_SIZE").unwrap_or_else(|_| "8192".to_string()); + assert!( + match heap_size.as_str() { + "2048" | "4096" | "8192" | "16384" | "24576" => true, + _ => false, + }, + "Invalid heap size: {heap_size}; Authorized sizes are 2048, 4096, 8192, 16384, 24576" + ); + // Generate the heap_size.rs file with the HEAP_SIZE value let out_dir = env::var("OUT_DIR").unwrap(); let dest_path = Path::new(&out_dir).join("heap_size.rs"); From 337973cefed6ed37f9419aea1f938f15a908bea1 Mon Sep 17 00:00:00 2001 From: GroM Date: Thu, 10 Oct 2024 11:32:57 +0200 Subject: [PATCH 2/2] Bump versions --- Cargo.lock | 4 ++-- ledger_device_sdk/Cargo.toml | 4 ++-- ledger_secure_sdk_sys/Cargo.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 80638b94..2d32383e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -474,7 +474,7 @@ checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] name = "ledger_device_sdk" -version = "1.17.3" +version = "1.17.4" dependencies = [ "const-zero", "include_gif", @@ -489,7 +489,7 @@ dependencies = [ [[package]] name = "ledger_secure_sdk_sys" -version = "1.5.0" +version = "1.5.1" dependencies = [ "bindgen", "cc", diff --git a/ledger_device_sdk/Cargo.toml b/ledger_device_sdk/Cargo.toml index 4359453a..041d0008 100644 --- a/ledger_device_sdk/Cargo.toml +++ b/ledger_device_sdk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ledger_device_sdk" -version = "1.17.3" +version = "1.17.4" authors = ["yhql", "yogh333", "agrojean-ledger", "kingofpayne"] edition = "2021" license.workspace = true @@ -21,7 +21,7 @@ rand_core = { version = "0.6.3", default_features = false } zeroize = { version = "1.6.0", default_features = false } numtoa = "0.2.4" const-zero = "0.1.1" -ledger_secure_sdk_sys = { path = "../ledger_secure_sdk_sys", version = "1.5.0" } +ledger_secure_sdk_sys = { path = "../ledger_secure_sdk_sys", version = "1.5.1" } [features] speculos = [] diff --git a/ledger_secure_sdk_sys/Cargo.toml b/ledger_secure_sdk_sys/Cargo.toml index c9315344..66bf066b 100644 --- a/ledger_secure_sdk_sys/Cargo.toml +++ b/ledger_secure_sdk_sys/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ledger_secure_sdk_sys" -version = "1.5.0" +version = "1.5.1" authors = ["yhql", "agrojean-ledger"] edition = "2021" license.workspace = true