2004-01-13 Christian Stimming <stimming@tuhh.de>

* src/import-export/hbci/hbci-interaction.c, gnc-hbci-utils.c: Add
	workaround code for openhbci/chipcard problem.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@9768 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2004-01-13 22:34:44 +00:00
parent 0af977933a
commit 371fe2043a
5 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2004-01-13 Christian Stimming <stimming@tuhh.de>
* src/import-export/hbci/hbci-interaction.c, gnc-hbci-utils.c: Add
workaround code for openhbci/chipcard problem.
2004-01-12 Derek Atkins <derek@ihtfp.com>
* src/app-utils/file-utils.[ch]: add gnc_getline() function

View File

@ -425,6 +425,7 @@ gnc_hbci_api_execute (GtkWidget *parent, HBCI_API *api,
return FALSE;
}
GNCInteractor_set_cache_valid (inter, TRUE);
if (resultcode <= 20) {
HBCI_Error_delete (err);
return TRUE;

View File

@ -52,6 +52,7 @@ GNCInteractor *gnc_hbci_api_interactors (HBCI_API *api, GtkWidget *parent)
data = g_new0 (GNCInteractor, 1);
data->parent = parent;
data->keepAlive = TRUE;
data->cache_valid = FALSE;
data->cache_pin =
gnc_lookup_boolean_option(PREF_TAB_ONLINE_BANKING,
"HBCI Remember PIN in memory",
@ -123,12 +124,19 @@ void GNCInteractor_delete(GNCInteractor *data)
data->dialog = NULL;
}
void GNCInteractor_set_cache_valid(GNCInteractor *i, gboolean value)
{
g_assert(i);
i->cache_valid = value;
}
void GNCInteractor_erasePIN(GNCInteractor *i)
{
g_assert(i);
if (i->pw != NULL)
g_free (memset (i->pw, 0, strlen (i->pw)));
i->pw = NULL;
i->cache_valid = FALSE;
i->user = NULL;
}
void GNCInteractor_reparent (GNCInteractor *i, GtkWidget *new_parent)
@ -207,7 +215,7 @@ static int msgInputPin(const HBCI_User *user,
g_free (msgstr);
}
else {
if (user && (user == data->user)) {
if (data->cache_valid && user && (user == data->user)) {
/* Cached user matches, so use cached PIN. */
/*printf("Got the cached PIN for user %s.\n", HBCI_User_userId (user));*/
*pinbuf = g_strdup (data->pw);

View File

@ -38,6 +38,7 @@ void GNCInteractor_hide(GNCInteractor *i);
void GNCInteractor_delete(GNCInteractor *i);
void GNCInteractor_erasePIN(GNCInteractor *i);
void GNCInteractor_reparent (GNCInteractor *i, GtkWidget *new_parent);
void GNCInteractor_set_cache_valid(GNCInteractor *i, gboolean value);
#endif

View File

@ -77,6 +77,8 @@ struct _inter_data
/* The cached PIN and the HBCI_User it's cached for. */
char *pw;
const HBCI_User *user;
/* Whether this PIN is really valid or not. */
gboolean cache_valid;
};
void delete_GNCInteractor (GNCInteractor *data);