Eric Betts пре 2 година
родитељ
комит
48558863c7
2 измењених фајлова са 16 додато и 3 уклоњено
  1. 1 1
      picopass/application.fam
  2. 15 2
      picopass/scenes/picopass_scene_read_card_success.c

+ 1 - 1
picopass/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.2",
+    fap_version="1.3",
     fap_icon="125_10px.png",
     fap_icon="125_10px.png",
     fap_category="NFC",
     fap_category="NFC",
     fap_libs=["mbedtls"],
     fap_libs=["mbedtls"],

+ 15 - 2
picopass/scenes/picopass_scene_read_card_success.c

@@ -95,11 +95,24 @@ void picopass_scene_read_card_success_on_enter(void* context) {
 
 
         if(pacs->key) {
         if(pacs->key) {
             furi_string_cat_printf(key_str, "Key: ");
             furi_string_cat_printf(key_str, "Key: ");
-
             uint8_t key[RFAL_PICOPASS_BLOCK_LEN];
             uint8_t key[RFAL_PICOPASS_BLOCK_LEN];
             memcpy(key, &pacs->key, RFAL_PICOPASS_BLOCK_LEN);
             memcpy(key, &pacs->key, RFAL_PICOPASS_BLOCK_LEN);
+
+            bool standard_key = true;
+            // Handle DES key being 56bits with parity in LSB
             for(uint8_t i = 0; i < RFAL_PICOPASS_BLOCK_LEN; i++) {
             for(uint8_t i = 0; i < RFAL_PICOPASS_BLOCK_LEN; i++) {
-                furi_string_cat_printf(key_str, "%02X", key[i]);
+                if((key[i] & 0xFE) != (picopass_iclass_key[i] & 0xFE)) {
+                    standard_key = false;
+                    break;
+                }
+            }
+
+            if(standard_key) {
+                furi_string_cat_printf(key_str, "Standard");
+            } else {
+                for(uint8_t i = 0; i < RFAL_PICOPASS_BLOCK_LEN; i++) {
+                    furi_string_cat_printf(key_str, "%02X", key[i]);
+                }
             }
             }
         }
         }