gwenhywfar  5.10.1
Macros | Functions
ctfile.c File Reference
#include "ctfile_p.h"
#include "i18n_l.h"
#include <gwenhywfar/ctf_context_be.h>
#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/padd.h>
#include <gwenhywfar/cryptkeyrsa.h>
#include <gwenhywfar/text.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <unistd.h>
Include dependency graph for ctfile.c:

Go to the source code of this file.

Macros

#define DISABLE_DEBUGLOG
 

Functions

int GWENHYWFAR_CB GWEN_Crypt_TokenFile__ActivateKey (GWEN_CRYPT_TOKEN *ct, uint32_t id, uint32_t gid)
 
int GWEN_Crypt_TokenFile__CloseFile (GWEN_CRYPT_TOKEN *ct, uint32_t gid)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenFile__Decipher (GWEN_CRYPT_TOKEN *ct, uint32_t keyId, GWEN_CRYPT_PADDALGO *a, const uint8_t *pInData, uint32_t inLen, uint8_t *pOutData, uint32_t *pOutLen, uint32_t gid)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenFile__Encipher (GWEN_CRYPT_TOKEN *ct, uint32_t keyId, GWEN_CRYPT_PADDALGO *a, const uint8_t *pInData, uint32_t inLen, uint8_t *pOutData, uint32_t *pOutLen, uint32_t gid)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenFile__GenerateKey (GWEN_CRYPT_TOKEN *ct, uint32_t keyId, const GWEN_CRYPT_CRYPTALGO *a, uint32_t gid)
 
const GWEN_CRYPT_TOKEN_CONTEXT *GWENHYWFAR_CB GWEN_Crypt_TokenFile__GetContext (GWEN_CRYPT_TOKEN *ct, uint32_t id, uint32_t gid)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenFile__GetContextIdList (GWEN_CRYPT_TOKEN *ct, uint32_t *pIdList, uint32_t *pCount, uint32_t gid)
 
GWEN_CRYPT_KEYGWEN_Crypt_TokenFile__GetKey (GWEN_CRYPT_TOKEN *ct, uint32_t id, uint32_t gid)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenFile__GetKeyIdList (GWEN_CRYPT_TOKEN *ct, uint32_t *pIdList, uint32_t *pCount, uint32_t gid)
 
const GWEN_CRYPT_TOKEN_KEYINFO *GWENHYWFAR_CB GWEN_Crypt_TokenFile__GetKeyInfo (GWEN_CRYPT_TOKEN *ct, uint32_t id, GWEN_UNUSED uint32_t flags, uint32_t gid)
 
int GWEN_Crypt_TokenFile__OpenFile (GWEN_CRYPT_TOKEN *ct, int wr, uint32_t gid)
 
int GWEN_Crypt_TokenFile__Read (GWEN_CRYPT_TOKEN *ct, uint32_t gid)
 
int GWEN_Crypt_TokenFile__ReadFile (GWEN_CRYPT_TOKEN *ct, uint32_t gid)
 
int GWEN_Crypt_TokenFile__ReloadIfNeeded (GWEN_CRYPT_TOKEN *ct, uint32_t gid)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenFile__SetContext (GWEN_CRYPT_TOKEN *ct, uint32_t id, const GWEN_CRYPT_TOKEN_CONTEXT *nctx, uint32_t gid)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenFile__SetKeyInfo (GWEN_CRYPT_TOKEN *ct, uint32_t id, const GWEN_CRYPT_TOKEN_KEYINFO *ski, uint32_t gid)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenFile__Sign (GWEN_CRYPT_TOKEN *ct, uint32_t keyId, GWEN_CRYPT_PADDALGO *a, const uint8_t *pInData, uint32_t inLen, uint8_t *pSignatureData, uint32_t *pSignatureLen, uint32_t *pSeqCounter, uint32_t gid)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenFile__Verify (GWEN_CRYPT_TOKEN *ct, uint32_t keyId, GWEN_CRYPT_PADDALGO *a, const uint8_t *pInData, uint32_t inLen, const uint8_t *pSignatureData, uint32_t signatureLen, uint32_t seqCounter, uint32_t gid)
 
