Skip to content

Commit

Permalink
correct CSN for picopass
Browse files Browse the repository at this point in the history
  • Loading branch information
bettse committed Jan 13, 2024
1 parent 6004b3a commit 6f1706e
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions seader_credential.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,6 @@ bool seader_credential_save_agnostic(SeaderCredential* cred, const char* name) {

bool seader_credential_save_picopass(SeaderCredential* cred, const char* name) {
uint8_t zero[PICOPASS_BLOCK_LEN] = {0};
uint8_t csn[PICOPASS_BLOCK_LEN] = {0x7a, 0xf5, 0x31, 0x13, 0xfe, 0xff, 0x12, 0xe0};
uint8_t cfg[PICOPASS_BLOCK_LEN] = {0x12, 0xff, 0xff, 0xff, 0x7f, 0x1f, 0xff, 0x3c};
uint8_t epurse[PICOPASS_BLOCK_LEN] = {0xff, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff};
uint8_t debit_key[PICOPASS_BLOCK_LEN] = {0xe3, 0xf3, 0x07, 0x84, 0x4a, 0x0b, 0x62, 0x04};
Expand Down Expand Up @@ -421,20 +420,12 @@ bool seader_credential_save_picopass(SeaderCredential* cred, const char* name) {
furi_string_printf(temp_str, "Block %d", i);
switch(i) {
case CSN_INDEX:
// TODO: Is there any practical difference here? If so, document.
if(withSIO) {
if(!flipper_format_write_hex(
file,
furi_string_get_cstr(temp_str),
cred->diversifier,
PICOPASS_BLOCK_LEN)) {
block_saved = false;
}
} else {
if(!flipper_format_write_hex(
file, furi_string_get_cstr(temp_str), csn, sizeof(csn))) {
block_saved = false;
}
if(!flipper_format_write_hex(
file,
furi_string_get_cstr(temp_str),
cred->diversifier,
PICOPASS_BLOCK_LEN)) {
block_saved = false;
}
break;
case EPURSE_INDEX:
Expand Down

0 comments on commit 6f1706e

Please sign in to comment.