gwenhywfar  5.4.1
Macros | Functions
ctplugin.c File Reference
#include "ctplugin_p.h"
#include "i18n_l.h"
#include <gwenhywfar/gwenhywfar.h>
#include <gwenhywfar/misc.h>
#include <gwenhywfar/debug.h>
#include <gwenhywfar/gui.h>
#include <gwenhywfar/pathmanager.h>
Include dependency graph for ctplugin.c:

Go to the source code of this file.

Macros

#define DIRSEP   "/"
 
#define DISABLE_DEBUGLOG
 

Functions

int GWEN_Crypt_Token_ModuleFini (void)
 
int GWEN_Crypt_Token_ModuleInit (void)
 
int GWEN_Crypt_Token_Plugin_CheckToken (GWEN_PLUGIN *pl, GWEN_BUFFER *name)
 
GWEN_CRYPT_TOKENGWEN_Crypt_Token_Plugin_CreateToken (GWEN_PLUGIN *pl, const char *name)
 
GWENHYWFAR_CB void GWEN_Crypt_Token_Plugin_FreeData (GWEN_UNUSED void *bp, void *p)
 
GWEN_CRYPT_TOKEN_DEVICE GWEN_Crypt_Token_Plugin_GetDeviceType (const GWEN_PLUGIN *pl)
 
GWEN_PLUGINGWEN_Crypt_Token_Plugin_new (GWEN_PLUGIN_MANAGER *mgr, GWEN_CRYPT_TOKEN_DEVICE devType, const char *typeName, const char *fileName)
 
GWEN_CRYPT_TOKEN_PLUGIN_CHECKTOKEN_FN GWEN_Crypt_Token_Plugin_SetCheckTokenFn (GWEN_PLUGIN *pl, GWEN_CRYPT_TOKEN_PLUGIN_CHECKTOKEN_FN fn)
 
GWEN_CRYPT_TOKEN_PLUGIN_CREATETOKEN_FN GWEN_Crypt_Token_Plugin_SetCreateTokenFn (GWEN_PLUGIN *pl, GWEN_CRYPT_TOKEN_PLUGIN_CREATETOKEN_FN fn)
 
int GWEN_Crypt_Token_PluginManager_CheckToken (GWEN_PLUGIN_MANAGER *pm, GWEN_CRYPT_TOKEN_DEVICE devt, GWEN_BUFFER *typeName, GWEN_BUFFER *tokenName, uint32_t guiid)
 
GWEN_PLUGIN_DESCRIPTION_LIST2GWEN_Crypt_Token_PluginManager_GetPluginDescrs (GWEN_PLUGIN_MANAGER *pm, GWEN_CRYPT_TOKEN_DEVICE devt)
 

Macro Definition Documentation

◆ DIRSEP

#define DIRSEP   "/"

Definition at line 30 of file ctplugin.c.

Referenced by GWEN_Crypt_Token_ModuleInit().

◆ DISABLE_DEBUGLOG

#define DISABLE_DEBUGLOG

Definition at line 14 of file ctplugin.c.

Function Documentation

◆ GWEN_Crypt_Token_ModuleFini()

int GWEN_Crypt_Token_ModuleFini ( void  )

Definition at line 81 of file ctplugin.c.

References DBG_ERROR, GWEN_CRYPT_TOKEN_PLUGIN_TYPENAME, GWEN_LOGDOMAIN, GWEN_PluginManager_FindPluginManager(), GWEN_PluginManager_free(), and GWEN_PluginManager_Unregister().

Referenced by GWEN_Fini().

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

◆ GWEN_Crypt_Token_ModuleInit()

int GWEN_Crypt_Token_ModuleInit ( void  )

◆ GWEN_Crypt_Token_Plugin_CheckToken()

int GWEN_Crypt_Token_Plugin_CheckToken ( GWEN_PLUGIN pl,
GWEN_BUFFER name 
)

This function is used to let a crypt token plugin check whether it supports a given plugin.

Initially the given buffers may contain some values to narrow the search. For chip cards the name argument may contain the serial number of the card (if known). For file based crypt tokens this argument must contain the path to the file to check.