int GWEN_Crypt_TokenFile__Write (GWEN_CRYPT_TOKEN *ct, int cr, uint32_t gid)
 
int GWEN_Crypt_TokenFile__WriteFile (GWEN_CRYPT_TOKEN *ct, int cr, uint32_t gid)
 
void GWEN_Crypt_TokenFile_AddContext (GWEN_CRYPT_TOKEN *ct, GWEN_CRYPT_TOKEN_CONTEXT *ctx)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenFile_Close (GWEN_CRYPT_TOKEN *ct, int abandon, uint32_t gid)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenFile_Create (GWEN_CRYPT_TOKEN *ct, uint32_t gid)
 
GWENHYWFAR_CB void GWEN_Crypt_TokenFile_freeData (GWEN_UNUSED void *bp, void *p)
 
GWEN_CRYPT_TOKEN_CONTEXTGWEN_Crypt_TokenFile_GetContext (GWEN_CRYPT_TOKEN *ct, int idx)
 
GWEN_CRYPT_TOKENGWEN_Crypt_TokenFile_new (const char *typeName, const char *tokenName)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenFile_Open (GWEN_CRYPT_TOKEN *ct, GWEN_UNUSED int admin, uint32_t gid)
 
GWEN_CRYPT_TOKEN_FILE_READ_FN GWEN_Crypt_TokenFile_SetReadFn (GWEN_CRYPT_TOKEN *ct, GWEN_CRYPT_TOKEN_FILE_READ_FN f)
 
GWEN_CRYPT_TOKEN_FILE_WRITE_FN GWEN_Crypt_TokenFile_SetWriteFn (GWEN_CRYPT_TOKEN *ct, GWEN_CRYPT_TOKEN_FILE_WRITE_FN f)
 

Macro Definition Documentation

◆ DISABLE_DEBUGLOG

#define DISABLE_DEBUGLOG

Definition at line 14 of file ctfile.c.

Function Documentation

◆ GWEN_Crypt_TokenFile__ActivateKey()

int GWENHYWFAR_CB GWEN_Crypt_TokenFile__ActivateKey ( GWEN_CRYPT_TOKEN ct,
uint32_t  id,
uint32_t  gid 
)

Definition at line 1019 of file ctfile.c.

References DBG_DEBUG, DBG_ERROR, DBG_INFO, GWEN_Crypt_Key_free(), GWEN_Crypt_Key_GetKeyNumber(), GWEN_Crypt_Key_GetKeyVersion(), GWEN_Crypt_KeyRsa_AddFlags(), GWEN_Crypt_KeyRsa_dup(), GWEN_CRYPT_KEYRSA_FLAGS_DIRECTSIGN, GWEN_Crypt_KeyRsa_GetExponent(), GWEN_Crypt_KeyRsa_GetModulus(), GWEN_CRYPT_KEYRSA_MAX_KEYLENGTH, GWEN_Crypt_Token_Context_List_First(), GWEN_Crypt_Token_Context_List_Next(), GWEN_Crypt_Token_GetModes(), GWEN_CRYPT_TOKEN_KEYFLAGS_CANSIGN, GWEN_CRYPT_TOKEN_KEYFLAGS_CANVERIFY, GWEN_CRYPT_TOKEN_KEYFLAGS_HASACTIONFLAGS, GWEN_CRYPT_TOKEN_KEYFLAGS_HASEXPONENT, GWEN_CRYPT_TOKEN_KEYFLAGS_HASKEYNUMBER, GWEN_CRYPT_TOKEN_KEYFLAGS_HASKEYVERSION, GWEN_CRYPT_TOKEN_KEYFLAGS_HASMODULUS, GWEN_CRYPT_TOKEN_KEYFLAGS_HASSIGNCOUNTER, GWEN_Crypt_Token_KeyInfo_AddFlags(), GWEN_Crypt_Token_KeyInfo_dup(), GWEN_Crypt_Token_KeyInfo_free(), GWEN_Crypt_Token_KeyInfo_SetExponent(), GWEN_Crypt_Token_KeyInfo_SetKeyNumber(), GWEN_Crypt_Token_KeyInfo_SetKeyVersion(), GWEN_Crypt_Token_KeyInfo_SetModulus(), GWEN_Crypt_Token_KeyInfo_SetSignCounter(), GWEN_CRYPT_TOKEN_MODE_DIRECT_SIGN, GWEN_Crypt_TokenFile__ReloadIfNeeded(), GWEN_Crypt_TokenFile__WriteFile(), GWEN_CTF_Context_GetLocalAuthKeyInfo(), GWEN_CTF_Context_GetLocalSignKeyInfo(), GWEN_CTF_Context_GetTempLocalSignKey(), GWEN_CTF_Context_SetLocalAuthKey(), GWEN_CTF_Context_SetLocalAuthKeyInfo(), GWEN_CTF_Context_SetLocalSignKey(), GWEN_CTF_Context_SetLocalSignKeyInfo(), GWEN_ERROR_NO_DATA, GWEN_ERROR_NOT_FOUND, GWEN_Gui_ProgressLog(), GWEN_Gui_ProgressLog2(), GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_LoggerLevel_Error, GWEN_LoggerLevel_Notice, I18N, and NULL.

