SASC-NG
DVBSoftCAM

seca.c File Reference

#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <byteswap.h>
#include <openssl/sha.h>
#include "system-common.h"
#include "data.h"
#include "helper.h"
#include "crypto.h"
#include "parse.h"
#include "misc.h"
#include "log-sys.h"
#include "log-core.h"
#include "version.h"

Go to the source code of this file.

Classes

class  cPlainKeySeca
class  cSecaCardInfo
class  cSecaCardInfos
class  cSeca
struct  Perm
struct  ProvData
class  cSeca2Prov
class  cSeca2ProvLink
class  cSeca2ProvLinkReg< CC >
class  cSeca2Providers
class  cSeca2ProvSSE
class  cSeca2ProvFR
class  cSeca2ProvNL
class  cSeca2ProvPL
class  cSeca2ProvSPA
class  cSystemSeca
class  cSystemLinkSeca

Defines

#define SYSTEM_SECA   0x0100
#define SYSTEM_NAME   "Seca"
#define SYSTEM_PRI   -10
#define SYSTEM_CAN_HANDLE(x)   ((x)==SYSTEM_SECA)
#define FILEMAP_DOMAIN   "seca"
#define L_SYS   14
#define L_SYS_ALL   LALL(L_SYS_LASTDEF)
#define PLAINLEN_SECA_H   8
#define PLAINLEN_SECA_D   16
#define PLAINLEN_SECA_B   90
#define PLAINLEN_SECA_E   6
#define EMM_MAGIC   1
#define N51_MAGIC   2
#define swap8_4(d)   __swap8_4(d)
#define MAX_PERMS   10
#define KEY2INDEX(x)   (((x)>>5)&0x03)
#define beforeSig   (pos-8)
#define afterSig   (pos+1)

Functions

 SCAPIVERSTAG ()
static void __swap8_4 (unsigned char *data)
static cSeca2ProvLinkReg
< cSeca2ProvFR > 
staticLinkFR (IdsFR)
static cSeca2ProvLinkReg
< cSeca2ProvNL > 
staticLinkNL (IdsNL)
static cSeca2ProvLinkReg
< cSeca2ProvPL > 
staticLinkPL (IdsPL)
static cSeca2ProvLinkReg
< cSeca2ProvSPA > 
staticLinkSPA (IdsSPA)

Variables

static struct LogModule lm_sys
static cPlainKeyTypeReg
< cPlainKeySeca,'S'> 
KeyReg
static cSecaCardInfos Scards
static const unsigned char secaPC1 []
static const unsigned char secaPC2 []
static const unsigned short IdsFR [] = { 0x80,0x81,0 }
static struct ProvData provDataFR
static const unsigned short IdsNL [] = { 0x6a,0 }
static struct ProvData provDataNL
static const unsigned short IdsPL [] = { 0x65,0 }
static struct ProvData provDataPL
static struct Perm ptPL [MAX_PERMS]
static const unsigned short IdsSPA [] = { 0x64,0x66,0x67,0 }
static struct ProvData provDataSPA
static struct Perm ptSPA [MAX_PERMS]
static cSystemLinkSeca staticInit

Define Documentation

#define afterSig   (pos+1)

Definition at line 649 of file seca.c.

Referenced by cSeca2ProvSSE::PostSSE().

#define beforeSig   (pos-8)

Definition at line 648 of file seca.c.

Referenced by cSeca2ProvSSE::PostSSE().

#define EMM_MAGIC   1

Definition at line 64 of file seca.c.

Referenced by cPlainKeySeca::Parse(), cPlainKeySeca::PrintKeyNr(), and cSystemSeca::ProcessEMM().

#define FILEMAP_DOMAIN   "seca"

Definition at line 45 of file seca.c.

Referenced by cSeca2Prov::GetMap().

#define KEY2INDEX (   x)    (((x)>>5)&0x03)

Definition at line 384 of file seca.c.

Referenced by cSystemSeca::ProcessECM(), and cSystemSeca::ProcessEMM().

#define L_SYS   14

Definition at line 47 of file seca.c.

#define L_SYS_ALL   LALL(L_SYS_LASTDEF)

Definition at line 48 of file seca.c.

#define MAX_PERMS   10

Definition at line 383 of file seca.c.

Referenced by cSeca2Prov::P().

#define N51_MAGIC   2

Definition at line 65 of file seca.c.

Referenced by cPlainKeySeca::Parse(), and cPlainKeySeca::PrintKeyNr().

#define PLAINLEN_SECA_B   90

Definition at line 62 of file seca.c.

Referenced by cPlainKeySeca::Parse().

#define PLAINLEN_SECA_D   16

Definition at line 61 of file seca.c.

Referenced by cSecaCardInfo::Parse(), and cPlainKeySeca::Parse().

#define PLAINLEN_SECA_E   6

Definition at line 63 of file seca.c.

Referenced by cPlainKeySeca::Parse().

#define PLAINLEN_SECA_H   8

Definition at line 60 of file seca.c.

Referenced by cSecaCardInfo::Parse(), and cPlainKeySeca::Parse().

#define swap8_4 (   d)    __swap8_4(d)

Definition at line 226 of file seca.c.

Referenced by cSeca::Decrypt(), and cSeca::Encrypt().

#define SYSTEM_CAN_HANDLE (   x)    ((x)==SYSTEM_SECA)

Definition at line 43 of file seca.c.

Referenced by cSystemLinkSeca::CanHandle().

#define SYSTEM_NAME   "Seca"

Definition at line 41 of file seca.c.

#define SYSTEM_PRI   -10

Definition at line 42 of file seca.c.

