LMMS
Loading...
Searching...
No Matches
crypt.c File Reference
#include "zip.h"
#include "crypt.h"
#include "ttyio.h"
#include "crc32.h"

Macros

#define ZCRYPT_INTERNAL
#define GLOBAL(g)
#define CRY_CRC_TAB   CRC_32_TAB

Functions

local int testp OF ((__GPRO__ ZCONST uch *h))
local int testkey OF ((__GPRO__ ZCONST uch *h, ZCONST char *key))
int decrypt_byte (__G)
int update_keys (__G__ c) __GDEF int c
 GLOBAL (keys[1])
 GLOBAL (keys[2])
void init_keys (__G__ passwd) __GDEF ZCONST char *passwd
int decrypt (__G__ passwrd) __GDEF ZCONST char *passwrd
 Trace ((stdout, "\n[incnt = %d]: ", GLOBAL(incnt)))
 GLOBAL (pInfo->encrypted)
 defer_leftover_input (__G)
 for (n=0;n< RAND_HEAD_LEN;n++)
 undefer_input (__G)
 if (GLOBAL(newzip))
 if (GLOBAL(key))
else if ((GLOBAL(key)=(char *) malloc(IZ_PWLEN+1))==(char *) NULL)
 while (n > 0)
local int testp (__G__ h) __GDEF ZCONST uch *h
 if (r !=0)
local int testkey (__G__ h, key) __GDEF ZCONST uch *h
 memcpy (hh, h, RAND_HEAD_LEN)
 Trace ((stdout, "\n lrec.crc= %08lx crec.crc= %08lx pInfo->ExtLocHdr= %s\n", GLOBAL(lrec.crc32), GLOBAL(pInfo->crc), GLOBAL(pInfo->ExtLocHdr) ? "true":"false"))
 Trace ((stdout, " incnt = %d unzip offset into zipfile = %ld\n", GLOBAL(incnt), GLOBAL(cur_zipfile_bufstart)+(GLOBAL(inptr) -GLOBAL(inbuf))))
 Trace ((stdout, " b = %02x (crc >> 24) = %02x (lrec.time >> 8) = %02x\n", b,(ush)(GLOBAL(lrec.crc32) > > 24),((ush) GLOBAL(lrec.last_mod_dos_datetime) > > 8) &0xff))

Variables

return c
while passwd
int n
int r = testkey(__G__ h, GLOBAL(key))
uch h [RAND_HEAD_LEN]
return PK_WARN
char * key_translated
ZCONST char * key
uchp
uch hh [RAND_HEAD_LEN]
 b = hh[RAND_HEAD_LEN-1]

Macro Definition Documentation

◆ CRY_CRC_TAB

#define CRY_CRC_TAB   CRC_32_TAB

◆ GLOBAL

#define GLOBAL ( g)
Value:
G.g
Uz_Globs G
Definition globals.c:42

◆ ZCRYPT_INTERNAL

#define ZCRYPT_INTERNAL

Function Documentation

◆ decrypt()

int decrypt ( __G__ passwrd)

◆ decrypt_byte()

int decrypt_byte ( __G )

◆ defer_leftover_input()

defer_leftover_input ( __G )

◆ for()

for ( )

◆ GLOBAL() [1/3]

GLOBAL ( keys [1])

◆ GLOBAL() [2/3]

GLOBAL ( keys [2])

◆ GLOBAL() [3/3]

GLOBAL ( pInfo-> encrypted)

◆ if() [1/4]

else if ( (GLOBAL(key)=(char *) malloc(IZ_PWLEN+1)) = = (char *)NULL)

◆ if() [2/4]

if ( GLOBAL(key) )

◆ if() [3/4]

if ( GLOBAL(newzip) )

◆ if() [4/4]

if ( r ! = 0)

◆ init_keys()

void init_keys ( __G__ passwd)

◆ memcpy()

memcpy ( hh ,
h ,
RAND_HEAD_LEN  )

◆ OF() [1/2]

◆ OF() [2/2]

◆ testkey()

local int testkey ( __G__ h,
key  )

◆ testp()

local int testp ( __G__ h)

◆ Trace() [1/4]

Trace ( (stdout, " b = %02x (crc >> 24) = %02x (lrec.time >> 8) = %02x\n", b,(ush)(GLOBAL(lrec.crc32) > > 24),((ush) GLOBAL(lrec.last_mod_dos_datetime) > > 8) &0xff) )

◆ Trace() [2/4]

Trace ( (stdout, " incnt = %d unzip offset into zipfile = %ld\n", GLOBAL(incnt), GLOBAL(cur_zipfile_bufstart)+(GLOBAL(inptr) -GLOBAL(inbuf))) )

◆ Trace() [3/4]

Trace ( (stdout, "\n lrec.crc= %08lx crec.crc= %08lx pInfo->ExtLocHdr= %s\n", GLOBAL(lrec.crc32), GLOBAL(pInfo->crc), GLOBAL(pInfo->ExtLocHdr) ? "true":"false") )

◆ Trace() [4/4]

Trace ( (stdout, "\n[incnt = %d]: ", GLOBAL(incnt)) )

◆ undefer_input()

undefer_input ( __G )

◆ update_keys()

int update_keys ( __G__ c)

◆ while()

while ( n ,
0  )

Variable Documentation

◆ b

b = hh[RAND_HEAD_LEN-1]

◆ c

return c

◆ h

◆ hh

◆ key

ZCONST char* key

◆ key_translated

char* key_translated
Initial value:
{
int r
int r
Definition crypt.c:458

◆ n

int n
Initial value:
{
b
Definition crypt.c:628
unsigned short ush
Definition unzip.h:402

◆ p

uch* p

◆ passwd

passwd
Initial value:
{
while passwd
Definition crypt.c:195
int update_keys(__G__ c) __GDEF int c
#define __G__
Definition crypt.h:76

◆ PK_WARN

return PK_WARN

◆ r