Referenced by GWEN_Crypt_TokenFile_new().

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

◆ GWEN_Crypt_TokenFile__CloseFile()

int GWEN_Crypt_TokenFile__CloseFile ( GWEN_CRYPT_TOKEN ct,
uint32_t  gid 
)

◆ GWEN_Crypt_TokenFile__Decipher()

int GWENHYWFAR_CB GWEN_Crypt_TokenFile__Decipher ( GWEN_CRYPT_TOKEN ct,
uint32_t  keyId,
GWEN_CRYPT_PADDALGO a,
const uint8_t *  pInData,
uint32_t  inLen,
uint8_t *  pOutData,
uint32_t *  pOutLen,
uint32_t  gid 
)

◆ GWEN_Crypt_TokenFile__Encipher()

int GWENHYWFAR_CB GWEN_Crypt_TokenFile__Encipher ( GWEN_CRYPT_TOKEN ct,
uint32_t  keyId,
GWEN_CRYPT_PADDALGO a,
const uint8_t *  pInData,
uint32_t  inLen,
uint8_t *  pOutData,
uint32_t *  pOutLen,
uint32_t  gid 
)

◆ GWEN_Crypt_TokenFile__GenerateKey()

int GWENHYWFAR_CB GWEN_Crypt_TokenFile__GenerateKey ( GWEN_CRYPT_TOKEN ct,
uint32_t  keyId,
const GWEN_CRYPT_CRYPTALGO a,
uint32_t  gid 
)

Definition at line 1994 of file ctfile.c.

