Origin commit data
------------------
Branch: master
Commit: fe8b1237ac
Author: max_10 <max_10@gmx.de>
Date: 2015-11-10 (Tue, 10 Nov 2015)


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

------------------
This commit was generated by Migit
This commit is contained in:
max_10
2015-11-10 15:55:48 +01:00
parent 1ebf3ac7d9
commit 0fa30acbcb
2 changed files with 11 additions and 55 deletions

View File

@@ -11,60 +11,30 @@
static const char * FILENAME = "[descrambler]";
/* alles im Kernel Header ca.h definiert da es der player2 auch braucht
enum ca_descr_data_type {
CA_DATA_IV,
CA_DATA_KEY,
};
enum ca_descr_parity {
CA_PARITY_EVEN,
CA_PARITY_ODD,
};
struct ca_descr_data {
unsigned int index;
enum ca_descr_parity parity;
enum ca_descr_data_type data_type;
unsigned int length;
unsigned char *data;
};
#define CA_SET_DESCR_DATA _IOW('o', 137, struct ca_descr_data)
*/
static int desc_fd;
/* Byte 0 to 15 are AES Key, Byte 16 to 31 are IV */
int descrambler_set_key(int index, int parity, unsigned char *data)
{
struct ca_descr_data d;
printf("%s -> %s\n", FILENAME, __FUNCTION__);
d.index = index;
d.parity = (ca_descr_parity)parity;
d.data_type = CA_DATA_KEY;
d.length = 16;
d.length = 32;
d.data = data;
printf("Index: %d Parity: %d Type CA_DATA_KEY= %d\n", d.index, d.parity, d.data_type);
hexdump(d.data, 16);
printf("Index: %d Parity: (%d) -> ", d.index, d.parity);
hexdump(d.data, 32);
if (ioctl(desc_fd, CA_SET_DESCR_DATA, &d))
printf("CA_SET_DESCR_DATA\n");
d.index = index;
d.parity = (ca_descr_parity)parity;
d.data_type = CA_DATA_IV;
d.length = 16;
d.data = data + 16;
printf("Index: %d Parity: %d Type CA_DATA_IV= %d\n", d.index, d.parity, d.data_type);
hexdump(d.data, 16);
if (ioctl(desc_fd, CA_SET_DESCR_DATA, &d))
printf("CA_SET_DESCR_DATA\n");
{
//printf("CA_SET_DESCR_DATA\n");
}
return 0;
}