Skip to content

Commit

Permalink
Correct key calculation for save as SR
Browse files Browse the repository at this point in the history
  • Loading branch information
bettse committed Aug 24, 2024
1 parent fc15704 commit f65e802
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions seader_credential.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,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));
Expand Down Expand Up @@ -394,6 +395,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();

Expand Down
2 changes: 2 additions & 0 deletions seader_credential.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit f65e802

Please sign in to comment.