References DBG_DEBUG, DBG_INFO, GWEN_Crypt_CryptAlgo_GetChunkSize(), GWEN_Crypt_CryptAlgo_GetId(), GWEN_Crypt_Key_free(), GWEN_Crypt_Key_GetKeyNumber(), GWEN_Crypt_Key_GetKeyVersion(), GWEN_Crypt_KeyRsa_AddFlags(), GWEN_CRYPT_KEYRSA_FLAGS_DIRECTSIGN, GWEN_Crypt_KeyRsa_GeneratePair(), GWEN_Crypt_KeyRsa_GetExponent(), GWEN_Crypt_KeyRsa_GetModulus(), GWEN_CRYPT_KEYRSA_MAX_KEYLENGTH, GWEN_Crypt_Token_Context_List_First(), GWEN_Crypt_Token_Context_List_Next(), GWEN_Crypt_Token_GetModes(), GWEN_CRYPT_TOKEN_KEYFLAGS_CANDECIPHER, GWEN_CRYPT_TOKEN_KEYFLAGS_CANENCIPHER, GWEN_CRYPT_TOKEN_KEYFLAGS_CANSIGN, GWEN_CRYPT_TOKEN_KEYFLAGS_CANVERIFY, GWEN_CRYPT_TOKEN_KEYFLAGS_HASACTIONFLAGS, GWEN_CRYPT_TOKEN_KEYFLAGS_HASEXPONENT, GWEN_CRYPT_TOKEN_KEYFLAGS_HASKEYNUMBER, GWEN_CRYPT_TOKEN_KEYFLAGS_HASKEYVERSION, GWEN_CRYPT_TOKEN_KEYFLAGS_HASMODULUS, GWEN_CRYPT_TOKEN_KEYFLAGS_HASSIGNCOUNTER, GWEN_Crypt_Token_KeyInfo_AddFlags(), GWEN_Crypt_Token_KeyInfo_dup(), GWEN_Crypt_Token_KeyInfo_free(), GWEN_Crypt_Token_KeyInfo_SetExponent(), GWEN_Crypt_Token_KeyInfo_SetKeyNumber(), GWEN_Crypt_Token_KeyInfo_SetKeyVersion(), GWEN_Crypt_Token_KeyInfo_SetModulus(), GWEN_Crypt_Token_KeyInfo_SetSignCounter(), GWEN_CRYPT_TOKEN_MODE_DIRECT_SIGN, GWEN_CRYPT_TOKEN_MODE_EXP_65537, GWEN_Crypt_TokenFile__ReloadIfNeeded(), GWEN_Crypt_TokenFile__WriteFile(), GWEN_CTF_Context_GetLocalAuthKeyInfo(), GWEN_CTF_Context_GetLocalCryptKeyInfo(), GWEN_CTF_Context_GetLocalSignKeyInfo(), GWEN_CTF_Context_GetTempLocalSignKeyInfo(), GWEN_CTF_Context_SetLocalAuthKey(), GWEN_CTF_Context_SetLocalAuthKeyInfo(), GWEN_CTF_Context_SetLocalCryptKey(), GWEN_CTF_Context_SetLocalCryptKeyInfo(), GWEN_CTF_Context_SetLocalSignKey(), GWEN_CTF_Context_SetLocalSignKeyInfo(), GWEN_CTF_Context_SetTempLocalSignKey(), GWEN_CTF_Context_SetTempLocalSignKeyInfo(), GWEN_ERROR_NO_DATA, GWEN_ERROR_NOT_SUPPORTED, GWEN_Gui_ProgressLog(), GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_LoggerLevel_Error, GWEN_LoggerLevel_Notice, I18N, and NULL.

Referenced by GWEN_Crypt_TokenFile_new().

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

◆ GWEN_Crypt_TokenFile__GetContext()

const GWEN_CRYPT_TOKEN_CONTEXT* GWENHYWFAR_CB GWEN_Crypt_TokenFile__GetContext ( GWEN_CRYPT_TOKEN ct,
uint32_t  id,
uint32_t  gid 
)

Definition at line 1219 of file ctfile.c.

References DBG_INFO, GWEN_Crypt_Token_Context_GetId(), GWEN_Crypt_Token_Context_List_First(), GWEN_Crypt_Token_Context_List_Next(), GWEN_Crypt_TokenFile__ReloadIfNeeded(), GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, and NULL.

Referenced by GWEN_Crypt_TokenFile_new().

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

◆ GWEN_Crypt_TokenFile__GetContextIdList()

int GWENHYWFAR_CB GWEN_Crypt_TokenFile__GetContextIdList ( GWEN_CRYPT_TOKEN ct,
uint32_t *  pIdList,
uint32_t *  pCount,
uint32_t  gid 
)

Definition at line 1165 of file ctfile.c.

References DBG_INFO, GWEN_Crypt_Token_Context_List_First(), GWEN_Crypt_Token_Context_List_Next(), GWEN_Crypt_TokenFile__ReloadIfNeeded(), GWEN_ERROR_BUFFER_OVERFLOW, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, and NULL.

Referenced by GWEN_Crypt_TokenFile_new().

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

