gwenhywfar  4.6.0beta
Functions
sar.c File Reference
#include "sar_p.h"
#include "gwen_sar_fileheader_l.h"
#include "i18n_l.h"
#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/tlv.h>
#include <gwenhywfar/gui.h>
#include <gwenhywfar/text.h>
#include <gwenhywfar/cryptmgrkeys.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>

Go to the source code of this file.

Functions

int GWEN_Sar__UnpackArchive (const char *inFile, const char *where)
 
int GWEN_Sar_AddAndDigestFile (GWEN_SAR *sr, const GWEN_SAR_FILEHEADER *fh, GWEN_MDIGEST *md)
 
int GWEN_Sar_AddAndDigestFileLink (GWEN_SAR *sr, const GWEN_SAR_FILEHEADER *fh, GWEN_MDIGEST *md)
 
int GWEN_Sar_AddAndDigestFileReg (GWEN_SAR *sr, const GWEN_SAR_FILEHEADER *fh, GWEN_MDIGEST *md)
 
int GWEN_Sar_AddFile (GWEN_SAR *sr, const char *fname)
 
void GWEN_Sar_Attach (GWEN_SAR *sr)
 
int GWEN_Sar_CheckArchive (const char *inFile)
 
int GWEN_Sar_CheckFile (GWEN_SAR *sr, const GWEN_SAR_FILEHEADER *fh)
 
int GWEN_Sar_CloseArchive (GWEN_SAR *sr, int abandon)
 
int GWEN_Sar_CreateArchive (GWEN_SAR *sr, const char *aname)
 
int GWEN_Sar_ExtractAndDigestFile (GWEN_SAR *sr, const GWEN_SAR_FILEHEADER *fh, int checkOnly)
 
int GWEN_Sar_ExtractAndDigestFileDir (GWEN_SAR *sr, const GWEN_SAR_FILEHEADER *fh, int checkOnly)
 
int GWEN_Sar_ExtractAndDigestFileLink (GWEN_SAR *sr, const GWEN_SAR_FILEHEADER *fh, int checkOnly)
 
int GWEN_Sar_ExtractAndDigestFileReg (GWEN_SAR *sr, const GWEN_SAR_FILEHEADER *fh, int checkOnly)
 
int GWEN_Sar_ExtractFile (GWEN_SAR *sr, const GWEN_SAR_FILEHEADER *fh)
 
int GWEN_Sar_FileHeaderToTlv (const GWEN_SAR_FILEHEADER *fh, GWEN_BUFFER *tbuf)
 
void GWEN_Sar_free (GWEN_SAR *sr)
 
const GWEN_SAR_FILEHEADER_LIST * GWEN_Sar_GetHeaders (GWEN_SAR *sr)
 
GWEN_SARGWEN_Sar_new (void)
 
int GWEN_Sar_OpenArchive (GWEN_SAR *sr, const char *aname, GWEN_SYNCIO_FILE_CREATIONMODE cm, uint32_t acc)
 
uint64_t GWEN_Sar_ReadUint64 (const uint8_t *p, uint32_t bs)
 
int GWEN_Sar_ScanFile (GWEN_SAR *sr)
 
int GWEN_Sar_Sign (GWEN_SAR *sr, GWEN_CRYPTMGR *cm)
 
int GWEN_Sar_SignArchive (const char *inFile, const char *signer, GWEN_CRYPT_KEY *key)
 
int GWEN_Sar_TlvToFileHeader (GWEN_BUFFER *mbuf, GWEN_SAR_FILEHEADER *fh)
 
int GWEN_Sar_UnpackArchive (const char *inFile, const char *where)
 
int GWEN_Sar_Verify (GWEN_SAR *sr, GWEN_CRYPTMGR *cm)
 
int GWEN_Sar_VerifyArchive (const char *inFile, const char *signer, GWEN_CRYPT_KEY *key)
 

Function Documentation

