drms.c File Reference

Include dependency graph for drms.c:


Data Structures

struct  aes_s
struct  shuffle_s
struct  drms_s

Defines

#define Digest   DigestMD5
#define SWAP(a, b)   { (a) ^= (b); (b) ^= (a); (a) ^= (b); }
#define REVERSE(p, n)
#define ROT13(c)
#define DRMS_DIRNAME   ".drms"
#define ISCINFO   "iSCInfo"
#define PROD_NAME   "iPod"
#define VENDOR_NAME   "Apple Computer, Inc."

Functions

static void InitAES (struct aes_s *, uint32_t *)
static void DecryptAES (struct aes_s *, uint32_t *, const uint32_t *)
static void InitShuffle (struct shuffle_s *, uint32_t *, uint32_t)
static void DoShuffle (struct shuffle_s *, uint32_t *, uint32_t)
static uint32_t FirstPass (uint32_t *)
static void SecondPass (uint32_t *, uint32_t)
static void ThirdPass (uint32_t *)
static void FourthPass (uint32_t *)
static void TinyShuffle1 (uint32_t *)
static void TinyShuffle2 (uint32_t *)
static void TinyShuffle3 (uint32_t *)
static void TinyShuffle4 (uint32_t *)
static void TinyShuffle5 (uint32_t *)
static void TinyShuffle6 (uint32_t *)
static void TinyShuffle7 (uint32_t *)
static void TinyShuffle8 (uint32_t *)
static void DoExtShuffle (uint32_t *)
static int GetSystemKey (uint32_t *, bool)
static int WriteUserKey (void *, uint32_t *)
static int ReadUserKey (void *, uint32_t *)
static int GetUserKey (void *, uint32_t *)
static int GetSCIData (char *, uint32_t **, uint32_t *)
static int HashSystemInfo (uint32_t *)
static int GetiPodID (int64_t *)
static void BlockXOR (uint32_t *p_dest, uint32_t *p_s1, uint32_t *p_s2)
void * drms_alloc (const char *psz_homedir)
void drms_free (void *_p_drms)
void drms_decrypt (void *_p_drms, uint32_t *p_buffer, uint32_t i_bytes, uint32_t *p_key)
void drms_get_p_key (void *_p_drms, uint32_t *p_key)
int drms_init (void *_p_drms, uint32_t i_type, uint8_t *p_info, uint32_t i_len)

Define Documentation

#define Digest   DigestMD5

#define DRMS_DIRNAME   ".drms"

Referenced by ReadUserKey(), and WriteUserKey().

#define ISCINFO   "iSCInfo"

Referenced by GetSCIData().

#define PROD_NAME   "iPod"

Referenced by GetiPodID().

#define REVERSE ( p,
 ) 

#define ROT13 (  ) 

Value:

(((c)>='A'&&(c)<='Z')?(((c)-'A'+13)%26)+'A':\
                      ((c)>='a'&&(c)<='z')?(((c)-'a'+13)%26)+'a':c)

Referenced by DoShuffle().

#define SWAP ( a,
b   )     { (a) ^= (b); (b) ^= (a); (a) ^= (b); }

#define VENDOR_NAME   "Apple Computer, Inc."

Referenced by GetiPodID().


Function Documentation

static void BlockXOR ( uint32_t *  p_dest,
uint32_t *  p_s1,
uint32_t *  p_s2 
) [inline, static]

Referenced by drms_decrypt(), and GetUserKey().

static void DecryptAES ( struct aes_s p_aes,
uint32_t *  p_dest,
const uint32_t *  p_src 
) [static]

static void DoExtShuffle ( uint32_t *  p_bordel  )  [static]

References FirstPass(), FourthPass(), SecondPass(), and ThirdPass().

Referenced by DoShuffle().

static void DoShuffle ( struct shuffle_s p_shuffle,
uint32_t *  p_buffer,
uint32_t  i_size 
) [static]

void* drms_alloc ( const char *  psz_homedir  ) 

void drms_decrypt ( void *  _p_drms,
uint32_t *  p_buffer,
uint32_t  i_bytes,
uint32_t *  p_key 
)

References drms_s::aes, BlockXOR(), DecryptAES(), drms_s::p_key, and REVERSE.

Referenced by Demux(), and drms_init().

void drms_free ( void *  _p_drms  ) 

void drms_get_p_key ( void *  _p_drms,
uint32_t *  p_key 
)

References drms_s::p_key.

Referenced by Demux().

int drms_init ( void *  _p_drms,
uint32_t  i_type,
uint8_t *  p_info,
uint32_t  i_len 
)

static uint32_t FirstPass ( uint32_t *  p_bordel  )  [static]

References TinyShuffle1(), and TinyShuffle2().

Referenced by DoExtShuffle().

static void FourthPass ( uint32_t *  p_bordel  )  [static]

References SWAP, TinyShuffle7(), and TinyShuffle8().

Referenced by DoExtShuffle().

static int GetiPodID ( int64_t *  p_ipod_id  )  [static]

References getenv(), PROD_NAME, strtoll(), value, and VENDOR_NAME.

Referenced by GetSystemKey().

static int GetSCIData ( char *  psz_ipod,
uint32_t **  pp_sci,
uint32_t *  pi_sci_size 
) [static]

References config_GetConfDir(), ISCINFO, and vlc_fopen().

Referenced by GetUserKey().

static int GetSystemKey ( uint32_t *  p_sys_key,
bool  b_ipod 
) [static]

static int GetUserKey ( void *  _p_drms,
uint32_t *  p_user_key 
) [static]

static int HashSystemInfo ( uint32_t *  p_system_hash  )  [static]

References AddMD5(), EndMD5(), InitMD5(), and md5_s::p_digest.

Referenced by GetSystemKey().

static void InitAES ( struct aes_s p_aes,
uint32_t *  p_key 
) [static]

static void InitShuffle ( struct shuffle_s p_shuffle,
uint32_t *  p_sys_key,
uint32_t  i_version 
) [static]

static int ReadUserKey ( void *  _p_drms,
uint32_t *  p_user_key 
) [static]

static void SecondPass ( uint32_t *  p_bordel,
uint32_t  i_tmp 
) [static]

References TinyShuffle3(), TinyShuffle4(), and TinyShuffle5().

Referenced by DoExtShuffle().

static void ThirdPass ( uint32_t *  p_bordel  )  [static]

References SWAP, and TinyShuffle6().

Referenced by DoExtShuffle().

static void TinyShuffle1 ( uint32_t *  p_bordel  )  [static]

Referenced by FirstPass().

static void TinyShuffle2 ( uint32_t *  p_bordel  )  [static]

Referenced by FirstPass().

static void TinyShuffle3 ( uint32_t *  p_bordel  )  [static]

Referenced by SecondPass().

static void TinyShuffle4 ( uint32_t *  p_bordel  )  [static]

Referenced by SecondPass().

static void TinyShuffle5 ( uint32_t *  p_bordel  )  [static]

Referenced by SecondPass().

static void TinyShuffle6 ( uint32_t *  p_bordel  )  [static]

References SWAP.

Referenced by ThirdPass().

static void TinyShuffle7 ( uint32_t *  p_bordel  )  [static]

References SWAP.

Referenced by FourthPass().

static void TinyShuffle8 ( uint32_t *  p_bordel  )  [static]

References __MIN, and SWAP.

Referenced by FourthPass().

static int WriteUserKey ( void *  _p_drms,
uint32_t *  p_user_key 
) [static]


Generated on Tue May 25 08:05:16 2010 for VLC by  doxygen 1.5.6