◆ GWEN_Crypt_TokenFile__GetKey()

GWEN_CRYPT_KEY* GWEN_Crypt_TokenFile__GetKey ( GWEN_CRYPT_TOKEN ct,
uint32_t  id,
uint32_t  gid 
)

◆ GWEN_Crypt_TokenFile__GetKeyIdList()

int GWENHYWFAR_CB GWEN_Crypt_TokenFile__GetKeyIdList ( GWEN_CRYPT_TOKEN ct,
uint32_t *  pIdList,
uint32_t *  pCount,
uint32_t  gid 
)

Definition at line 560 of file ctfile.c.

References DBG_INFO, GWEN_CRYPT_TOKEN_CONTEXT_KEYS, GWEN_Crypt_Token_Context_List_First(), GWEN_Crypt_Token_Context_List_Next(), GWEN_Crypt_TokenFile__ReloadIfNeeded(), GWEN_ERROR_BUFFER_OVERFLOW, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, and NULL.

Referenced by GWEN_Crypt_TokenFile_new().

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

◆ GWEN_Crypt_TokenFile__GetKeyInfo()

const GWEN_CRYPT_TOKEN_KEYINFO* GWENHYWFAR_CB GWEN_Crypt_TokenFile__GetKeyInfo ( GWEN_CRYPT_TOKEN ct,
uint32_t  id,
GWEN_UNUSED uint32_t  flags,
uint32_t  gid 
)

◆ GWEN_Crypt_TokenFile__OpenFile()

int GWEN_Crypt_TokenFile__OpenFile ( GWEN_CRYPT_TOKEN ct,
int  wr,
uint32_t  gid 
)

◆ GWEN_Crypt_TokenFile__Read()

int GWEN_Crypt_TokenFile__Read ( GWEN_CRYPT_TOKEN ct,
uint32_t  gid 
)

Definition at line 217 of file ctfile.c.

References DBG_ERROR, GWEN_Crypt_Token_GetTokenName(), GWEN_ERROR_IO, GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.

Referenced by GWEN_Crypt_TokenFile__ReadFile().

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

◆ GWEN_Crypt_TokenFile__ReadFile()

int GWEN_Crypt_TokenFile__ReadFile ( GWEN_CRYPT_TOKEN ct,
uint32_t  gid 
)

Definition at line 263 of file ctfile.c.

References DBG_INFO, GWEN_Crypt_Token_Context_List_Clear(), GWEN_Crypt_TokenFile__CloseFile(), GWEN_Crypt_TokenFile__OpenFile(), GWEN_Crypt_TokenFile__Read(), GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.

Referenced by GWEN_Crypt_TokenFile__ReloadIfNeeded(), and GWEN_Crypt_TokenFile_Open().

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

◆ GWEN_Crypt_TokenFile__ReloadIfNeeded()

int GWEN_Crypt_TokenFile__ReloadIfNeeded ( GWEN_CRYPT_TOKEN ct,
uint32_t  gid 
)

◆ GWEN_Crypt_TokenFile__SetContext()

int GWENHYWFAR_CB GWEN_Crypt_TokenFile__SetContext ( GWEN_CRYPT_TOKEN ct,
uint32_t  id,
const GWEN_CRYPT_TOKEN_CONTEXT nctx,
uint32_t  gid 
)

◆ GWEN_Crypt_TokenFile__SetKeyInfo()

int GWENHYWFAR_CB GWEN_Crypt_TokenFile__SetKeyInfo ( GWEN_CRYPT_TOKEN ct,
uint32_t  id,
const GWEN_CRYPT_TOKEN_KEYINFO ski,
uint32_t  gid 
)

Definition at line 830 of file ctfile.c.

