gwenhywfar
4.3.1
|
#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>
Go to the source code of this file.
#define DISABLE_DEBUGLOG |
int GWENHYWFAR_CB GWEN_Crypt_TokenFile__ActivateKey | ( | GWEN_CRYPT_TOKEN * | ct, |
uint32_t | id, | ||
uint32_t | gid | ||
) |
Definition at line 990 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_GetModes(), GWEN_CRYPT_TOKEN_KEYFLAGS_CANSIGN, GWEN_CRYPT_TOKEN_KEYFLAGS_CANVERIFY, GWEN_CRYPT_TOKEN_KEYFLAGS_HASACTIONFLAGS, 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().
int GWEN_Crypt_TokenFile__CloseFile | ( | GWEN_CRYPT_TOKEN * | ct, |
uint32_t | gid | ||
) |
Definition at line 144 of file ctfile.c.
References DBG_ERROR, DBG_INFO, DBG_WARN, GWEN_Crypt_Token_GetTokenName(), GWEN_ERROR_INTERNAL, GWEN_ERROR_IO, GWEN_FSLock_free(), GWEN_FSLock_ResultOk, GWEN_FSLock_Unlock(), GWEN_Gui_ProgressLog(), GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, and GWEN_LoggerLevel_Warning.
Referenced by GWEN_Crypt_TokenFile__ReadFile(), and GWEN_Crypt_TokenFile__WriteFile().
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 | ||
) |
Definition at line 1848 of file ctfile.c.
References DBG_INFO, GWEN_Buffer_AdjustUsedBytes(), GWEN_Buffer_free(), GWEN_Buffer_GetMaxUnsegmentedWrite(), GWEN_Buffer_GetStart(), GWEN_Buffer_GetUsedBytes(), GWEN_Buffer_IncrementPos(), GWEN_Buffer_new(), GWEN_Crypt_Key_Decipher(), GWEN_Crypt_TokenFile__GetKey(), GWEN_Crypt_TokenFile__ReloadIfNeeded(), GWEN_ERROR_BUFFER_OVERFLOW, GWEN_ERROR_INVALID, GWEN_ERROR_NOT_FOUND, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_Padd_UnapplyPaddAlgo(), and NULL.
Referenced by GWEN_Crypt_TokenFile_new().
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 | ||
) |
Definition at line 1759 of file ctfile.c.
References DBG_INFO, GWEN_Buffer_AppendBytes(), GWEN_Buffer_free(), GWEN_Buffer_GetStart(), GWEN_Buffer_GetUsedBytes(), GWEN_Buffer_new(), GWEN_Buffer_Rewind(), GWEN_Crypt_Key_Encipher(), GWEN_Crypt_TokenFile__GetKey(), GWEN_Crypt_TokenFile__ReloadIfNeeded(), GWEN_ERROR_INVALID, GWEN_ERROR_NOT_FOUND, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_Padd_ApplyPaddAlgo(), and NULL.
Referenced by GWEN_Crypt_TokenFile_new().
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 1946 of file ctfile.c.
References DBG_DEBUG, DBG_INFO, GWEN_Crypt_CryptAlgo_GetChunkSize(), GWEN_Crypt_CryptAlgo_GetId(), GWEN_Crypt_CryptAlgo_GetKeySizeInBits(), 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_GeneratePair2(), GWEN_Crypt_KeyRsa_GetExponent(), GWEN_Crypt_KeyRsa_GetModulus(), GWEN_CRYPT_KEYRSA_MAX_KEYLENGTH, 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_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().
const GWEN_CRYPT_TOKEN_CONTEXT* GWENHYWFAR_CB GWEN_Crypt_TokenFile__GetContext | ( | GWEN_CRYPT_TOKEN * | ct, |
uint32_t | id, | ||
uint32_t | gid | ||
) |
Definition at line 1190 of file ctfile.c.
References DBG_INFO, GWEN_Crypt_Token_Context_GetId(), GWEN_Crypt_TokenFile__ReloadIfNeeded(), GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, and NULL.
Referenced by GWEN_Crypt_TokenFile_new().
int GWENHYWFAR_CB GWEN_Crypt_TokenFile__GetContextIdList | ( | GWEN_CRYPT_TOKEN * | ct, |
uint32_t * | pIdList, | ||
uint32_t * | pCount, | ||
uint32_t | gid | ||
) |
Definition at line 1136 of file ctfile.c.
References DBG_INFO, GWEN_Crypt_TokenFile__ReloadIfNeeded(), GWEN_ERROR_BUFFER_OVERFLOW, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, and NULL.
Referenced by GWEN_Crypt_TokenFile_new().
GWEN_CRYPT_KEY* GWEN_Crypt_TokenFile__GetKey | ( | GWEN_CRYPT_TOKEN * | ct, |
uint32_t | id, | ||
uint32_t | gid | ||
) |
Definition at line 1288 of file ctfile.c.
References DBG_INFO, GWEN_Crypt_TokenFile__ReloadIfNeeded(), GWEN_CTF_Context_GetLocalAuthKey(), GWEN_CTF_Context_GetLocalCryptKey(), GWEN_CTF_Context_GetLocalSignKey(), GWEN_CTF_Context_GetRemoteAuthKey(), GWEN_CTF_Context_GetRemoteCryptKey(), GWEN_CTF_Context_GetRemoteSignKey(), GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, and NULL.
Referenced by GWEN_Crypt_TokenFile__Decipher(), GWEN_Crypt_TokenFile__Encipher(), GWEN_Crypt_TokenFile__Sign(), and GWEN_Crypt_TokenFile__Verify().
int GWENHYWFAR_CB GWEN_Crypt_TokenFile__GetKeyIdList | ( | GWEN_CRYPT_TOKEN * | ct, |
uint32_t * | pIdList, | ||
uint32_t * | pCount, | ||
uint32_t | gid | ||
) |
Definition at line 545 of file ctfile.c.
References DBG_INFO, GWEN_CRYPT_TOKEN_CONTEXT_KEYS, GWEN_Crypt_TokenFile__ReloadIfNeeded(), GWEN_ERROR_BUFFER_OVERFLOW, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, and NULL.
Referenced by GWEN_Crypt_TokenFile_new().
const GWEN_CRYPT_TOKEN_KEYINFO* GWENHYWFAR_CB GWEN_Crypt_TokenFile__GetKeyInfo | ( | GWEN_CRYPT_TOKEN * | ct, |
uint32_t | id, | ||
uint32_t | flags, | ||
uint32_t | gid | ||
) |
Definition at line 603 of file ctfile.c.
References DBG_INFO, GWEN_Crypt_TokenFile__ReloadIfNeeded(), GWEN_CTF_Context_GetLocalAuthKeyInfo(), GWEN_CTF_Context_GetLocalCryptKeyInfo(), GWEN_CTF_Context_GetLocalSignKeyInfo(), GWEN_CTF_Context_GetRemoteAuthKeyInfo(), GWEN_CTF_Context_GetRemoteCryptKeyInfo(), GWEN_CTF_Context_GetRemoteSignKeyInfo(), GWEN_CTF_Context_GetTempLocalSignKeyInfo(), GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, and NULL.
Referenced by GWEN_Crypt_TokenFile_new().
int GWEN_Crypt_TokenFile__OpenFile | ( | GWEN_CRYPT_TOKEN * | ct, |
int | wr, | ||
uint32_t | gid | ||
) |
Definition at line 42 of file ctfile.c.
References DBG_ERROR, DBG_INFO, GWEN_Crypt_Token_GetTokenName(), GWEN_ERROR_IO, GWEN_ERROR_USER_ABORTED, GWEN_FSLock_free(), GWEN_FSLock_Lock(), GWEN_FSLock_new(), GWEN_FSLock_ResultOk, GWEN_FSLock_ResultUserAbort, GWEN_FSLock_TypeFile, GWEN_FSLock_Unlock(), GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.
Referenced by GWEN_Crypt_TokenFile__ReadFile(), and GWEN_Crypt_TokenFile__WriteFile().
int GWEN_Crypt_TokenFile__Read | ( | GWEN_CRYPT_TOKEN * | ct, |
uint32_t | gid | ||
) |
Definition at line 214 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().
int GWEN_Crypt_TokenFile__ReadFile | ( | GWEN_CRYPT_TOKEN * | ct, |
uint32_t | gid | ||
) |
Definition at line 258 of file ctfile.c.
References DBG_INFO, 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().
int GWEN_Crypt_TokenFile__ReloadIfNeeded | ( | GWEN_CRYPT_TOKEN * | ct, |
uint32_t | gid | ||
) |
Definition at line 333 of file ctfile.c.
References DBG_ERROR, DBG_NOTICE, DBG_WARN, GWEN_Crypt_Token_GetTokenName(), GWEN_Crypt_TokenFile__ReadFile(), GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.
Referenced by 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__GetKey(), GWEN_Crypt_TokenFile__GetKeyIdList(), GWEN_Crypt_TokenFile__GetKeyInfo(), GWEN_Crypt_TokenFile__SetContext(), GWEN_Crypt_TokenFile__SetKeyInfo(), GWEN_Crypt_TokenFile__Sign(), and GWEN_Crypt_TokenFile__Verify().
int GWENHYWFAR_CB GWEN_Crypt_TokenFile__SetContext | ( | GWEN_CRYPT_TOKEN * | ct, |
uint32_t | id, | ||
const GWEN_CRYPT_TOKEN_CONTEXT * | nctx, | ||
uint32_t | gid | ||
) |
Definition at line 1231 of file ctfile.c.
References DBG_INFO, GWEN_Crypt_Token_Context_GetAddress(), GWEN_Crypt_Token_Context_GetId(), GWEN_Crypt_Token_Context_GetPeerId(), GWEN_Crypt_Token_Context_GetPort(), GWEN_Crypt_Token_Context_GetServiceId(), GWEN_Crypt_Token_Context_GetSystemId(), GWEN_Crypt_Token_Context_GetUserId(), GWEN_Crypt_Token_Context_GetUserName(), GWEN_Crypt_Token_Context_SetAddress(), GWEN_Crypt_Token_Context_SetPeerId(), GWEN_Crypt_Token_Context_SetPort(), GWEN_Crypt_Token_Context_SetServiceId(), GWEN_Crypt_Token_Context_SetSystemId(), GWEN_Crypt_Token_Context_SetUserId(), GWEN_Crypt_Token_Context_SetUserName(), GWEN_Crypt_TokenFile__ReloadIfNeeded(), GWEN_ERROR_INVALID, GWEN_ERROR_NOT_FOUND, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, and NULL.
Referenced by GWEN_Crypt_TokenFile_new().
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 801 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_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().
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 | ||
) |
Definition at line 1335 of file ctfile.c.
References DBG_ERROR, DBG_INFO, DBG_WARN, GWEN_Buffer_AdjustUsedBytes(), GWEN_Buffer_AllocRoom(), GWEN_Buffer_AppendBytes(), GWEN_Buffer_free(), GWEN_Buffer_GetMaxUnsegmentedWrite(), GWEN_Buffer_GetStart(), GWEN_Buffer_GetUsedBytes(), GWEN_Buffer_IncrementPos(), GWEN_Buffer_new(), GWEN_Crypt_Key_Sign(), GWEN_Crypt_PaddAlgo_GetId(), GWEN_CRYPT_PADDALGOID, GWEN_Crypt_Token_Context_GetId(), GWEN_CRYPT_TOKEN_KEYFLAGS_HASSIGNCOUNTER, GWEN_Crypt_Token_KeyInfo_GetFlags(), GWEN_Crypt_Token_KeyInfo_GetModulusData(), GWEN_Crypt_Token_KeyInfo_GetModulusLen(), GWEN_Crypt_Token_KeyInfo_GetSignCounter(), GWEN_Crypt_Token_KeyInfo_SetSignCounter(), GWEN_Crypt_TokenFile__GetKey(), GWEN_Crypt_TokenFile__ReloadIfNeeded(), GWEN_Crypt_TokenFile__WriteFile(), GWEN_CTF_Context_GetLocalAuthKeyInfo(), GWEN_CTF_Context_GetLocalSignKeyInfo(), GWEN_ERROR_GENERIC, GWEN_ERROR_INVALID, GWEN_ERROR_NOT_FOUND, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_MDigest_free(), GWEN_MDigest_Sha256_new(), GWEN_Padd_AddPkcs1Pss(), GWEN_Padd_ApplyPaddAlgo(), and NULL.
Referenced by GWEN_Crypt_TokenFile_new().
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 | ||
) |
Definition at line 1530 of file ctfile.c.
References DBG_ERROR, DBG_INFO, DBG_WARN, GWEN_Buffer_AdjustUsedBytes(), GWEN_Buffer_AppendBytes(), GWEN_Buffer_free(), GWEN_Buffer_GetMaxUnsegmentedWrite(), GWEN_Buffer_GetStart(), GWEN_Buffer_GetUsedBytes(), GWEN_Buffer_IncrementPos(), GWEN_Buffer_new(), GWEN_Crypt_Key_Encipher(), GWEN_Crypt_Key_Verify(), GWEN_Crypt_PaddAlgo_GetId(), GWEN_CRYPT_PADDALGOID, GWEN_CRYPT_TOKEN_KEYFLAGS_HASSIGNCOUNTER, GWEN_Crypt_Token_KeyInfo_GetFlags(), GWEN_Crypt_Token_KeyInfo_GetModulusData(), GWEN_Crypt_Token_KeyInfo_GetModulusLen(), GWEN_Crypt_Token_KeyInfo_GetSignCounter(), GWEN_Crypt_Token_KeyInfo_SetSignCounter(), GWEN_Crypt_TokenFile__GetKey(), GWEN_Crypt_TokenFile__ReloadIfNeeded(), GWEN_Crypt_TokenFile__WriteFile(), GWEN_CTF_Context_GetRemoteAuthKeyInfo(), GWEN_CTF_Context_GetRemoteSignKeyInfo(), GWEN_ERROR_GENERIC, GWEN_ERROR_INVALID, GWEN_ERROR_NO_KEY, GWEN_ERROR_NOT_FOUND, GWEN_ERROR_VERIFY, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_MDigest_free(), GWEN_MDigest_Sha256_new(), GWEN_Padd_ApplyPaddAlgo(), GWEN_Padd_UnapplyPaddAlgo(), GWEN_Padd_VerifyPkcs1Pss(), and NULL.
Referenced by GWEN_Crypt_TokenFile_new().
int GWEN_Crypt_TokenFile__Write | ( | GWEN_CRYPT_TOKEN * | ct, |
int | cr, | ||
uint32_t | gid | ||
) |
Definition at line 233 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().
int GWEN_Crypt_TokenFile__WriteFile | ( | GWEN_CRYPT_TOKEN * | ct, |
int | cr, | ||
uint32_t | gid | ||
) |
Definition at line 297 of file ctfile.c.
References DBG_INFO, GWEN_Crypt_TokenFile__CloseFile(), GWEN_Crypt_TokenFile__OpenFile(), GWEN_Crypt_TokenFile__Write(), GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.
Referenced by GWEN_Crypt_TokenFile__ActivateKey(), GWEN_Crypt_TokenFile__GenerateKey(), GWEN_Crypt_TokenFile__SetKeyInfo(), GWEN_Crypt_TokenFile__Sign(), GWEN_Crypt_TokenFile__Verify(), GWEN_Crypt_TokenFile_Close(), and GWEN_Crypt_TokenFile_Create().
void GWEN_Crypt_TokenFile_AddContext | ( | GWEN_CRYPT_TOKEN * | ct, |
GWEN_CRYPT_TOKEN_CONTEXT * | ctx | ||
) |
Definition at line 370 of file ctfile.c.
References GWEN_CTF_Context_IsOfThisType(), and GWEN_INHERIT_GETDATA.
int GWENHYWFAR_CB GWEN_Crypt_TokenFile_Close | ( | GWEN_CRYPT_TOKEN * | ct, |
int | abandon, | ||
uint32_t | gid | ||
) |
Definition at line 521 of file ctfile.c.
References GWEN_Crypt_TokenFile__WriteFile(), and GWEN_INHERIT_GETDATA.
Referenced by GWEN_Crypt_TokenFile_new().
int GWENHYWFAR_CB GWEN_Crypt_TokenFile_Create | ( | GWEN_CRYPT_TOKEN * | ct, |
uint32_t | gid | ||
) |
Definition at line 439 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().
GWENHYWFAR_CB void GWEN_Crypt_TokenFile_freeData | ( | GWEN_UNUSED void * | bp, |
void * | p | ||
) |
Definition at line 2168 of file ctfile.c.
References GWEN_FREE_OBJECT.
Referenced by GWEN_Crypt_TokenFile_new().
GWEN_CRYPT_TOKEN_CONTEXT* GWEN_Crypt_TokenFile_GetContext | ( | GWEN_CRYPT_TOKEN * | ct, |
int | idx | ||
) |
Definition at line 384 of file ctfile.c.
References GWEN_INHERIT_GETDATA, and NULL.
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:
Definition at line 2179 of file ctfile.c.
References 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.
int GWENHYWFAR_CB GWEN_Crypt_TokenFile_Open | ( | GWEN_CRYPT_TOKEN * | ct, |
GWEN_UNUSED int | admin, | ||
uint32_t | gid | ||
) |
Definition at line 502 of file ctfile.c.
References DBG_INFO, GWEN_Crypt_TokenFile__ReadFile(), GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.
Referenced by GWEN_Crypt_TokenFile_new().
GWEN_CRYPT_TOKEN_FILE_READ_FN GWEN_Crypt_TokenFile_SetReadFn | ( | GWEN_CRYPT_TOKEN * | ct, |
GWEN_CRYPT_TOKEN_FILE_READ_FN | f | ||
) |
Definition at line 405 of file ctfile.c.
References GWEN_INHERIT_GETDATA.
GWEN_CRYPT_TOKEN_FILE_WRITE_FN GWEN_Crypt_TokenFile_SetWriteFn | ( | GWEN_CRYPT_TOKEN * | ct, |
GWEN_CRYPT_TOKEN_FILE_WRITE_FN | f | ||
) |
Definition at line 422 of file ctfile.c.
References GWEN_INHERIT_GETDATA.