Changeset 11677
- Timestamp:
- 11/12/20 13:09:49 (3 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/reader-nagra.c
r11672 r11677 381 381 382 382 uint8_t cmd2a[] = { 383 0x00, 384 0xA5, 0xFB, 0x02, 0x76, //NUID 385 0x00, 0x08, //OTP-CSC 383 0x00, 384 0xA5, 0xFB, 0x02, 0x76, //NUID 385 0x00, 0x08, //OTP-CSC 386 386 0x00, 0x00, //OTA-CSC 387 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 388 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 389 0x00, 387 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 388 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 389 0x00, 390 390 0x22, 0x11 }; //Provider ID 391 391 … … 427 427 if (reader->nuid_length == 4) //nuid is set 428 428 { 429 430 431 432 429 // inject provid 430 cmd2a[26] = reader->prid[0][2]; 431 cmd2a[27] = reader->prid[0][3]; 432 433 433 memcpy(&cmd2a[1], reader->nuid, 4); // inject NUID 434 434 … … 438 438 return ERROR; 439 439 } 440 } 440 } 441 441 else 442 442 { … … 446 446 return ERROR; 447 447 } 448 448 449 449 } 450 450 } … … 659 659 { 660 660 struct nagra_data *csystem_data = reader->csystem_data; 661 char ds[ 20], de[16];661 char ds[36], de[36]; 662 662 uint16_t chid; 663 663 … … 1373 1373 uint8_t _cwe1[8]; 1374 1374 char tmp_dbg[25]; 1375 1375 1376 1376 if(csystem_data->swapCW == 1) 1377 1377 { … … 1386 1386 memset(v, 0, sizeof(v)); 1387 1387 idea_cbc_encrypt(&cta_res[4], &_cwe1[0], 8, &csystem_data->ksSession, v, IDEA_DECRYPT); 1388 } 1389 rdr_log_dbg(reader, D_READER, "CW0 after IDEA decrypt: %s", cs_hexdump(1, _cwe0, 24, tmp_dbg, sizeof(tmp_dbg)));1390 rdr_log_dbg(reader, D_READER, "CW1 after IDEA decrypt: %s", cs_hexdump(1, _cwe1, 24, tmp_dbg, sizeof(tmp_dbg)));1391 1388 } 1389 rdr_log_dbg(reader, D_READER, "CW0 after IDEA decrypt: %s", cs_hexdump(1, _cwe0, 8, tmp_dbg, sizeof(tmp_dbg))); 1390 rdr_log_dbg(reader, D_READER, "CW1 after IDEA decrypt: %s", cs_hexdump(1, _cwe1, 8, tmp_dbg, sizeof(tmp_dbg))); 1391 1392 1392 if(CW_NEEDS_3DES()) 1393 1393 { 1394 1394 rdr_log_dbg(reader, D_READER, "3DES encryption of CWs detected. Using CWPK index:%02X", (csystem_data->ird_info & 7)); 1395 1395 1396 1396 if(reader->cwekey_length != 16) 1397 1397 { … … 1399 1399 return ERROR; 1400 1400 } 1401 1401 1402 1402 des_ecb3_decrypt(_cwe0, reader->cwekey); 1403 1403 des_ecb3_decrypt(_cwe1, reader->cwekey); 1404 rdr_log_dbg(reader, D_READER, "CW0 after 3DES decrypt: %s", cs_hexdump(1, _cwe0, 24, tmp_dbg, sizeof(tmp_dbg)));1405 rdr_log_dbg(reader, D_READER, "CW1 after 3DES decrypt: %s", cs_hexdump(1, _cwe1, 24, tmp_dbg, sizeof(tmp_dbg)));1404 rdr_log_dbg(reader, D_READER, "CW0 after 3DES decrypt: %s", cs_hexdump(1, _cwe0, 8, tmp_dbg, sizeof(tmp_dbg))); 1405 rdr_log_dbg(reader, D_READER, "CW1 after 3DES decrypt: %s", cs_hexdump(1, _cwe1, 8, tmp_dbg, sizeof(tmp_dbg))); 1406 1406 } 1407 1407 … … 1438 1438 memcpy(ea->cw, _cwe0, 0x08); 1439 1439 memcpy(ea->cw + 8, _cwe1, 0x08); 1440 1440 1441 1441 return OK; 1442 1442 } -
trunk/reader-nagracak7.c
r11676 r11677 80 80 static int32_t ParseDataType(struct s_reader *reader, uint8_t dt, uint8_t *cta_res, uint16_t cta_lr) 81 81 { 82 char ds[ 11], de[11];82 char ds[36], de[36]; 83 83 84 84 switch(dt) … … 630 630 int64_t gone_now = comp_timeb(&now, &reader->emm_last); 631 631 int64_t gone_refresh = comp_timeb(&reader->emm_last, &reader->last_refresh); 632 if(((gone_now > 3600000) && (gone_now < 31536000000LL)) || ((gone_refresh > 43200000) && (gone_refresh < 31536000000LL)))632 if(((gone_now > (int64_t)3600*1000) && (gone_now < (int64_t)365*24*3600*1000)) || ((gone_refresh > (int64_t)12*3600*1000) && (gone_refresh < (int64_t)365*24*3600*1000))) 633 633 { 634 634 reader->last_refresh=now;
Note:
See TracChangeset
for help on using the changeset viewer.