References DBG_ERROR, DBG_INFO, GWEN_Crypt_Key_free(), GWEN_Crypt_Key_SetKeyNumber(), GWEN_Crypt_Key_SetKeyVersion(), GWEN_Crypt_KeyRsa_fromModExp(), GWEN_Crypt_Token_Context_List_First(), GWEN_Crypt_Token_Context_List_Next(), GWEN_CRYPT_TOKEN_KEYFLAGS_ACTIONMASK, GWEN_CRYPT_TOKEN_KEYFLAGS_HASACTIONFLAGS, GWEN_CRYPT_TOKEN_KEYFLAGS_HASEXPONENT, GWEN_CRYPT_TOKEN_KEYFLAGS_HASKEYNUMBER, GWEN_CRYPT_TOKEN_KEYFLAGS_HASKEYVERSION, GWEN_CRYPT_TOKEN_KEYFLAGS_HASMODULUS, GWEN_CRYPT_TOKEN_KEYFLAGS_HASSIGNCOUNTER, GWEN_CRYPT_TOKEN_KEYFLAGS_HASSTATUS, GWEN_Crypt_Token_KeyInfo_GetExponentData(), GWEN_Crypt_Token_KeyInfo_GetExponentLen(), GWEN_Crypt_Token_KeyInfo_GetFlags(), GWEN_Crypt_Token_KeyInfo_GetKeyNumber(), GWEN_Crypt_Token_KeyInfo_GetKeySize(), GWEN_Crypt_Token_KeyInfo_GetKeyVersion(), GWEN_Crypt_Token_KeyInfo_GetModulusData(), GWEN_Crypt_Token_KeyInfo_GetModulusLen(), GWEN_Crypt_Token_KeyInfo_GetSignCounter(), GWEN_Crypt_Token_KeyInfo_SetExponent(), GWEN_Crypt_Token_KeyInfo_SetFlags(), GWEN_Crypt_Token_KeyInfo_SetKeyNumber(), GWEN_Crypt_Token_KeyInfo_SetKeySize(), GWEN_Crypt_Token_KeyInfo_SetKeyVersion(), GWEN_Crypt_Token_KeyInfo_SetModulus(), GWEN_Crypt_Token_KeyInfo_SetSignCounter(), GWEN_Crypt_TokenFile__ReloadIfNeeded(), GWEN_Crypt_TokenFile__WriteFile(), GWEN_CTF_Context_GetLocalAuthKey(), GWEN_CTF_Context_GetLocalAuthKeyInfo(), GWEN_CTF_Context_GetLocalCryptKey(), GWEN_CTF_Context_GetLocalCryptKeyInfo(), GWEN_CTF_Context_GetLocalSignKey(), GWEN_CTF_Context_GetLocalSignKeyInfo(), GWEN_CTF_Context_GetRemoteAuthKey(), GWEN_CTF_Context_GetRemoteAuthKeyInfo(), GWEN_CTF_Context_GetRemoteCryptKey(), GWEN_CTF_Context_GetRemoteCryptKeyInfo(), GWEN_CTF_Context_GetRemoteSignKey(), GWEN_CTF_Context_GetRemoteSignKeyInfo(), GWEN_CTF_Context_GetTempLocalSignKey(), GWEN_CTF_Context_GetTempLocalSignKeyInfo(), GWEN_CTF_Context_SetRemoteAuthKey(), GWEN_CTF_Context_SetRemoteCryptKey(), GWEN_CTF_Context_SetRemoteSignKey(), GWEN_ERROR_INVALID, GWEN_ERROR_NOT_FOUND, GWEN_Gui_ProgressLog(), GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_LoggerLevel_Error, GWEN_LoggerLevel_Notice, I18N, and NULL.

Referenced by GWEN_Crypt_TokenFile_new().

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

◆ GWEN_Crypt_TokenFile__Sign()

int GWENHYWFAR_CB GWEN_Crypt_TokenFile__Sign ( GWEN_CRYPT_TOKEN ct,
uint32_t  keyId,
GWEN_CRYPT_PADDALGO a,
const uint8_t *  pInData,
uint32_t  inLen,
uint8_t *  pSignatureData,
uint32_t *  pSignatureLen,
uint32_t *  pSeqCounter,
uint32_t  gid 
)

◆ GWEN_Crypt_TokenFile__Verify()

int GWENHYWFAR_CB GWEN_Crypt_TokenFile__Verify ( GWEN_CRYPT_TOKEN ct,
uint32_t  keyId,
GWEN_CRYPT_PADDALGO a,
const uint8_t *  pInData,
uint32_t  inLen,
const uint8_t *  pSignatureData,
uint32_t  signatureLen,
uint32_t  seqCounter,
uint32_t  gid 
)

◆ GWEN_Crypt_TokenFile__Write()

int GWEN_Crypt_TokenFile__Write ( GWEN_CRYPT_TOKEN ct,
int  cr,
uint32_t  gid 
)

Definition at line 237 of file ctfile.c.

References DBG_ERROR, DBG_WARN, GWEN_Crypt_Token_GetTokenName(), GWEN_Crypt_Token_GetTypeName(), GWEN_ERROR_IO, GWEN_ERROR_NOT_SUPPORTED, GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.

Referenced by GWEN_Crypt_TokenFile__WriteFile().

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

◆ GWEN_Crypt_TokenFile__WriteFile()

int GWEN_Crypt_TokenFile__WriteFile ( GWEN_CRYPT_TOKEN ct,
int  cr,
uint32_t  gid 
)

◆ GWEN_Crypt_TokenFile_AddContext()

void GWEN_Crypt_TokenFile_AddContext ( GWEN_CRYPT_TOKEN ct,
GWEN_CRYPT_TOKEN_CONTEXT ctx 
)

Definition at line 378 of file ctfile.c.

References GWEN_Crypt_Token_Context_List_Add(), GWEN_CTF_Context_IsOfThisType(), and GWEN_INHERIT_GETDATA.

Referenced by GWEN_Crypt_TokenOHBCI__Decode(), and GWEN_Crypt_TokenOHBCI_Create().

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

◆ GWEN_Crypt_TokenFile_Close()

int GWENHYWFAR_CB GWEN_Crypt_TokenFile_Close ( GWEN_CRYPT_TOKEN ct,
int  abandon,
uint32_t  gid 
)

Definition at line 535 of file ctfile.c.

References GWEN_Crypt_Token_Context_List_Clear(), GWEN_Crypt_TokenFile__WriteFile(), and GWEN_INHERIT_GETDATA.

Referenced by GWEN_Crypt_TokenFile_new().

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

◆ GWEN_Crypt_TokenFile_Create()

int GWENHYWFAR_CB GWEN_Crypt_TokenFile_Create ( GWEN_CRYPT_TOKEN ct,
uint32_t  gid 
)

Definition at line 451 of file ctfile.c.

References DBG_ERROR, DBG_INFO, GWEN_Crypt_Token_GetTokenName(), GWEN_Crypt_TokenFile__WriteFile(), GWEN_ERROR_INVALID, GWEN_ERROR_IO, GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.

Referenced by GWEN_Crypt_TokenFile_new().

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

◆ GWEN_Crypt_TokenFile_freeData()

GWENHYWFAR_CB void GWEN_Crypt_TokenFile_freeData ( GWEN_UNUSED void *  bp,
void *  p 
)

Definition at line 2204 of file ctfile.c.

References GWEN_Crypt_Token_Context_List_free(), and GWEN_FREE_OBJECT.

Referenced by GWEN_Crypt_TokenFile_new().

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

◆ GWEN_Crypt_TokenFile_GetContext()

GWEN_CRYPT_TOKEN_CONTEXT* GWEN_Crypt_TokenFile_GetContext ( GWEN_CRYPT_TOKEN ct,
int  idx 
)

Definition at line 393 of file ctfile.c.

References GWEN_Crypt_Token_Context_List_First(), GWEN_Crypt_Token_Context_List_Next(), GWEN_INHERIT_GETDATA, and NULL.

Referenced by GWEN_Crypt_TokenOHBCI_Encode().

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

◆ GWEN_Crypt_TokenFile_new()

GWEN_CRYPT_TOKEN* GWEN_Crypt_TokenFile_new ( const char *  typeName,
const char *  tokenName 
)

Key ids: The left 16 bits contain the context index, the right 16 bits contain the key number:

  • xx01=localSignKey
  • xx02=localCryptKey
  • xx03=remoteSignKey
  • xx04=remoteCryptKey
  • xx05=localAuthKey
  • xx06=remoteAuthKey
  • xx07=tempLocalSignKey

Definition at line 2216 of file ctfile.c.

References GWEN_Crypt_Token_Context_List_new(), GWEN_Crypt_Token_Device_File, GWEN_Crypt_Token_new(), GWEN_Crypt_Token_SetActivateKeyFn(), GWEN_Crypt_Token_SetCloseFn(), GWEN_Crypt_Token_SetCreateFn(), GWEN_Crypt_Token_SetDecipherFn(), GWEN_Crypt_Token_SetEncipherFn(), GWEN_Crypt_Token_SetGenerateKeyFn(), GWEN_Crypt_Token_SetGetContextFn(), GWEN_Crypt_Token_SetGetContextIdListFn(), GWEN_Crypt_Token_SetGetKeyIdListFn(), GWEN_Crypt_Token_SetGetKeyInfoFn(), GWEN_Crypt_Token_SetOpenFn(), GWEN_Crypt_Token_SetSetContextFn(), GWEN_Crypt_Token_SetSetKeyInfoFn(), GWEN_Crypt_Token_SetSignFn(), GWEN_Crypt_Token_SetVerifyFn(), GWEN_Crypt_TokenFile__ActivateKey(), GWEN_Crypt_TokenFile__Decipher(), GWEN_Crypt_TokenFile__Encipher(), GWEN_Crypt_TokenFile__GenerateKey(), GWEN_Crypt_TokenFile__GetContext(), GWEN_Crypt_TokenFile__GetContextIdList(), GWEN_Crypt_TokenFile__GetKeyIdList(), GWEN_Crypt_TokenFile__GetKeyInfo(), GWEN_Crypt_TokenFile__SetContext(), GWEN_Crypt_TokenFile__SetKeyInfo(), GWEN_Crypt_TokenFile__Sign(), GWEN_Crypt_TokenFile__Verify(), GWEN_Crypt_TokenFile_Close(), GWEN_Crypt_TokenFile_Create(), GWEN_Crypt_TokenFile_freeData(), GWEN_Crypt_TokenFile_Open(), GWEN_INHERIT_SETDATA, and GWEN_NEW_OBJECT.

Referenced by GWEN_Crypt_TokenOHBCI_new().

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

◆ GWEN_Crypt_TokenFile_Open()

int GWENHYWFAR_CB GWEN_Crypt_TokenFile_Open ( GWEN_CRYPT_TOKEN ct,
GWEN_UNUSED int  admin,
uint32_t  gid 
)

Definition at line 515 of file ctfile.c.

References DBG_INFO, GWEN_Crypt_TokenFile__ReadFile(), GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.

Referenced by GWEN_Crypt_TokenFile_new().

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

◆ GWEN_Crypt_TokenFile_SetReadFn()

GWEN_CRYPT_TOKEN_FILE_READ_FN GWEN_Crypt_TokenFile_SetReadFn ( GWEN_CRYPT_TOKEN ct,
GWEN_CRYPT_TOKEN_FILE_READ_FN  f 
)

Definition at line 415 of file ctfile.c.

References GWEN_INHERIT_GETDATA.

Referenced by GWEN_Crypt_TokenOHBCI_new().

Here is the caller graph for this function:

◆ GWEN_Crypt_TokenFile_SetWriteFn()

GWEN_CRYPT_TOKEN_FILE_WRITE_FN GWEN_Crypt_TokenFile_SetWriteFn ( GWEN_CRYPT_TOKEN ct,
GWEN_CRYPT_TOKEN_FILE_WRITE_FN  f 
)

Definition at line 433 of file ctfile.c.

References GWEN_INHERIT_GETDATA.

Referenced by GWEN_Crypt_TokenOHBCI_new().

Here is the caller graph for this function: