Przeglądaj źródła

Picopass: allow zero keys (#44)

Co-authored-by: あく <alleteam@gmail.com>
Eric Betts 2 lat temu
rodzic
commit
56dec78f8d
1 zmienionych plików z 3 dodań i 1 usunięć
  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);