Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check_csdk_build_parameters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
check_csdk_build_parameters:
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
image: jcaporossi/test-devtools:latest
strategy:
matrix:
target: ["nanox", "nanosplus", "stax", "flex", "apex_p"]
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
name: Run static analysis
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest
image: jcaporossi/test-devtools:latest
strategy:
matrix:
target: ["nanox", "nanosplus", "stax", "flex", "apex_p"]
Expand All @@ -35,7 +35,7 @@ jobs:
name: Check code formatting
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest
image: jcaporossi/test-devtools:latest
steps:
- name: Clone
uses: actions/checkout@v4
Expand All @@ -47,7 +47,7 @@ jobs:
name: Build SDK
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest
image: jcaporossi/test-devtools:latest
strategy:
matrix:
target: ["nanox", "nanosplus", "stax", "flex", "apex_p"]
Expand All @@ -66,7 +66,7 @@ jobs:
name: Run unit and integration tests
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest
image: jcaporossi/test-devtools:latest
strategy:
matrix:
target: ["nanox", "nanosplus", "stax", "flex", "apex_p"]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
contents: read
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-dev-tools:latest
image: jcaporossi/test-devtools:latest
steps:
- name: Clone
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable_build_all_apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
include: ${{ fromJSON(needs.retrieve-rust-apps.outputs.rust_apps) }}
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
image: jcaporossi/test-devtools:latest
steps:
- name: Install ledgered
run: pip install ledgered --break-system-packages
Expand Down
2 changes: 1 addition & 1 deletion ledger_device_sdk/src/ecc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ impl<const N: usize, const TY: char> ECPrivateKey<N, TY> {
/// [here](https://blog.rust-lang.org/inside-rust/2021/09/06/Splitting-const-generics.html#featuregeneric_const_exprs)
pub fn public_key(&self) -> Result<ECPublicKey<{ Self::P }, TY>, CxError>
where
[(); Self::P]:,
[(); Self::P]: Sized,
{
let mut pubkey = ECPublicKey::<{ Self::P }, TY>::new(self.curve);
let err = unsafe {
Expand Down
2 changes: 1 addition & 1 deletion ledger_device_sdk/src/io_legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ impl Comm {
G_ux_params.u.pairing_request.pairing_info_len = (_len - 2) as u32;
for i in 0..G_ux_params.u.pairing_request.pairing_info_len as usize {
G_ux_params.u.pairing_request.pairing_info[i as usize] =
seph_buffer[5 + i] as i8;
seph_buffer[5 + i] as core::ffi::c_char;
}
G_ux_params.u.pairing_request.pairing_info
[G_ux_params.u.pairing_request.pairing_info_len as usize] = 0;
Expand Down
13 changes: 8 additions & 5 deletions ledger_device_sdk/src/libcall/swap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ pub fn get_check_address_params<
}

debug_print("==> GET_REF_ADDRESS\n");
let (address, address_len) = read_c_string::<ADDRESS_BUF_SIZE>(params.address_to_check);
let (address, address_len) =
read_c_string::<ADDRESS_BUF_SIZE>(params.address_to_check as *const i8);
check_address_params.ref_address = address;
check_address_params.ref_address_len = address_len;

Expand Down Expand Up @@ -274,7 +275,7 @@ pub fn get_printable_amount_params<
debug_print("==> GET_AMOUNT_STR\n");
printable_amount_params.amount_str = unsafe {
&(*(libarg.__bindgen_anon_1.get_printable_amount as *mut get_printable_amount_parameters_t))
.printable_amount as *const i8 as *mut i8
.printable_amount as *const core::ffi::c_char as *mut i8
};

printable_amount_params
Expand Down Expand Up @@ -340,13 +341,15 @@ pub fn sign_tx_params<
}

debug_print("==> GET_DESTINATION_ADDRESS\n");
let (address, address_len) = read_c_string::<ADDRESS_BUF_SIZE>(params.destination_address);
let (address, address_len) =
read_c_string::<ADDRESS_BUF_SIZE>(params.destination_address as *const i8);
create_tx_params.dest_address = address;
create_tx_params.dest_address_len = address_len;

debug_print("==> GET_DESTINATION_ADDRESS_EXTRA_ID\n");
let (extra_id, extra_id_len) =
read_c_string::<ADDRESS_EXTRA_ID_BUF_SIZE>(params.destination_address_extra_id);
let (extra_id, extra_id_len) = read_c_string::<ADDRESS_EXTRA_ID_BUF_SIZE>(
params.destination_address_extra_id as *const i8,
);
create_tx_params.dest_address_extra_id = extra_id;
create_tx_params.dest_address_extra_id_len = extra_id_len;

Expand Down
4 changes: 2 additions & 2 deletions ledger_device_sdk/src/nbgl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ impl From<&Field<'_>> for CField {
impl From<&CField> for nbgl_contentTagValue_t {
fn from(field: &CField) -> nbgl_contentTagValue_t {
nbgl_contentTagValue_t {
item: (*field).name.as_ptr() as *const i8,
value: (*field).value.as_ptr() as *const i8,
item: (*field).name.as_ptr() as *const ::core::ffi::c_char,
value: (*field).value.as_ptr() as *const ::core::ffi::c_char,
..Default::default()
}
}
Expand Down
8 changes: 4 additions & 4 deletions ledger_device_sdk/src/nbgl/nbgl_advance_review.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,10 @@ impl<'a> NbglAdvanceReview<'a> {
let warning_details = match &self.warning_details_type {
Some(w) => nbgl_warning_t {
predefinedSet: (1u32 << W3C_RISK_DETECTED_WARN),
dAppProvider: w.dapp_provider_name.as_ptr() as *const i8,
reportUrl: w.report_url.as_ptr() as *const i8,
reportProvider: w.report_provider.as_ptr() as *const i8,
providerMessage: w.provider_message.as_ptr() as *const i8,
dAppProvider: w.dapp_provider_name.as_ptr() as *const ::core::ffi::c_char,
reportUrl: w.report_url.as_ptr() as *const ::core::ffi::c_char,
reportProvider: w.report_provider.as_ptr() as *const ::core::ffi::c_char,
providerMessage: w.provider_message.as_ptr() as *const ::core::ffi::c_char,
..Default::default()
},
None => nbgl_warning_t::default(),
Expand Down
4 changes: 2 additions & 2 deletions ledger_device_sdk/src/nbgl/nbgl_generic_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ impl NbglGenericSettings {
}

self.info_list = Some(nbgl_contentInfoList_t {
infoTypes: self.info.fields_ptr[..].as_ptr(),
infoContents: self.info.values_ptr[..].as_ptr(),
infoTypes: self.info.fields_ptr[..].as_ptr() as *const *const ::core::ffi::c_char,
infoContents: self.info.values_ptr[..].as_ptr() as *const *const ::core::ffi::c_char,
nbInfos: fields_values.len() as u8,
infoExtensions: core::ptr::null(),
token: 0,
Expand Down
4 changes: 2 additions & 2 deletions ledger_device_sdk/src/nbgl/nbgl_review.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ impl<'a> NbglReview<'a> {
let mut tag_value_array: Vec<nbgl_contentTagValue_t> = Vec::new();
for field in v.iter() {
let val = nbgl_contentTagValue_t {
item: field.name.as_ptr() as *const i8,
value: field.value.as_ptr() as *const i8,
item: field.name.as_ptr() as *const ::core::ffi::c_char,
value: field.value.as_ptr() as *const ::core::ffi::c_char,
..Default::default()
};
tag_value_array.push(val);
Expand Down
19 changes: 11 additions & 8 deletions ledger_device_sdk/src/nbgl/nbgl_streaming_review.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,13 @@ impl NbglStreamingReview {
Some(w) => {
let warning_details = nbgl_warning_t {
predefinedSet: (1u32 << W3C_RISK_DETECTED_WARN),
dAppProvider: w.dapp_provider_name.as_ptr() as *const i8,
reportUrl: w.report_url.as_ptr() as *const i8,
reportProvider: w.report_provider.as_ptr() as *const i8,
providerMessage: w.provider_message.as_ptr() as *const i8,
dAppProvider: w.dapp_provider_name.as_ptr()
as *const ::core::ffi::c_char,
reportUrl: w.report_url.as_ptr() as *const ::core::ffi::c_char,
reportProvider: w.report_provider.as_ptr()
as *const ::core::ffi::c_char,
providerMessage: w.provider_message.as_ptr()
as *const ::core::ffi::c_char,
..Default::default()
};
nbgl_useCaseAdvancedReviewStreamingStart(
Expand Down Expand Up @@ -218,8 +221,8 @@ impl NbglStreamingReview {
let mut tag_value_array: Vec<nbgl_contentTagValue_t> = Vec::new();
for field in v.iter() {
let val = nbgl_contentTagValue_t {
item: field.name.as_ptr() as *const i8,
value: field.value.as_ptr() as *const i8,
item: field.name.as_ptr() as *const ::core::ffi::c_char,
value: field.value.as_ptr() as *const ::core::ffi::c_char,
..Default::default()
};
tag_value_array.push(val);
Expand Down Expand Up @@ -271,8 +274,8 @@ impl NbglStreamingReview {
let mut tag_value_array: Vec<nbgl_contentTagValue_t> = Vec::new();
for field in v.iter() {
let val = nbgl_contentTagValue_t {
item: field.name.as_ptr() as *const i8,
value: field.value.as_ptr() as *const i8,
item: field.name.as_ptr() as *const ::core::ffi::c_char,
value: field.value.as_ptr() as *const ::core::ffi::c_char,
..Default::default()
};
tag_value_array.push(val);
Expand Down
3 changes: 2 additions & 1 deletion ledger_secure_sdk_sys/devices/apex_p/apex_p.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"linker": "link_wrap.sh",
"linker-flavor": "ld.lld",
"llvm-target": "thumbv8m.main-none-eabi",
"llvm-floatabi": "soft",
"max-atomic-width": 32,
"panic-strategy": "abort",
"pre-link-args": {
Expand All @@ -23,7 +24,7 @@
},
"relocation-model": "ropi-rwpi",
"singlethread": true,
"target-pointer-width": "32",
"target-pointer-width": 32,
"os": "apex_p",
"target-family": [ "bolos" ]
}
3 changes: 2 additions & 1 deletion ledger_secure_sdk_sys/devices/flex/flex.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"linker": "link_wrap.sh",
"linker-flavor": "ld.lld",
"llvm-target": "thumbv8m.main-none-eabi",
"llvm-floatabi": "soft",
"max-atomic-width": 32,
"panic-strategy": "abort",
"pre-link-args": {
Expand All @@ -23,7 +24,7 @@
},
"relocation-model": "ropi-rwpi",
"singlethread": true,
"target-pointer-width": "32",
"target-pointer-width": 32,
"os": "flex",
"target-family": [ "bolos" ]
}
3 changes: 2 additions & 1 deletion ledger_secure_sdk_sys/devices/nanosplus/nanosplus.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"linker": "link_wrap.sh",
"linker-flavor": "ld.lld",
"llvm-target": "thumbv8m.main-none-eabi",
"llvm-floatabi": "soft",
"max-atomic-width": 32,
"panic-strategy": "abort",
"pre-link-args": {
Expand All @@ -23,7 +24,7 @@
},
"relocation-model": "ropi-rwpi",
"singlethread": true,
"target-pointer-width": "32",
"target-pointer-width": 32,
"os": "nanosplus",
"target-family": [ "bolos" ]
}
3 changes: 2 additions & 1 deletion ledger_secure_sdk_sys/devices/nanox/nanox.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"linker": "link_wrap.sh",
"linker-flavor": "ld.lld",
"llvm-target": "thumbv6m-none-eabi",
"llvm-floatabi": "soft",
"panic-strategy": "abort",
"pre-link-args": {
"ld.lld": [
Expand All @@ -23,7 +24,7 @@
},
"relocation-model": "ropi-rwpi",
"singlethread": true,
"target-pointer-width": "32",
"target-pointer-width": 32,
"os": "nanox",
"target-family": [ "bolos" ]
}
3 changes: 2 additions & 1 deletion ledger_secure_sdk_sys/devices/stax/stax.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"linker": "link_wrap.sh",
"linker-flavor": "ld.lld",
"llvm-target": "thumbv8m.main-none-eabi",
"llvm-floatabi": "soft",
"max-atomic-width": 32,
"panic-strategy": "abort",
"pre-link-args": {
Expand All @@ -23,7 +24,7 @@
},
"relocation-model": "ropi-rwpi",
"singlethread": true,
"target-pointer-width": "32",
"target-pointer-width": 32,
"os": "stax",
"target-family": [ "bolos" ]
}
1 change: 1 addition & 0 deletions ledger_secure_sdk_sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(unnecessary_transmutes)]

use core::ffi::c_void;
#[cfg(all(feature = "heap"))]
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly-2024-12-01"
channel = "nightly-2025-10-24"
Loading