This function should return one of the following error codes:

  • GWEN_SUCCESS: CryptToken is supported by this plugin, the buffers for typeName, subTypeName and name are updated accordingly
  • GWEN_ERROR_CT_NOT_IMPLEMENTED: function not implmented
  • GWEN_ERROR_CT_NOT_SUPPORTED: medium not supported by this plugin
  • GWEN_ERROR_CT_BAD_NAME: Medium is supported but the name doesn't match that of the currently checked medium
  • GWEN_ERROR_CT_IO_ERROR: any type of IO error occurred
  • other codes as appropriate

Definition at line 160 of file ctplugin.c.

References DBG_INFO, GWEN_ERROR_NOT_IMPLEMENTED, GWEN_INHERIT_GETDATA, and GWEN_LOGDOMAIN.

Referenced by GWEN_Crypt_Token_PluginManager_CheckToken().

Here is the caller graph for this function:

◆ GWEN_Crypt_Token_Plugin_CreateToken()

GWEN_CRYPT_TOKEN* GWEN_Crypt_Token_Plugin_CreateToken ( GWEN_PLUGIN pl,
const char *  name 
)

Definition at line 142 of file ctplugin.c.

References DBG_WARN, GWEN_INHERIT_GETDATA, GWEN_LOGDOMAIN, and NULL.

Referenced by createToken(), cryptWithNew(), getCryptToken(), and signWithNew().

Here is the caller graph for this function:

◆ GWEN_Crypt_Token_Plugin_FreeData()

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

Definition at line 131 of file ctplugin.c.

References GWEN_FREE_OBJECT.

Referenced by GWEN_Crypt_Token_Plugin_new().

Here is the caller graph for this function:

◆ GWEN_Crypt_Token_Plugin_GetDeviceType()

GWEN_CRYPT_TOKEN_DEVICE GWEN_Crypt_Token_Plugin_GetDeviceType ( const GWEN_PLUGIN pl)

Definition at line 178 of file ctplugin.c.

References GWEN_INHERIT_GETDATA.

◆ GWEN_Crypt_Token_Plugin_new()

GWEN_PLUGIN* GWEN_Crypt_Token_Plugin_new ( GWEN_PLUGIN_MANAGER mgr,
GWEN_CRYPT_TOKEN_DEVICE  devType,
const char *  typeName,
const char *  fileName 
)

Definition at line 112 of file ctplugin.c.

References GWEN_Crypt_Token_Plugin_FreeData(), GWEN_INHERIT_SETDATA, GWEN_NEW_OBJECT, and GWEN_Plugin_new().

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_Token_Plugin_SetCheckTokenFn()

GWEN_CRYPT_TOKEN_PLUGIN_CHECKTOKEN_FN GWEN_Crypt_Token_Plugin_SetCheckTokenFn ( GWEN_PLUGIN pl,
GWEN_CRYPT_TOKEN_PLUGIN_CHECKTOKEN_FN  fn 
)

Definition at line 209 of file ctplugin.c.

References GWEN_INHERIT_GETDATA.

Referenced by GWEN_Crypt_TokenOHBCI_Plugin_new().

Here is the caller graph for this function:

◆ GWEN_Crypt_Token_Plugin_SetCreateTokenFn()

GWEN_CRYPT_TOKEN_PLUGIN_CREATETOKEN_FN GWEN_Crypt_Token_Plugin_SetCreateTokenFn ( GWEN_PLUGIN pl,
GWEN_CRYPT_TOKEN_PLUGIN_CREATETOKEN_FN  fn 
)

Definition at line 191 of file ctplugin.c.

References GWEN_INHERIT_GETDATA.

Referenced by GWEN_Crypt_TokenOHBCI_Plugin_new().

Here is the caller graph for this function:

◆ GWEN_Crypt_Token_PluginManager_CheckToken()

int GWEN_Crypt_Token_PluginManager_CheckToken ( GWEN_PLUGIN_MANAGER cm,
GWEN_CRYPT_TOKEN_DEVICE  devt,
GWEN_BUFFER typeName,
GWEN_BUFFER tokenName,
uint32_t  guiid 
)

◆ GWEN_Crypt_Token_PluginManager_GetPluginDescrs()

GWEN_PLUGIN_DESCRIPTION_LIST2* GWEN_Crypt_Token_PluginManager_GetPluginDescrs ( GWEN_PLUGIN_MANAGER pm,
GWEN_CRYPT_TOKEN_DEVICE  devt 
)