int GWEN_Sar__UnpackArchive ( const char *  inFile,
const char *  where 
)
int GWEN_Sar_AddAndDigestFile ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh,
GWEN_MDIGEST md 
)
int GWEN_Sar_AddAndDigestFileLink ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh,
GWEN_MDIGEST md 
)
int GWEN_Sar_AddAndDigestFileReg ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh,
GWEN_MDIGEST md 
)
int GWEN_Sar_AddFile ( GWEN_SAR sr,
const char *  fname 
)
void GWEN_Sar_Attach ( GWEN_SAR sr)

Definition at line 63 of file sar.c.

int GWEN_Sar_CheckArchive ( const char *  inFile)
int GWEN_Sar_CheckFile ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh 
)

Definition at line 1781 of file sar.c.

References DBG_INFO, GWEN_LOGDOMAIN, and GWEN_Sar_ExtractAndDigestFile().

Referenced by GWEN_Sar_CheckArchive().

int GWEN_Sar_CloseArchive ( GWEN_SAR sr,
int  abandon 
)
int GWEN_Sar_CreateArchive ( GWEN_SAR sr,
const char *  aname 
)
int GWEN_Sar_ExtractAndDigestFile ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh,
int  checkOnly 
)
int GWEN_Sar_ExtractAndDigestFileDir ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh,
int  checkOnly 
)
int GWEN_Sar_ExtractAndDigestFileLink ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh,
int  checkOnly 
)
int GWEN_Sar_ExtractAndDigestFileReg ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh,
int  checkOnly 
)
int GWEN_Sar_ExtractFile ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh 
)

Definition at line 1767 of file sar.c.

References DBG_INFO, GWEN_LOGDOMAIN, and GWEN_Sar_ExtractAndDigestFile().

Referenced by GWEN_Sar__UnpackArchive().

int GWEN_Sar_FileHeaderToTlv ( const GWEN_SAR_FILEHEADER fh,
GWEN_BUFFER tbuf 
)
void GWEN_Sar_free ( GWEN_SAR sr)
const GWEN_SAR_FILEHEADER_LIST* GWEN_Sar_GetHeaders ( GWEN_SAR sr)

Definition at line 1795 of file sar.c.

Referenced by GWEN_Sar__UnpackArchive(), and GWEN_Sar_CheckArchive().

GWEN_SAR* GWEN_Sar_new ( void  )
int GWEN_Sar_OpenArchive ( GWEN_SAR sr,
const char *  aname,
GWEN_SYNCIO_FILE_CREATIONMODE  cm,
uint32_t  acc 
)
uint64_t GWEN_Sar_ReadUint64 ( const uint8_t *  p,
uint32_t  bs 
)

Definition at line 338 of file sar.c.

References DBG_ERROR, and GWEN_LOGDOMAIN.

Referenced by GWEN_Sar_TlvToFileHeader().

int GWEN_Sar_ScanFile ( GWEN_SAR sr)
int GWEN_Sar_Sign ( GWEN_SAR sr,
GWEN_CRYPTMGR cm 
)
int GWEN_Sar_SignArchive ( const char *  inFile,
const char *  signer,
GWEN_CRYPT_KEY key 
)
int GWEN_Sar_TlvToFileHeader ( GWEN_BUFFER mbuf,
GWEN_SAR_FILEHEADER fh 
)
int GWEN_Sar_UnpackArchive ( const char *  inFile,
const char *  where 
)

Definition at line 1878 of file sar.c.

References DBG_ERROR, DBG_INFO, GWEN_ERROR_IO, GWEN_LOGDOMAIN, GWEN_Sar__UnpackArchive(), and NULL.

int GWEN_Sar_Verify ( GWEN_SAR sr,
GWEN_CRYPTMGR cm 
)
int GWEN_Sar_VerifyArchive ( const char *  inFile,
const char *  signer,
GWEN_CRYPT_KEY key 
)