Skip to content

Commit f65e802

Browse files
committed
Correct key calculation for save as SR
1 parent fc15704 commit f65e802

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

seader_credential.c

+5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
static const char* seader_file_header = "Flipper Seader Credential";
1414
static const uint32_t seader_file_version = 1;
15+
extern const uint8_t picopass_iclass_key[];
1516

1617
SeaderCredential* seader_credential_alloc() {
1718
SeaderCredential* seader_dev = malloc(sizeof(SeaderCredential));
@@ -394,6 +395,10 @@ bool seader_credential_save_picopass(SeaderCredential* cred, const char* name) {
394395
bool use_load_path = true;
395396
bool saved = false;
396397
bool withSIO = cred->save_format == SeaderCredentialSaveFormatSR;
398+
if(withSIO) {
399+
loclass_iclass_calc_div_key(cred->diversifier, picopass_iclass_key, debit_key, false);
400+
}
401+
397402
FlipperFormat* file = flipper_format_file_alloc(cred->storage);
398403
FuriString* temp_str = furi_string_alloc();
399404

seader_credential.h

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
#include <storage/storage.h>
66
#include <dialogs/dialogs.h>
77
#include "protocol/picopass_protocol.h"
8+
#include <optimized_ikeys.h>
9+
#include <optimized_cipher.h>
810

911
#define SEADER_CRED_NAME_MAX_LEN 22
1012
#define SEADER_APP_EXTENSION ".credential"

0 commit comments

Comments
 (0)