small fix dvbci

Origin commit data
------------------
Branch: master
Commit: 03c577f38b
Author: DboxOldie <DboxOdlie@users.noreply.github.com>
Date: 2020-01-17 (Fri, 17 Jan 2020)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
DboxOldie
2020-01-17 21:29:00 +01:00
committed by vanhofen
parent 56ca54bab9
commit cbbbc504f8
4 changed files with 60 additions and 4 deletions

View File

@@ -713,7 +713,7 @@ static int generate_akh(struct cc_ctrl_data *cc_data)
uint8_t akh[32]; uint8_t akh[32];
SHA256_CTX sha; SHA256_CTX sha;
printf("%s>%s\n", FILENAME, __FUNCTION__); printf("%s -> %s\n", FILENAME, __FUNCTION__);
SHA256_Init(&sha); SHA256_Init(&sha);
SHA256_Update(&sha, element_get_ptr(cc_data, 6), element_get_buf(cc_data, NULL, 6)); SHA256_Update(&sha, element_get_ptr(cc_data, 6), element_get_buf(cc_data, NULL, 6));
@@ -926,9 +926,11 @@ static int data_get_handle_new(struct cc_ctrl_data *cc_data, unsigned int id)
/* SAC data messages */ /* SAC data messages */
case 6: //CICAM_id
case 12: //keyprecursor case 12: //keyprecursor
check_new_key(cc_data); check_new_key(cc_data);
break; break;
case 26: //programm number
case 25: //uri_message case 25: //uri_message
generate_uri_confirm(cc_data, cc_data->sak); generate_uri_confirm(cc_data, cc_data->sak);
break; break;
@@ -937,6 +939,7 @@ static int data_get_handle_new(struct cc_ctrl_data *cc_data, unsigned int id)
break; break;
default: default:
printf("%s -> %s unhandled ID (%d)\n", FILENAME, __FUNCTION__, id);
break; break;
} }

View File

@@ -80,10 +80,11 @@ int eDVBCIResourceManagerSession::doAction()
{0x00, 0x02, 0x00, 0x41}, // application V1 {0x00, 0x02, 0x00, 0x41}, // application V1
{0x00, 0x02, 0x00, 0x43}, // application V3 {0x00, 0x02, 0x00, 0x43}, // application V3
{0x00, 0x03, 0x00, 0x41}, // conditional access {0x00, 0x03, 0x00, 0x41}, // conditional access
// {0x00, 0x20, 0x00, 0x41}, // host control {0x00, 0x20, 0x00, 0x41}, // host control (dummy)
{0x00, 0x40, 0x00, 0x41}, // mmi {0x00, 0x40, 0x00, 0x41}, // mmi
{0x00, 0x24, 0x00, 0x41}, // date-time {0x00, 0x24, 0x00, 0x41}, // date-time
{0x00, 0x8c, 0x10, 0x01} // content control {0x00, 0x8c, 0x10, 0x01}, // content control
{0x00, 0x8e, 0x10, 0x01} // cam upgrade (dummy)
// {0x00, 0x10, 0x00, 0x41} // auth. // {0x00, 0x10, 0x00, 0x41} // auth.
}; };
sendAPDU(tag, data, sizeof(data)); sendAPDU(tag, data, sizeof(data));

View File

@@ -14,6 +14,40 @@
eDVBCISession* eDVBCISession::sessions[SLMS]; eDVBCISession* eDVBCISession::sessions[SLMS];
eDVBCIHostControlSession::eDVBCIHostControlSession(eDVBCISlot *tslot)
{
slot = tslot;
}
eDVBCIHostControlSession::~eDVBCIHostControlSession()
{
}
int eDVBCIHostControlSession::receivedAPDU(const unsigned char *tag,const void *data, int len)
{
printf("CI HC SESSION(%d)/TAG %02x %02x %02x: ", session_nb, tag[0], tag[1], tag[2]);
for (int i=0; i<len; i++)
printf("%02x ", ((const unsigned char*)data)[i]);
printf("\n");
return 0;
}
int eDVBCIHostControlSession::doAction()
{
switch (state)
{
case stateStarted:
{
const unsigned char tag[3] = {0x9F, 0x80, 0x20}; // application manager info
sendAPDU(tag);
state = stateFinal;
return 1;
}
default:
return 0;
}
}
int eDVBCISession::buildLengthField(unsigned char *pkt, int len) int eDVBCISession::buildLengthField(unsigned char *pkt, int len)
{ {
if (len < 127) if (len < 127)
@@ -180,12 +214,16 @@ eDVBCISession* eDVBCISession::createSession(eDVBCISlot *slot, const unsigned cha
sessions[session_nb - 1] = new eDVBCIContentControlManagerSession(slot); sessions[session_nb - 1] = new eDVBCIContentControlManagerSession(slot);
break; break;
} // fall through } // fall through
case 0x00200041:
sessions[session_nb - 1] = new eDVBCIHostControlSession(slot);
printf("[CI SESS] Host Control\n");
break;
case 0x00100041: case 0x00100041:
// session=new eDVBCIAuthSession; // session=new eDVBCIAuthSession;
printf("[CI SESS] AuthSession\n"); printf("[CI SESS] AuthSession\n");
// break; // break;
// fall through // fall through
case 0x00200041: case 0x008e1001:
default: default:
printf("[CI SESS] unknown resource type %02x %02x %02x %02x\n", resource_identifier[0], resource_identifier[1], resource_identifier[2], resource_identifier[3]); printf("[CI SESS] unknown resource type %02x %02x %02x %02x\n", resource_identifier[0], resource_identifier[1], resource_identifier[2], resource_identifier[3]);
sessions[session_nb - 1] = 0; sessions[session_nb - 1] = 0;

View File

@@ -47,4 +47,18 @@ public:
static int pollAll(); static int pollAll();
}; };
class eDVBCIHostControlSession: public eDVBCISession
{
enum {
stateFinal=statePrivate
};
eDVBCISlot *slot;
int receivedAPDU(const unsigned char *tag,const void *data, int len);
int doAction();
public:
eDVBCIHostControlSession(eDVBCISlot *tslot);
~eDVBCIHostControlSession();
};
#endif #endif