g_free(ritem->auth->username);
ritem->auth->username = g_strdup(attr->value);
}
- /* (str) Auth pass */
+ /* (str) Auth pass - save directly to password store */
if (!strcmp(attr->name, "auth_pass")) {
gsize len = 0;
guchar *pwd = g_base64_decode(attr->value, &len);
- g_free(ritem->auth->password);
- ritem->auth->password = (gchar *)pwd;
+ rssyl_passwd_set(ritem, (gchar *)pwd);
}
/* (str) Official title */
if( !strcmp(attr->name, "official_title")) {
/* (str) Auth user */
if (ri->auth->username != NULL)
xml_tag_add_attr(tag, xml_attr_new("auth_user", ri->auth->username));
- /* (str) Auth pass */
- if (ri->auth->password != NULL) {
- gchar *pwd = g_base64_encode(ri->auth->password, strlen(ri->auth->password));
- xml_tag_add_attr(tag, xml_attr_new("auth_pass", pwd));
- g_free(pwd);
- }
/* (str) Official title */
if( ri->official_title != NULL )
xml_tag_add_attr(tag, xml_attr_new("official_title", ri->official_title));
#include <glib.h>
#include <folder.h>
+#include <passwordstore.h>
#include "libfeed/feed.h"
#define IS_RSSYL_FOLDER_ITEM(item) \
(item->folder->klass == rssyl_folder_get_class())
+#define rssyl_passwd_set(ritem, pwd) \
+ passwd_store_set(PWS_PLUGIN, PLUGIN_NAME, ritem->url, pwd, FALSE)
+#define rssyl_passwd_get(ritem) \
+ passwd_store_get(PWS_PLUGIN, PLUGIN_NAME, ritem->url)
+
#endif /* __RSSYL_H */
}
auth_pass = (gchar *)gtk_entry_get_text(GTK_ENTRY(ritem->feedprop->auth_password));
- if (auth_pass != NULL) {
- if (ritem->auth->password) {
- g_free(ritem->auth->password);
- }
- ritem->auth->password = g_strdup(auth_pass);
- }
+ rssyl_passwd_set(ritem, auth_pass);
use_default_ri = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(ritem->feedprop->default_refresh_interval));
/* Auth password */
feedprop->auth_password = gtk_entry_new();
gtk_entry_set_visibility(GTK_ENTRY(feedprop->auth_password), FALSE);
- gtk_entry_set_text(GTK_ENTRY(feedprop->auth_password),
- ritem->auth->password);
+ gchar *pwd = rssyl_passwd_get(ritem);
+ gtk_entry_set_text(GTK_ENTRY(feedprop->auth_password), pwd);
+ if (pwd != NULL) {
+ memset(pwd, 0, strlen(pwd));
+ g_free(pwd);
+ }
/* "Use default refresh interval" checkbutton */
feedprop->default_refresh_interval = gtk_check_button_new_with_mnemonic(
ctx->success = TRUE;
ctx->ready = FALSE;
+ if (ritem->auth->type != FEED_AUTH_NONE)
+ ritem->auth->password = rssyl_passwd_get(ritem);
+
feed_set_timeout(ctx->feed, prefs_common_get_prefs()->io_timeout_secs);
feed_set_cookies_path(ctx->feed, rssyl_prefs_get()->cookies_path);
feed_set_ssl_verify_peer(ctx->feed, ritem->ssl_verify_peer);
/* Fetch the feed file */
rssyl_fetch_feed(ctx, verbose);
+ if (ritem->auth != NULL && ritem->auth->password != NULL) {
+ memset(ritem->auth->password, 0, strlen(ritem->auth->password));
+ g_free(ritem->auth->password);
+ }
+
debug_print("RSSyl: fetch done; success == %s\n",
ctx->success ? "TRUE" : "FALSE");