Selaa lähdekoodia

Picopass: allow zero keys (#44)

Co-authored-by: あく <alleteam@gmail.com>
Eric Betts 2 vuotta sitten
vanhempi
commit
56dec78f8d
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3 1
      scenes/picopass_scene_read_card_success.c

+ 3 - 1
scenes/picopass_scene_read_card_success.c

@@ -37,7 +37,9 @@ void picopass_scene_read_card_success_on_enter(void* context) {
         furi_string_cat_printf(csn_str, "%02X", csn[i]);
     }
 
-    bool no_key = picopass_is_memset(pacs->key, 0x00, RFAL_PICOPASS_BLOCK_LEN);
+    // We can't test the pacs->key in case it is intentionally all 0's and we can't test the key block since it is populated with the diversified key before each key test, so we approximate with the PACS config block being blank.
+    bool no_key = picopass_is_memset(
+        AA1[PICOPASS_ICLASS_PACS_CFG_BLOCK_INDEX].data, 0x00, RFAL_PICOPASS_BLOCK_LEN);
     bool empty = picopass_is_memset(
         AA1[PICOPASS_ICLASS_PACS_CFG_BLOCK_INDEX].data, 0xFF, RFAL_PICOPASS_BLOCK_LEN);