gwenhywfar 5.10.1
Functions
ohbci.c File Reference
#include "ohbci_p.h"
#include "i18n_l.h"
#include <gwenhywfar/debug.h>
#include <gwenhywfar/misc.h>
#include <gwenhywfar/padd.h>
#include <gwenhywfar/gui.h>
#include <gwenhywfar/ctfile_be.h>
#include <gwenhywfar/ctplugin_be.h>
#include <gwenhywfar/ctf_context_be.h>
#include <gwenhywfar/text.h>
#include <gwenhywfar/cryptkeysym.h>
#include <gwenhywfar/cryptkeyrsa.h>
#include <gwenhywfar/smalltresor.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
Include dependency graph for ohbci.c:

Go to the source code of this file.

Functions

GWEN_PLUGINct_ohbci_factory (GWEN_PLUGIN_MANAGER *pm, const char *modName, const char *fileName)
 
int GWEN_Crypt_TokenOHBCI__Decode (GWEN_CRYPT_TOKEN *ct, GWEN_BUFFER *dbuf)
 
void GWEN_Crypt_TokenOHBCI__DecodeKey (GWEN_UNUSED GWEN_CRYPT_TOKEN *ct, GWEN_TAG16 *keyTlv, GWEN_DB_NODE *dbKeys, const char *keyName)
 
int GWEN_Crypt_TokenOHBCI__DecryptFile (GWEN_CRYPT_TOKEN *ct, GWEN_BUFFER *fbuf, int trynum, uint32_t gid)
 
int GWEN_Crypt_TokenOHBCI__DecryptFile16 (GWEN_CRYPT_TOKEN *ct, GWEN_BUFFER *dbuf, int tryNum, uint32_t gid)
 
int GWEN_Crypt_TokenOHBCI__DecryptTresor (GWEN_CRYPT_TOKEN *ct, GWEN_BUFFER *fbuf, int trynum, uint32_t gid)
 
int GWEN_Crypt_TokenOHBCI__EncodeKey (const GWEN_CRYPT_KEY *key, GWEN_CRYPT_TOKEN_CONTEXT *fct, unsigned int tagType, int wantPublic, int isCrypt, GWEN_BUFFER *dbuf)
 
int GWEN_Crypt_TokenOHBCI__EnsurePassword (GWEN_CRYPT_TOKEN *ct, int trynum, int confirm, uint32_t gid)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenOHBCI_ChangePin (GWEN_CRYPT_TOKEN *ct, GWEN_UNUSED int admin, GWEN_UNUSED uint32_t gid)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenOHBCI_Close (GWEN_CRYPT_TOKEN *ct, int abandon, uint32_t gid)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenOHBCI_Create (GWEN_CRYPT_TOKEN *ct, uint32_t gid)
 
int GWEN_Crypt_TokenOHBCI_Encode (GWEN_CRYPT_TOKEN *ct, GWEN_BUFFER *dbuf)
 
void GWENHYWFAR_CB GWEN_Crypt_TokenOHBCI_FreeData (GWEN_UNUSED void *bp, void *p)
 
GWEN_CRYPT_TOKENGWEN_Crypt_TokenOHBCI_new (GWEN_UNUSED GWEN_PLUGIN_MANAGER *pm, const char *name)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenOHBCI_Open (GWEN_CRYPT_TOKEN *ct, int manage, uint32_t gid)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenOHBCI_Plugin_CheckToken (GWEN_UNUSED GWEN_PLUGIN *pl, GWEN_BUFFER *name)
 
GWEN_CRYPT_TOKEN *GWENHYWFAR_CB GWEN_Crypt_TokenOHBCI_Plugin_CreateToken (GWEN_PLUGIN *pl, const char *name)
 
GWEN_PLUGINGWEN_Crypt_TokenOHBCI_Plugin_new (GWEN_PLUGIN_MANAGER *pm, const char *modName, const char *fileName)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenOHBCI_Read (GWEN_CRYPT_TOKEN *ct, int fd, uint32_t gid)
 
int GWENHYWFAR_CB GWEN_Crypt_TokenOHBCI_Write (GWEN_CRYPT_TOKEN *ct, int fd, GWEN_UNUSED int cre, uint32_t gid)
 

Function Documentation

◆ ct_ohbci_factory()

GWEN_PLUGIN * ct_ohbci_factory ( GWEN_PLUGIN_MANAGER pm,
const char *  modName,
const char *  fileName 
)

Definition at line 53 of file ohbci.c.

References GWEN_Crypt_TokenOHBCI_Plugin_new().

Here is the call graph for this function:

◆ GWEN_Crypt_TokenOHBCI__Decode()

int GWEN_Crypt_TokenOHBCI__Decode ( GWEN_CRYPT_TOKEN ct,
GWEN_BUFFER dbuf 
)

Definition at line 872 of file ohbci.c.

References DBG_ERROR, DBG_INFO, DBG_WARN, GWEN_Buffer_GetBytesLeft(), GWEN_Buffer_Rewind(), GWEN_Crypt_Key_free(), GWEN_Crypt_Key_GetCryptAlgoId(), GWEN_Crypt_Key_GetKeyNumber(), GWEN_Crypt_Key_GetKeySize(), GWEN_Crypt_Key_GetKeyVersion(), GWEN_Crypt_KeyRsa_AddFlags(), GWEN_CRYPT_KEYRSA_FLAGS_DIRECTSIGN, GWEN_Crypt_KeyRsa_fromDb(), GWEN_Crypt_KeyRsa_GetExponent(), GWEN_Crypt_KeyRsa_GetModulus(), GWEN_CRYPT_KEYRSA_MAX_KEYLENGTH, GWEN_Crypt_Token_Context_free(), GWEN_Crypt_Token_Context_SetAddress(), GWEN_Crypt_Token_Context_SetAuthSignKeyId(), GWEN_Crypt_Token_Context_SetAuthVerifyKeyId(), GWEN_Crypt_Token_Context_SetDecipherKeyId(), GWEN_Crypt_Token_Context_SetEncipherKeyId(), GWEN_Crypt_Token_Context_SetId(), GWEN_Crypt_Token_Context_SetPeerId(), GWEN_Crypt_Token_Context_SetPort(), GWEN_Crypt_Token_Context_SetServiceId(), GWEN_Crypt_Token_Context_SetSignKeyId(), GWEN_Crypt_Token_Context_SetSystemId(), GWEN_Crypt_Token_Context_SetTempSignKeyId(), GWEN_Crypt_Token_Context_SetUserId(), GWEN_Crypt_Token_Context_SetVerifyKeyId(), 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_free(), GWEN_Crypt_Token_KeyInfo_new(), GWEN_Crypt_Token_KeyInfo_SetExponent(), GWEN_Crypt_Token_KeyInfo_SetKeyDescr(), 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_AddContext(), GWEN_Crypt_TokenOHBCI__DecodeKey(), GWEN_CTF_Context_new(), 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_SetRemoteAuthKey(), GWEN_CTF_Context_SetRemoteAuthKeyInfo(), GWEN_CTF_Context_SetRemoteCryptKey(), GWEN_CTF_Context_SetRemoteCryptKeyInfo(), GWEN_CTF_Context_SetRemoteSignKey(), GWEN_CTF_Context_SetRemoteSignKeyInfo(), GWEN_CTF_Context_SetTempLocalSignKey(), GWEN_CTF_Context_SetTempLocalSignKeyInfo(), GWEN_DB_FLAGS_OVERWRITE_VARS, GWEN_DB_GetCharValue(), GWEN_DB_GetGroup(), GWEN_DB_Group_free(), GWEN_DB_Group_new(), GWEN_DB_SetIntValue(), GWEN_ERROR_BAD_PIN, GWEN_ERROR_NOT_SUPPORTED, GWEN_Gui_ProgressLog(), GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, GWEN_LoggerLevel_Warning, GWEN_PATH_FLAGS_NAMEMUSTEXIST, GWEN_Tag16_free(), GWEN_Tag16_fromBuffer(), GWEN_Tag16_GetTagData(), GWEN_Tag16_GetTagLength(), GWEN_Tag16_GetTagType(), I18N, and NULL.

Referenced by GWEN_Crypt_TokenOHBCI__DecryptFile(), and GWEN_Crypt_TokenOHBCI__DecryptTresor().

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

◆ GWEN_Crypt_TokenOHBCI__DecodeKey()

void GWEN_Crypt_TokenOHBCI__DecodeKey ( GWEN_UNUSED GWEN_CRYPT_TOKEN ct,
GWEN_TAG16 keyTlv,
GWEN_DB_NODE dbKeys,
const char *  keyName 
)

◆ GWEN_Crypt_TokenOHBCI__DecryptFile()

int GWEN_Crypt_TokenOHBCI__DecryptFile ( GWEN_CRYPT_TOKEN ct,
GWEN_BUFFER fbuf,
int  trynum,
uint32_t  gid 
)

◆ GWEN_Crypt_TokenOHBCI__DecryptFile16()

int GWEN_Crypt_TokenOHBCI__DecryptFile16 ( GWEN_CRYPT_TOKEN ct,
GWEN_BUFFER dbuf,
int  tryNum,
uint32_t  gid 
)

◆ GWEN_Crypt_TokenOHBCI__DecryptTresor()

int GWEN_Crypt_TokenOHBCI__DecryptTresor ( GWEN_CRYPT_TOKEN ct,
GWEN_BUFFER fbuf,
int  trynum,
uint32_t  gid 
)

