gwenhywfar  5.10.1
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>
Include dependency graph for sar.c:

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_LISTGWEN_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

◆ GWEN_Sar__UnpackArchive()

int GWEN_Sar__UnpackArchive ( const char *  inFile,
const char *  where 
)

◆ GWEN_Sar_AddAndDigestFile()

int GWEN_Sar_AddAndDigestFile ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh,
GWEN_MDIGEST md 
)

◆ GWEN_Sar_AddAndDigestFileLink()

int GWEN_Sar_AddAndDigestFileLink ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh,
GWEN_MDIGEST md 
)

◆ GWEN_Sar_AddAndDigestFileReg()

int GWEN_Sar_AddAndDigestFileReg ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh,
GWEN_MDIGEST md 
)

◆ GWEN_Sar_AddFile()

int GWEN_Sar_AddFile ( GWEN_SAR sr,
const char *  fname 
)

◆ GWEN_Sar_Attach()

void GWEN_Sar_Attach ( GWEN_SAR sr)

Definition at line 64 of file sar.c.

◆ GWEN_Sar_CheckArchive()

int GWEN_Sar_CheckArchive ( const char *  inFile)

◆ GWEN_Sar_CheckFile()

int GWEN_Sar_CheckFile ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh 
)

Definition at line 1822 of file sar.c.

References DBG_INFO, GWEN_LOGDOMAIN, and GWEN_Sar_ExtractAndDigestFile().

Referenced by checkArchive(), and GWEN_Sar_CheckArchive().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Sar_CloseArchive()

int GWEN_Sar_CloseArchive ( GWEN_SAR sr,
int  abandon 
)

◆ GWEN_Sar_CreateArchive()

int GWEN_Sar_CreateArchive ( GWEN_SAR sr,
const char *  aname 
)

◆ GWEN_Sar_ExtractAndDigestFile()

int GWEN_Sar_ExtractAndDigestFile ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh,
int  checkOnly 
)

◆ GWEN_Sar_ExtractAndDigestFileDir()

int GWEN_Sar_ExtractAndDigestFileDir ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh,
int  checkOnly 
)

◆ GWEN_Sar_ExtractAndDigestFileLink()

int GWEN_Sar_ExtractAndDigestFileLink ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh,
int  checkOnly 
)

◆ GWEN_Sar_ExtractAndDigestFileReg()

int GWEN_Sar_ExtractAndDigestFileReg ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh,
int  checkOnly 
)

◆ GWEN_Sar_ExtractFile()

int GWEN_Sar_ExtractFile ( GWEN_SAR sr,
const GWEN_SAR_FILEHEADER fh 
)

Definition at line 1807 of file sar.c.

References DBG_INFO, GWEN_LOGDOMAIN, and GWEN_Sar_ExtractAndDigestFile().

Referenced by extractArchive(), and GWEN_Sar__UnpackArchive().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Sar_FileHeaderToTlv()

int GWEN_Sar_FileHeaderToTlv ( const GWEN_SAR_FILEHEADER fh,
GWEN_BUFFER tbuf 
)

◆ GWEN_Sar_free()

void GWEN_Sar_free ( GWEN_SAR sr)

Definition at line 73 of file sar.c.

References GWEN_FREE_OBJECT, GWEN_SarFileHeader_List_free(), and GWEN_SyncIo_free().

Referenced by add2Archive(), extractArchive(), GWEN_Sar__UnpackArchive(), GWEN_Sar_CheckArchive(), GWEN_Sar_SignArchive(), GWEN_Sar_VerifyArchive(), signArchive(), and verifyArchive().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Sar_GetHeaders()

const GWEN_SAR_FILEHEADER_LIST* GWEN_Sar_GetHeaders ( GWEN_SAR sr)

Definition at line 1837 of file sar.c.

Referenced by checkArchive(), extractArchive(), GWEN_Sar__UnpackArchive(), GWEN_Sar_CheckArchive(), and listArchive().

Here is the caller graph for this function:

◆ GWEN_Sar_new()

GWEN_SAR* GWEN_Sar_new ( void  )

Definition at line 50 of file sar.c.

References GWEN_NEW_OBJECT, and GWEN_SarFileHeader_List_new().

Referenced by add2Archive(), checkArchive(), createArchive(), extractArchive(), GWEN_Sar__UnpackArchive(), GWEN_Sar_CheckArchive(), GWEN_Sar_SignArchive(), GWEN_Sar_VerifyArchive(), listArchive(), signArchive(), and verifyArchive().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GWEN_Sar_OpenArchive()

int GWEN_Sar_OpenArchive ( GWEN_SAR sr,
const char *  aname,
GWEN_SYNCIO_FILE_CREATIONMODE  cm,
uint32_t  acc 
)

◆ GWEN_Sar_ReadUint64()

uint64_t GWEN_Sar_ReadUint64 ( const uint8_t *  p,
uint32_t  bs 
)

Definition at line 345 of file sar.c.

References DBG_ERROR, and GWEN_LOGDOMAIN.

Referenced by GWEN_Sar_TlvToFileHeader().

Here is the caller graph for this function:

◆ GWEN_Sar_ScanFile()

int GWEN_Sar_ScanFile ( GWEN_SAR sr)

◆ GWEN_Sar_Sign()

int GWEN_Sar_Sign ( GWEN_SAR sr,
GWEN_CRYPTMGR cm 
)

◆ GWEN_Sar_SignArchive()

int GWEN_Sar_SignArchive ( const char *  inFile,
const char *  signer,
GWEN_CRYPT_KEY key 
)

◆ GWEN_Sar_TlvToFileHeader()

int GWEN_Sar_TlvToFileHeader ( GWEN_BUFFER mbuf,
GWEN_SAR_FILEHEADER fh 
)

◆ GWEN_Sar_UnpackArchive()

int GWEN_Sar_UnpackArchive ( const char *  inFile,
const char *  where 
)

Definition at line 1922 of file sar.c.

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

Here is the call graph for this function:

◆ GWEN_Sar_Verify()

int GWEN_Sar_Verify ( GWEN_SAR sr,
GWEN_CRYPTMGR cm 
)

◆ GWEN_Sar_VerifyArchive()

int GWEN_Sar_VerifyArchive ( const char *  inFile,
const char *  signer,
GWEN_CRYPT_KEY key 
)