chore(core): don't return BLE address type to MicroPython
What changed, and why it matters
This commit removes extra Bluetooth address-type information from two Python-facing functions in the Trezor firmware. Previously, these functions returned both a 6-byte Bluetooth address and an integer indicating whether the address was public or random. Now they return only the 6-byte address. The change is described as a routine cleanup ('chore') with no changelog entry. There is no direct evidence in the commit that this fixes a security vulnerability; it appears to be an API simplification.
No immediate security action is warranted based on this commit alone. Treat as a normal API cleanup. If monitoring for Bluetooth privacy issues, verify downstream consumers no longer need address-type information and that removing it does not weaken pairing or bonding logic elsewhere in the firmware.
Security signals we found
API surface reduction: removes address-type integer from Bluetooth MicroPython bindings
No mention of vulnerability, CVE, security fix, or researcher attribution in commit message or diff
No changelog entry, consistent with routine cleanup
Change is limited to type signatures and object construction; no added bounds checks, validation, or memory protections
Evidence from the diff
The patch modifies core/embed/rust/src/trezorhal/ble/micropython.rs and its generated mock. py_connected_addr() now returns only addr_bytes (bytes of length 6) instead of a tuple (addr_bytes, addr_type). Similarly, py_get_bonds() now returns a list of addr_bytes instead of a list of (addr_bytes, addr_type) tuples. The Rust code no longer converts a.type_ or bond.type_ into MicroPython objects. The commit message labels this as a chore and explicitly includes ‘[no changelog]’. No security relevance, vulnerability description, or attribution is present in the commit materials.
Changed components
Trezor firmware core BLE MicroPython bindingstrezorble.pyi mock/type stubFunctions: connected_addr(), get_bonds()Inspect captured patch +13 / −20
diff --git a/core/embed/rust/src/trezorhal/ble/micropython.rs b/core/embed/rust/src/trezorhal/ble/micropython.rs
index 2989cc8a0..d1fb64a67 100644
--- a/core/embed/rust/src/trezorhal/ble/micropython.rs
+++ b/core/embed/rust/src/trezorhal/ble/micropython.rs
@@ -142,31 +142,28 @@ extern "C" fn py_connection_flags() -> Obj {
unsafe { util::try_or_raise(block) }
}
-// Return (addr_bytes, addr_type) if connected, otherwise None.
+// Return addr_bytes if connected, otherwise None.
// addr_bytes: bytes of length 6
-// addr_type: integer as provided by bt_le_addr_t (e.g., 0=public, 1=random)
extern "C" fn py_connected_addr() -> Obj {
let block = || {
if !is_connected() {
return Ok(Obj::const_none());
}
let a = connected_addr();
- let addr_obj = Obj::try_from(&a.addr[..])?;
- let type_obj = Obj::from(a.type_);
- (addr_obj, type_obj).try_into()
+ Obj::try_from(&a.addr[..])
};
unsafe { util::try_or_raise(block) }
}
+// Returns a list of addr_bytes, representing the current bonds.
+// addr_bytes: bytes of length 6
extern "C" fn py_get_bonds() -> Obj {
let block = || {
get_bonds(|bonds| {
let mut result = List::with_capacity(bonds.len())?;
for bond in bonds {
- let addr = Obj::try_from(&bond.addr[..])?;
- let addr_type = Obj::from(bond.type_);
- result.append(Obj::try_from((addr, addr_type))?)?;
+ result.append(Obj::try_from(&bond.addr[..])?)?;
}
Ok(result.leak().into())
})
@@ -349,19 +346,17 @@ pub static mp_module_trezorble: Module = obj_module! {
/// """
Qstr::MP_QSTR_connection_flags => obj_fn_0!(py_connection_flags).as_obj(),
- /// def get_bonds() -> list[tuple[bytes, int], ...]:
+ /// def get_bonds() -> list[bytes]:
/// """
- /// Returns a list of (addr_bytes, addr_type) tuples, representing the current bonds.
+ /// Returns a list of addr_bytes, representing the current bonds.
/// addr_bytes: bytes of length 6
- /// addr_type: integer as provided by bt_le_addr_t (e.g., 0=public, 1=random)
/// """
Qstr::MP_QSTR_get_bonds => obj_fn_0!(py_get_bonds).as_obj(),
- /// def connected_addr() -> tuple[bytes, int] | None:
+ /// def connected_addr() -> bytes | None:
/// """
- /// If connected, returns a tuple (addr_bytes, addr_type), otherwise None.
+ /// If connected, returns addr_bytes, otherwise None.
/// addr_bytes: bytes of length 6
- /// addr_type: integer as provided by bt_le_addr_t (e.g., 0=public, 1=random)
/// """
Qstr::MP_QSTR_connected_addr => obj_fn_0!(py_connected_addr).as_obj(),
diff --git a/core/mocks/generated/trezorble.pyi b/core/mocks/generated/trezorble.pyi
index 136bb0adf..ad0491da0 100644
--- a/core/mocks/generated/trezorble.pyi
+++ b/core/mocks/generated/trezorble.pyi
@@ -126,20 +126,18 @@ def connection_flags() -> list[str]:
# rust/src/trezorhal/ble/micropython.rs
-def get_bonds() -> list[tuple[bytes, int], ...]:
+def get_bonds() -> list[bytes]:
"""
- Returns a list of (addr_bytes, addr_type) tuples, representing the current bonds.
+ Returns a list of addr_bytes, representing the current bonds.
addr_bytes: bytes of length 6
- addr_type: integer as provided by bt_le_addr_t (e.g., 0=public, 1=random)
"""
# rust/src/trezorhal/ble/micropython.rs
-def connected_addr() -> tuple[bytes, int] | None:
+def connected_addr() -> bytes | None:
"""
- If connected, returns a tuple (addr_bytes, addr_type), otherwise None.
+ If connected, returns addr_bytes, otherwise None.
addr_bytes: bytes of length 6
- addr_type: integer as provided by bt_le_addr_t (e.g., 0=public, 1=random)
"""
Why this scored 18/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.