#define SYSTEM_SECA   0x0100

Definition at line 39 of file seca.c.


Function Documentation

static void __swap8_4 ( unsigned char *  data) [inline, static]

Definition at line 219 of file seca.c.

{
  unsigned char temp[4];
  memcpy(temp,data,4);
  memcpy(data,&data[4],4);
  memcpy(&data[4],temp,4);
}
SCAPIVERSTAG ( )
static cSeca2ProvLinkReg<cSeca2ProvFR> staticLinkFR ( IdsFR  ) [static]
static cSeca2ProvLinkReg<cSeca2ProvNL> staticLinkNL ( IdsNL  ) [static]
static cSeca2ProvLinkReg<cSeca2ProvPL> staticLinkPL ( IdsPL  ) [static]
static cSeca2ProvLinkReg<cSeca2ProvSPA> staticLinkSPA ( IdsSPA  ) [static]

Variable Documentation

const unsigned short IdsFR[] = { 0x80,0x81,0 } [static]

Definition at line 752 of file seca.c.

const unsigned short IdsNL[] = { 0x6a,0 } [static]

Definition at line 913 of file seca.c.

const unsigned short IdsPL[] = { 0x65,0 } [static]

Definition at line 1053 of file seca.c.

const unsigned short IdsSPA[] = { 0x64,0x66,0x67,0 } [static]

Definition at line 1117 of file seca.c.

Definition at line 77 of file seca.c.

struct LogModule lm_sys [static]
Initial value:

Definition at line 50 of file seca.c.

struct ProvData provDataFR [static]
Initial value:
 {
  0x80,16895,16895,0x7F,0xF7, { 3, 0, 0, 0, 2, 4, 3, 0 }
  }

Definition at line 756 of file seca.c.

Referenced by cSeca2ProvFR::cSeca2ProvFR().

struct ProvData provDataNL [static]
Initial value:
 {
  0x6a,16895,16895,0xa3,0x3a, { 3, 0, 0, 0, 2, 4, 3, 0 }
  }

Definition at line 917 of file seca.c.

Referenced by cSeca2ProvNL::cSeca2ProvNL().

struct ProvData provDataPL [static]
Initial value:
 {
  0x65,16895,16895,0x96,0x69, { 3, 0, 0, 0, 2, 4, 3, 0 }
  }

Definition at line 1057 of file seca.c.

Referenced by cSeca2ProvPL::cSeca2ProvPL().

struct ProvData provDataSPA [static]
Initial value:
 {
  0x64,16895,16895,0x96,0x69, { 2, 2, 2, 2, 2, 2, 2, 2 }
  }

Definition at line 1121 of file seca.c.

Referenced by cSeca2ProvSPA::cSeca2ProvSPA().

struct Perm ptPL[MAX_PERMS] [static]
Initial value:
 {
    { 
    { 2, 4, 4, 3, 2, 2, 4, 4 },
    { 3, 2, 4, 3, 4, 4, 2, 3 },
    { 0, 0, 0, 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0, 0, 0, 0 }
  },{ 
    { 4, 4, 3, 2, 2, 3, 3, 4 },
    { 4, 2, 3, 4, 3, 2, 4, 2 },
    { 0, 0, 0, 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0, 0, 0, 0 }
  },{ 
  },{ 
  },{ 
  },{ 
  },{ 
  },{ 
  },{ 
    { 4, 4, 3, 2, 3, 4, 3, 2 },
    { 2, 4, 3, 2, 2, 4, 4, 3 },
    { 2, 3, 4, 1, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0, 0, 0, 0 },
  },{ 
  } }

Definition at line 1061 of file seca.c.

Referenced by cSeca2ProvPL::cSeca2ProvPL().

struct Perm ptSPA[MAX_PERMS] [static]
Initial value:
 {
    { 
    { 3, 2, 4, 3, 3, 4, 4, 2 },
    { 4, 4, 3, 3, 2, 2, 4, 4 },
    { 0, 0, 0, 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0, 0, 0, 0 }
  },{ 
    { 2, 3, 4, 3, 2, 4, 3, 2 },
    { 4, 3, 2, 3, 4, 2, 4, 3 },
    { 0, 0, 0, 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0, 0, 0, 0 }
  },{ 
  },{ 
  },{ 
  },{ 
  },{ 
  },{ 
  },{ 
    { 3, 3, 4, 4, 3, 3, 2, 2 },
    { 3, 3, 2, 2, 3, 3, 2, 2 },
    { 2, 3, 4, 1, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0, 0, 0, 0 }
  },{ 
  } }

Definition at line 1125 of file seca.c.

Referenced by cSeca2ProvSPA::cSeca2ProvSPA().

Definition at line 196 of file seca.c.

const unsigned char secaPC1[] [static]
Initial value:
 {
  42,57,29,34,  41,53,30,15,
  19,36,23,14,  43,61,12, 3,
  51,49,5,  6,  45,54,52,47,
  63,38,58,22,  60,33,10,26,
  37,35,44, 1,  20,62,28,18,
  46, 9,39, 4,  27,11,21,50,
  31,25, 2, 7,  13,55,59,17
  }

Definition at line 200 of file seca.c.

const unsigned char secaPC2[] [static]
Initial value:
 {
  18, 3,21,15,  42,35,37, 8,
  49,41,30,55,  56,29,12,23,
  43,14,7 ,27,  13, 2,11,45,
   4,34,54,51,  22,40,16,25,
  26,48,53,28,   1,17, 5,31,
  50, 6,39,24,  33,47,38,32
  }

Definition at line 210 of file seca.c.

Definition at line 1687 of file seca.c.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines