Opened 3 years ago

Closed 2 years ago

#4691 closed defect (fixed)

New Polish Card Fix update New Prov- FEDC Reader-seca.c

Reported by: LTE-Media Owned by: theparasol
Priority: major Component: Card support
Severity: high Keywords:
Cc: Sensitive: no

Description

Revision

<Please fill in>

Issue Description

<Please fill in>

Index: reader-seca.c
===================================================================
--- reader-seca.c (wersja 11425)
+++ reader-seca.c (kopia robocza)
@@ -12,7 +12,7 @@

};



-static uint64_t get_pbm(struct s_reader *reader, uint8_t idx)
+static uint64_t get_pbm(struct s_reader *reader, uint8_t idx, bool fedc)

{

def_resp;
unsigned char ins34[] = { 0xc1, 0x34, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00}; set request options

@@ -24,24 +24,27 @@

ins32[4] = 0x0D;
ins34[5] = 0x04;

}

  • write_cmd(ins34, ins34 + 5); set request options
  • write_cmd(ins32, NULL); pbm request

+ if(!fedc)
+ {
+ write_cmd(ins34, ins34 + 5); set request options
+ write_cmd(ins32, NULL);
pbm request

  • switch(cta_res[0])
  • {
  • case 0x04:
  • rdr_log(reader, "no PBM for provider %u", idx + 1);
  • break;
  • case 0x83:
  • pbm = b2ll(8, cta_res + 1);
  • rdr_log(reader, "PBM for provider %u: %08llx", idx + 1, (unsigned long long) pbm);
  • break;
  • case 0xb2:
  • pbm = b2ll(8, cta_res + 1);
  • rdr_log(reader, "PBM for provider %u: %08llx", idx + 1, (unsigned long long) pbm);
  • break;
  • default:
  • rdr_log(reader, "ERROR: PBM returns unknown byte %02x", cta_res[0]);

+ switch(cta_res[0])
+ {
+ case 0x04:
+ rdr_log(reader, "no PBM for provider %u", idx + 1);
+ break;
+ case 0x83:
+ pbm = b2ll(8, cta_res + 1);
+ rdr_log(reader, "PBM for provider %u: %08llx", idx + 1, (unsigned long long) pbm);
+ break;
+ case 0xb2:
+ pbm = b2ll(8, cta_res + 1);
+ rdr_log(reader, "PBM for provider %u: %08llx", idx + 1, (unsigned long long) pbm);
+ break;
+ default:
+ rdr_log(reader, "ERROR: PBM returns unknown byte %02x", cta_res[0]);
+ }

}
return pbm;

}

@@ -54,6 +57,7 @@

struct tm lt;
time_t t;
bool valid = false;

+ bool fedc = false;

char l_name[16 + 8 + 1] = ", name: ";
char tmp[9];


@@ -66,6 +70,26 @@

if((cta_res[25] != 0x90)
(cta_res[26] != 0x00)) { return ERROR; }

reader->prid[i][0] = 0;
reader->prid[i][1] = 0; blanken high byte provider code

+
+ if (cta_res[0] == 0xFE)
+ { fedc = true;
+ rdr_log(reader, "FEDC provider %i", i + 1);
+ cta_res[0] = 0x00;
+ switch(i + 1)
+ {
+ case 0x01:
+ cta_res[1] = 0x00;
+ break;
+ case 0x02:
+ cta_res[1] = 0x68;
+ break;
+ case 0x03:
+ cta_res[1] = 0x65;
+ break;
+ default:
+ cta_res[1] = 0x68;
+ }
+ }

memcpy(&reader->prid[i][2], cta_res, 2);


provid = b2ll(4, reader->prid[i]);

@@ -116,12 +140,12 @@

{

update entitlement info if found
entry->end = mktime(&lt);

  • entry->id = get_pbm(reader, i);

+ entry->id = get_pbm(reader, i, fedc);

entry->type = (i) ? 6 : 7;

}
else

add entitlement info

  • { cs_add_entitlement(reader, reader->caid, provid, get_pbm(reader, i), 0, 0, mktime(&lt), (i) ? 6 : 7, 1); }

+ { cs_add_entitlement(reader, reader->caid, provid, get_pbm(reader, i, fedc), 0, 0, mktime(&lt), (i) ? 6 : 7, 1); }

return OK;

}

Attachments (2)

FEDC_11.07.2018.patch.zip (1.1 KB ) - added by LTE-Media 3 years ago.
FEDC_11.07.2018.xyz.patch (2.8 KB ) - added by LTE-Media 3 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 by LTE-Media, 3 years ago

Summary: New Polish Card Fix update caid FEDCNew Polish Card Fix update caid FEDC Reader-seca

comment:2 by LTE-Media, 3 years ago

Owner: set to LTE-Media
Status: newassigned
Summary: New Polish Card Fix update caid FEDC Reader-secaNew Polish Card Fix update caid FEDC Reader-seca.c

by LTE-Media, 3 years ago

Attachment: FEDC_11.07.2018.patch.zip added

comment:3 by LTE-Media, 3 years ago

thx @ketanol ,@Jej@n fix..

Last edited 3 years ago by LTE-Media (previous) (diff)

comment:4 by LTE-Media, 3 years ago

Resolution: fixed
Status: assignedclosed
Summary: New Polish Card Fix update caid FEDC Reader-seca.cNew Polish Card Fix update New Prov- FEDC Reader-seca.c

comment:5 by LTE-Media, 3 years ago

Resolution: fixed
Status: closedreopened

by LTE-Media, 3 years ago

Attachment: FEDC_11.07.2018.xyz.patch added

comment:6 by LTE-Media, 3 years ago

Owner: changed from LTE-Media to theparasol
Status: reopenednew

comment:7 by tommy760, 3 years ago

Fix was verified by many Polish users.

comment:8 by LTE-Media, 3 years ago

new update prov -Seca ..

2017/07/11 16:52:49 4EF4E0 r nc+ [seca] provider 1: FEDC, valid: 1, name: CYFRA +, expiry date: 2017/09/11
2017/07/11 16:52:49 4EF4E0 r nc+ [seca] SA: ########
2017/07/11 16:52:49 4EF4E0 r nc+ [seca] no PBM for provider 1
2017/07/11 16:52:49 4EF4E0 r nc+ [seca] provider 2: FEDC, valid: 1, name: CYFRA+ 1, expiry date: 2017/09/10
2017/07/11 16:52:49 4EF4E0 r nc+ [seca] SA: ########
2017/07/11 16:52:49 4EF4E0 r nc+ [seca] PBM for provider 2: 8212851e000d6600
2017/07/11 16:52:49 4EF4E0 r nc+ [seca] provider 3: FEDC, valid: 0, name: CYFRA+ 2, expiry date: 1992/01/01
2017/07/11 16:52:49 4EF4E0 r nc+ [seca] PBM for provider 3: 8000000000000000

Last edited 3 years ago by LTE-Media (previous) (diff)

comment:9 by Gorgone Impertinence, 2 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.