Browse Source

Picopass: allow zero keys (#44)

Co-authored-by: あく <alleteam@gmail.com>
Eric Betts 2 years ago
parent
commit
4af84c8514
1 changed files with 3 additions and 1 deletions
  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]);
         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(
     bool empty = picopass_is_memset(
         AA1[PICOPASS_ICLASS_PACS_CFG_BLOCK_INDEX].data, 0xFF, RFAL_PICOPASS_BLOCK_LEN);
         AA1[PICOPASS_ICLASS_PACS_CFG_BLOCK_INDEX].data, 0xFF, RFAL_PICOPASS_BLOCK_LEN);