Explorar o código

Merge seader from https://github.com/bettse/seader

Willy-JL hai 1 ano
pai
achega
e93f3cab71
Modificáronse 3 ficheiros con 8 adicións e 1 borrados
  1. 1 1
      seader/application.fam
  2. 5 0
      seader/seader_credential.c
  3. 2 0
      seader/seader_credential.h

+ 1 - 1
seader/application.fam

@@ -20,7 +20,7 @@ App(
     ],
     fap_icon="icons/logo.png",
     fap_category="NFC",
-    fap_version="3.0",
+    fap_version="3.1",
     fap_author="bettse",
     #    fap_extbuild=(
     #        ExtFile(

+ 5 - 0
seader/seader_credential.c

@@ -14,6 +14,7 @@
 
 static const char* seader_file_header = "Flipper Seader Credential";
 static const uint32_t seader_file_version = 1;
+extern const uint8_t picopass_iclass_key[];
 
 SeaderCredential* seader_credential_alloc() {
     SeaderCredential* seader_dev = malloc(sizeof(SeaderCredential));
@@ -396,6 +397,10 @@ bool seader_credential_save_picopass(SeaderCredential* cred, const char* name) {
     bool use_load_path = true;
     bool saved = false;
     bool withSIO = cred->save_format == SeaderCredentialSaveFormatSR;
+    if(withSIO) {
+        loclass_iclass_calc_div_key(cred->diversifier, picopass_iclass_key, debit_key, false);
+    }
+
     FlipperFormat* file = flipper_format_file_alloc(cred->storage);
     FuriString* temp_str = furi_string_alloc();
 

+ 2 - 0
seader/seader_credential.h

@@ -5,6 +5,8 @@
 #include <storage/storage.h>
 #include <dialogs/dialogs.h>
 #include "protocol/picopass_protocol.h"
+#include <optimized_ikeys.h>
+#include <optimized_cipher.h>
 
 #define SEADER_CRED_NAME_MAX_LEN 22
 #define SEADER_APP_EXTENSION     ".credential"