gwenhywfar 5.12.0
gui_passwd.c File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

static int _tryReadCachedPasswd (GWEN_GUI *gui, const char *pwName, char *buffer, int minLen, int maxLen)
static int _tryReadPasswdViaInputBox (GWEN_GUI *gui, uint32_t flags, const char *token, const char *title, const char *text, char *buffer, int minLen, int maxLen, uint32_t guiid)
static int _tryReadStoredPasswd (GWEN_GUI *gui, const char *pwName, uint32_t flags, const char *token, char *buffer, int minLen, int maxLen)
static void _tryStorePasswdInCacheAndStorage (GWEN_GUI *gui, const char *pwName, const char *token, const char *pwBuffer, int userWantsToStorePasswd)
static int GWEN_Gui__HashPair (const char *token, const char *pin, GWEN_BUFFER *buf)
int GWEN_Gui_GetPassword (uint32_t flags, const char *token, const char *title, const char *text, char *buffer, int minLen, int maxLen, GWEN_GUI_PASSWORD_METHOD methodId, GWEN_DB_NODE *methodParams, uint32_t guiid)
static int GWENHYWFAR_CB GWEN_Gui_Internal_GetPassword (GWEN_GUI *gui, uint32_t flags, const char *token, const char *title, const char *text, char *pwBuffer, int minLen, int maxLen, GWEN_UNUSED GWEN_GUI_PASSWORD_METHOD methodId, GWEN_UNUSED GWEN_DB_NODE *methodParams, uint32_t guiid)
static int GWENHYWFAR_CB GWEN_Gui_Internal_SetPasswordStatus (GWEN_GUI *gui, const char *token, const char *pin, GWEN_GUI_PASSWORD_STATUS status, GWEN_UNUSED uint32_t guiid)
int GWEN_Gui_SetPasswordStatus (const char *token, const char *pin, GWEN_GUI_PASSWORD_STATUS status, uint32_t guiid)

Function Documentation

◆ _tryReadCachedPasswd()

int _tryReadCachedPasswd ( GWEN_GUI * gui,
const char * pwName,
char * buffer,
int minLen,
int maxLen )
static

Definition at line 180 of file gui_passwd.c.

References DBG_ERROR, GWEN_DB_GetCharValue(), GWEN_LOGDOMAIN, and NULL.

Referenced by _tryReadStoredPasswd().

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

◆ _tryReadPasswdViaInputBox()

int _tryReadPasswdViaInputBox ( GWEN_GUI * gui,
uint32_t flags,
const char * token,
const char * title,
const char * text,
char * buffer,
int minLen,
int maxLen,
uint32_t guiid )
static

◆ _tryReadStoredPasswd()

int _tryReadStoredPasswd ( GWEN_GUI * gui,
const char * pwName,
uint32_t flags,
const char * token,
char * buffer,
int minLen,
int maxLen )
static

Definition at line 141 of file gui_passwd.c.

References _tryReadCachedPasswd(), DBG_INFO, GWEN_ERROR_NO_DATA, GWEN_ERROR_NOT_FOUND, GWEN_GUI_INPUT_FLAGS_CONFIRM, GWEN_LOGDOMAIN, and GWEN_PasswordStore_GetPassword().

Referenced by GWEN_Gui_Internal_GetPassword().

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

◆ _tryStorePasswdInCacheAndStorage()

void _tryStorePasswdInCacheAndStorage ( GWEN_GUI * gui,
const char * pwName,
const char * token,
const char * pwBuffer,
int userWantsToStorePasswd )
static

Definition at line 269 of file gui_passwd.c.

References DBG_WARN, GWEN_DB_FLAGS_OVERWRITE_VARS, GWEN_DB_SetCharValue(), GWEN_LOGDOMAIN, and GWEN_PasswordStore_SetPassword().

Referenced by GWEN_Gui_Internal_GetPassword().

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

◆ GWEN_Gui__HashPair()

int GWEN_Gui__HashPair ( const char * token,
const char * pin,
GWEN_BUFFER * buf )
static

◆ GWEN_Gui_GetPassword()

int GWEN_Gui_GetPassword ( uint32_t flags,
const char * token,
const char * title,
const char * text,
char * buffer,
int minLen,
int maxLen,
GWEN_GUI_PASSWORD_METHOD methodId,
GWEN_DB_NODE * methodParams,
uint32_t guiid )

This function retrieves a password or pin. The implementation might want to use a cache or a password file. The default implementation simply asks the user for input. The function GWEN_Gui_SetPasswordStatus() is used to communicate the status of a password. So if this function here uses a password cache then the callback for GWEN_Gui_SetPasswordStatus() should also be implemented.

NOTE: AqBanking uses GWEN_Gui_PasswordMethod_OpticalHHD as methodId for all optical TAN input methods like "chipTAN optisch" and others. To determine which optical method is actually requested see the DB variable "tanMethodId" inside the methodParams parameter. The data to send to the TAN generator can be found in the toplevel variable "challenge".

Parameters
flagsflags, see GWEN_GUI_INPUT_FLAGS_CONFIRM ff.
tokenunique identification for the password or pin. This can be used to read the password from a cache or file.
titletitle of the input box
textText of the box: UTF-8, with both a normal text and a HTML variant of the text in the same string. See text restrictions note above.
bufferbuffer to store the response in. Must have at least room for maxLen bytes
minLenminimal length of the password (if 0 then there is no low limit)
maxLensize of the buffer including the trailing NULL character. This means that if you want to ask the user for a PIN of at most 4 characters you need to supply a buffer of at least 5 bytes and provide a 5 as maxLen.
methodIdId of the pin/password/tan entry.
methodParamsadditional parameters for the pin/password/tan entry, content depends on the methodId (my be NULL for simple text input)
guiidid as returned by GWEN_Gui_ProgressStart or GWEN_Gui_ShowBox)

Definition at line 346 of file gui_passwd.c.

References GWEN_ERROR_NOT_IMPLEMENTED, and GWEN_Gui_GetGui().

Referenced by GWEN_Crypt_Token_GetPin(), and test10().

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

◆ GWEN_Gui_Internal_GetPassword()

int GWENHYWFAR_CB GWEN_Gui_Internal_GetPassword ( GWEN_GUI * gui,
uint32_t flags,
const char * token,
const char * title,
const char * text,
char * pwBuffer,
int minLen,
int maxLen,
GWEN_UNUSED GWEN_GUI_PASSWORD_METHOD methodId,
GWEN_UNUSED GWEN_DB_NODE * methodParams,
uint32_t guiid )
static

◆ GWEN_Gui_Internal_SetPasswordStatus()

◆ GWEN_Gui_SetPasswordStatus()

int GWEN_Gui_SetPasswordStatus ( const char * token,
const char * pin,
GWEN_GUI_PASSWORD_STATUS status,
uint32_t guiid )

This functions sets the status of a password.

Parameters
guiidid as returned by GWEN_Gui_ProgressStart or GWEN_Gui_ShowBox)

Definition at line 371 of file gui_passwd.c.

References GWEN_ERROR_NOT_IMPLEMENTED, and GWEN_Gui_GetGui().

Referenced by GWEN_Crypt_Token_SetPinStatus().

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