Schimmelreiter / oscam-smod

modern & emu based oscam, but in-line with the latest trunk too
GNU General Public License v3.0
24 stars 32 forks source link

improve key handling for CAK7 and overcrypt keys #31

Closed WXbet closed 4 years ago

WXbet commented 4 years ago

better version with the correct length for then keys

ghost commented 4 years ago
#include <stdio.h>
#include <stdint.h>
#include <string.h>
int main() {                  // if by chance unfinished...
static uint8_t key[112 + 1] = {0x01,0x02,0x03};
printf("key: ");
for(int32_t i = 0; i < sizeof(key) ; i++) { printf("%02X", key[i]); }
printf(" \nstrlen: %ld sizeof: %ld \n", strlen((char*)key), sizeof(key));

//if (strlen((char*)key) && key[112])
if (strlen((char*)key))
    printf("key is valid!!!\n");
else
    printf("key is invalid!!!\n");
}

out: key: 0102030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 strlen: 3 sizeof: 113 key is valid!!!

WXbet commented 4 years ago

What do you want to do with it?

ghost commented 4 years ago

What do you want to do with it?

https://github.com/Recruit3/oscam-smod/commit/5b0907239106cb21aa55c5879789aef6eb2fe0d2

WXbet commented 4 years ago

replaces with newer version