MX před 2 roky
rodič
revize
2eb1433736

+ 1 - 1
application.fam

@@ -10,7 +10,7 @@ App(
     ],
     ],
     stack_size=4 * 1024,
     stack_size=4 * 1024,
     fap_description="App to communicate with NFC tags using the PicoPass(iClass) format",
     fap_description="App to communicate with NFC tags using the PicoPass(iClass) format",
-    fap_version="1.4",
+    fap_version="1.5",
     fap_icon="125_10px.png",
     fap_icon="125_10px.png",
     fap_category="NFC",
     fap_category="NFC",
     fap_libs=["mbedtls"],
     fap_libs=["mbedtls"],

+ 1 - 0
picopass_device.h

@@ -40,6 +40,7 @@
 
 
 #define PICOPASS_APP_FOLDER ANY_PATH("picopass")
 #define PICOPASS_APP_FOLDER ANY_PATH("picopass")
 #define PICOPASS_APP_EXTENSION ".picopass"
 #define PICOPASS_APP_EXTENSION ".picopass"
+#define PICOPASS_APP_FILE_PREFIX "Picopass"
 #define PICOPASS_APP_SHADOW_EXTENSION ".pas"
 #define PICOPASS_APP_SHADOW_EXTENSION ".pas"
 
 
 #define PICOPASS_DICT_KEY_BATCH_SIZE 10
 #define PICOPASS_DICT_KEY_BATCH_SIZE 10

+ 16 - 6
picopass_worker.c

@@ -282,11 +282,10 @@ ReturnCode picopass_auth(PicopassWorker* picopass_worker) {
         return ERR_NONE;
         return ERR_NONE;
     }
     }
 
 
-    FURI_LOG_I(TAG, "Starting user dictionary attack [Elite KDF]");
-    err = picopass_auth_dict(picopass_worker, IclassEliteDictTypeUser);
-    if(err == ERR_NONE) {
-        return ERR_NONE;
-    }
+    /* Because size of the user dictionary and could introduce confusing delay
+     * to the read screen (since there is no feedback), we omit checking it.
+     * It will be checked when the user uses Elite Dict. Attack, which has a progress bar
+     */
 
 
     FURI_LOG_I(TAG, "Starting system dictionary attack [Elite KDF]");
     FURI_LOG_I(TAG, "Starting system dictionary attack [Elite KDF]");
     err = picopass_auth_dict(picopass_worker, IclassEliteDictTypeFlipper);
     err = picopass_auth_dict(picopass_worker, IclassEliteDictTypeFlipper);
@@ -579,7 +578,18 @@ void picopass_worker_elite_dict_attack(PicopassWorker* picopass_worker) {
 
 
         err = rfalPicoPassPollerCheck(mac, &chkRes);
         err = rfalPicoPassPollerCheck(mac, &chkRes);
         if(err == ERR_NONE) {
         if(err == ERR_NONE) {
-            FURI_LOG_I(TAG, "Found key");
+            FURI_LOG_I(
+                TAG,
+                "Found key: %02x%02x%02x%02x%02x%02x%02x%02x",
+                key[0],
+                key[1],
+                key[2],
+                key[3],
+                key[4],
+                key[5],
+                key[6],
+                key[7]);
+
             memcpy(pacs->key, key, RFAL_PICOPASS_BLOCK_LEN);
             memcpy(pacs->key, key, RFAL_PICOPASS_BLOCK_LEN);
             pacs->elite_kdf = elite;
             pacs->elite_kdf = elite;
             err = picopass_read_card(AA1);
             err = picopass_read_card(AA1);

+ 1 - 0
scenes/picopass_scene_key_input.c

@@ -1,4 +1,5 @@
 #include "../picopass_i.h"
 #include "../picopass_i.h"
+#include <lib/toolbox/name_generator.h>
 #include <gui/modules/validators.h>
 #include <gui/modules/validators.h>
 #include <toolbox/path.h>
 #include <toolbox/path.h>
 
 

+ 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);
 
 

+ 3 - 2
scenes/picopass_scene_save_name.c

@@ -1,5 +1,5 @@
 #include "../picopass_i.h"
 #include "../picopass_i.h"
-#include <toolbox/name_generator.h>
+#include <lib/toolbox/name_generator.h>
 #include <gui/modules/validators.h>
 #include <gui/modules/validators.h>
 #include <toolbox/path.h>
 #include <toolbox/path.h>
 
 
@@ -16,7 +16,8 @@ void picopass_scene_save_name_on_enter(void* context) {
     TextInput* text_input = picopass->text_input;
     TextInput* text_input = picopass->text_input;
     bool dev_name_empty = false;
     bool dev_name_empty = false;
     if(!strcmp(picopass->dev->dev_name, "")) {
     if(!strcmp(picopass->dev->dev_name, "")) {
-        name_generator_make_auto(picopass->text_store, sizeof(picopass->text_store), "PicoPass");
+        name_generator_make_auto(
+            picopass->text_store, sizeof(picopass->text_store), PICOPASS_APP_FILE_PREFIX);
         dev_name_empty = true;
         dev_name_empty = true;
     } else {
     } else {
         picopass_text_store_set(picopass, picopass->dev->dev_name);
         picopass_text_store_set(picopass, picopass->dev->dev_name);