◆ GWEN_Crypt_TokenOHBCI__EncodeKey()

int GWEN_Crypt_TokenOHBCI__EncodeKey ( const GWEN_CRYPT_KEY key,
GWEN_CRYPT_TOKEN_CONTEXT fct,
unsigned int  tagType,
int  wantPublic,
int  isCrypt,
GWEN_BUFFER dbuf 
)

◆ GWEN_Crypt_TokenOHBCI__EnsurePassword()

int GWEN_Crypt_TokenOHBCI__EnsurePassword ( GWEN_CRYPT_TOKEN ct,
int  trynum,
int  confirm,
uint32_t  gid 
)

◆ GWEN_Crypt_TokenOHBCI_ChangePin()

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

Definition at line 2320 of file ohbci.c.

References GWEN_INHERIT_GETDATA.

Referenced by GWEN_Crypt_TokenOHBCI_new().

Here is the caller graph for this function:

◆ GWEN_Crypt_TokenOHBCI_Close()

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

Definition at line 2486 of file ohbci.c.

References DBG_INFO, GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.

Referenced by GWEN_Crypt_TokenOHBCI_new().

Here is the caller graph for this function:

◆ GWEN_Crypt_TokenOHBCI_Create()

int GWENHYWFAR_CB GWEN_Crypt_TokenOHBCI_Create ( GWEN_CRYPT_TOKEN ct,
uint32_t  gid 
)

◆ GWEN_Crypt_TokenOHBCI_Encode()

int GWEN_Crypt_TokenOHBCI_Encode ( GWEN_CRYPT_TOKEN ct,
GWEN_BUFFER dbuf 
)

◆ GWEN_Crypt_TokenOHBCI_FreeData()

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

Definition at line 230 of file ohbci.c.

References GWEN_FREE_OBJECT.

Referenced by GWEN_Crypt_TokenOHBCI_new().

Here is the caller graph for this function:

◆ GWEN_Crypt_TokenOHBCI_new()

GWEN_CRYPT_TOKEN * GWEN_Crypt_TokenOHBCI_new ( GWEN_UNUSED GWEN_PLUGIN_MANAGER pm,
const char *  name 
)

◆ GWEN_Crypt_TokenOHBCI_Open()

int GWENHYWFAR_CB GWEN_Crypt_TokenOHBCI_Open ( GWEN_CRYPT_TOKEN ct,
int  manage,
uint32_t  gid 
)

Definition at line 2465 of file ohbci.c.

References DBG_INFO, GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.

Referenced by GWEN_Crypt_TokenOHBCI_new().

Here is the caller graph for this function:

◆ GWEN_Crypt_TokenOHBCI_Plugin_CheckToken()

int GWENHYWFAR_CB GWEN_Crypt_TokenOHBCI_Plugin_CheckToken ( GWEN_UNUSED GWEN_PLUGIN pl,
GWEN_BUFFER name 
)

Definition at line 108 of file ohbci.c.

References DBG_ERROR, DBG_INFO, GWEN_Buffer_GetStart(), GWEN_Buffer_GetUsedBytes(), GWEN_ERROR_BAD_NAME, GWEN_ERROR_IO, GWEN_ERROR_NOT_SUPPORTED, GWEN_Gui_ProgressLog(), GWEN_LOGDOMAIN, GWEN_LoggerLevel_Info, and GWEN_LoggerLevel_Notice.

Referenced by GWEN_Crypt_TokenOHBCI_Plugin_new().

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

◆ GWEN_Crypt_TokenOHBCI_Plugin_CreateToken()

GWEN_CRYPT_TOKEN *GWENHYWFAR_CB GWEN_Crypt_TokenOHBCI_Plugin_CreateToken ( GWEN_PLUGIN pl,
const char *  name 
)

Definition at line 89 of file ohbci.c.

References GWEN_Crypt_TokenOHBCI_new(), and GWEN_Plugin_GetManager().

Referenced by GWEN_Crypt_TokenOHBCI_Plugin_new().

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

◆ GWEN_Crypt_TokenOHBCI_Plugin_new()

GWEN_PLUGIN * GWEN_Crypt_TokenOHBCI_Plugin_new ( GWEN_PLUGIN_MANAGER pm,
const char *  modName,
const char *  fileName 
)

◆ GWEN_Crypt_TokenOHBCI_Read()

int GWENHYWFAR_CB GWEN_Crypt_TokenOHBCI_Read ( GWEN_CRYPT_TOKEN ct,
int  fd,
uint32_t  gid 
)

◆ GWEN_Crypt_TokenOHBCI_Write()

int GWENHYWFAR_CB GWEN_Crypt_TokenOHBCI_Write ( GWEN_CRYPT_TOKEN ct,
int  fd,
GWEN_UNUSED int  cre,
uint32_t  gid 
)