-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add password memory clear option (bump to v0.5)
Also updated website to point to github
- Loading branch information
Showing
1 changed file
with
22 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,6 +82,17 @@ static void sign_in_cb(PurpleAccount *account, gpointer data) { | |
return; | ||
} | ||
|
||
static void memory_clearing_function(PurpleAccount *account) { | ||
gboolean clear_memory = purple_prefs_get_bool( | ||
"/plugins/core/wincred/clear_memory"); | ||
if (clear_memory) { | ||
if (account->password != NULL) { | ||
g_free(account->password); | ||
account->password = NULL; | ||
} | ||
} | ||
} | ||
|
||
/* callback to whenever a function tries to connect | ||
* this needs to ensure that there is a password | ||
* this may happen if the password was disabled, then later re-enabled */ | ||
|
@@ -123,6 +134,9 @@ static void keyring_password_store(PurpleAccount *account) { | |
g_free(account_str); | ||
g_free(unicode_password); | ||
g_free(unicode_account_str); | ||
|
||
/* Clear password from pidgin memory */ | ||
memory_clearing_function(account); | ||
} | ||
|
||
/* retrive a password from the keyring */ | ||
|
@@ -182,13 +196,11 @@ static PurplePluginUiInfo prefs_info = { | |
|
||
static PurplePluginPrefFrame * get_pref_frame(PurplePlugin *plugin) { | ||
PurplePluginPrefFrame *frame = purple_plugin_pref_frame_new(); | ||
/*gchar *label = g_strdup_printf("Should passwords be wiped from pidgin's" | ||
" memory?\nNote: enabling this setting might break things,\n" | ||
"as some functions might need the password to be in memory."); | ||
gchar *label = g_strdup_printf("Clear plaintext passwords from memory"); | ||
PurplePluginPref *pref = purple_plugin_pref_new_with_name_and_label( | ||
"/plugins/core/wincred/clear_memory", | ||
label); | ||
purple_plugin_pref_frame_add(frame, pref);*/ | ||
purple_plugin_pref_frame_add(frame, pref); | ||
return frame; | ||
} | ||
|
||
|
@@ -204,19 +216,19 @@ static PurplePluginInfo info = { | |
PLUGIN_ID, | ||
"Windows Credentials", | ||
/* version */ | ||
"0.4", | ||
"0.5", | ||
|
||
"Save passwords as windows credentials instead of as plaintext", | ||
"Save passwords as windows credentials instead of as plaintext", | ||
"Ali Ebrahim", | ||
"http://code.google.com/p/pidgin-wincred/", | ||
"Ali Ebrahim <[email protected]>", | ||
"https://github.com/aebrahim/pidgin-wincred", | ||
|
||
plugin_load, | ||
plugin_unload, | ||
NULL, | ||
NULL, | ||
NULL, | ||
NULL, //&prefs_info, | ||
&prefs_info, | ||
NULL, | ||
NULL, | ||
NULL, | ||
|
@@ -226,7 +238,7 @@ static PurplePluginInfo info = { | |
|
||
static void init_plugin(PurplePlugin *plugin) { | ||
purple_prefs_add_none("/plugins/core/wincred"); | ||
//purple_prefs_add_bool("/plugins/core/wincred/clear_memory", FALSE); | ||
purple_prefs_add_bool("/plugins/core/wincred/clear_memory", FALSE); | ||
} | ||
|
||
PURPLE_INIT_PLUGIN(wincred, init_plugin, info) | ||
PURPLE_INIT_PLUGIN(wincred, init_plugin, info) |