File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ const ALLOWLIST_VARS: &[&str] = &[
40
40
"MEMORY_SPI_BLE_FIRMWARE_2_ADDR" ,
41
41
"MEMORY_PLATFORM_BITBOX02" ,
42
42
"MEMORY_PLATFORM_BITBOX02_PLUS" ,
43
+ "MEMORY_SECURECHIP_TYPE_ATECC" ,
44
+ "MEMORY_SECURECHIP_TYPE_OPTIGA" ,
43
45
] ;
44
46
45
47
const ALLOWLIST_TYPES : & [ & str ] = & [
@@ -110,6 +112,7 @@ const ALLOWLIST_FNS: &[&str] = &[
110
112
"memory_get_ble_metadata" ,
111
113
"memory_set_ble_metadata" ,
112
114
"memory_get_platform" ,
115
+ "memory_get_securechip_type" ,
113
116
"memory_spi_get_active_ble_firmware_version" ,
114
117
"spi_mem_write" ,
115
118
"menu_create" ,
Original file line number Diff line number Diff line change @@ -175,6 +175,19 @@ pub fn get_platform() -> Result<Platform, ()> {
175
175
}
176
176
}
177
177
178
+ pub enum SecurechipType {
179
+ Atecc ,
180
+ Optiga ,
181
+ }
182
+
183
+ pub fn get_securechip_type ( ) -> Result < SecurechipType , ( ) > {
184
+ match unsafe { bitbox02_sys:: memory_get_securechip_type ( ) as u32 } {
185
+ bitbox02_sys:: MEMORY_SECURECHIP_TYPE_ATECC => Ok ( SecurechipType :: Atecc ) ,
186
+ bitbox02_sys:: MEMORY_SECURECHIP_TYPE_OPTIGA => Ok ( SecurechipType :: Optiga ) ,
187
+ _ => Err ( ( ) ) ,
188
+ }
189
+ }
190
+
178
191
pub fn get_ble_metadata ( ) -> BleMetadata {
179
192
let mut metadata = core:: mem:: MaybeUninit :: uninit ( ) ;
180
193
You can’t perform that action at this time.
0 commit comments