1 From 5e899ec0dfff56ac15f9e19cccb8b8d17f792afd Mon Sep 17 00:00:00 2001
2 From: David Woodhouse <David.Woodhouse@intel.com>
3 Date: Tue, 12 Aug 2014 14:58:05 +0100
4 Subject: [PATCH 17/34] Always return success from auth-dialog
6 We want to store the secrets even when we ultimately failed to log in.
7 This was slightly suboptimal even before, when we were failing to remember
8 things like the 'autoconnect' and 'certsigs' secrets. But now with HOTP
9 it's particularly important that we keep track of which tokens have been
10 used *even* if we end up failing to log in.
12 Even if we don't get a valid login cookie, it's OK to return success.
14 auth-dialog/main.c | 7 +------
15 1 file changed, 1 insertion(+), 6 deletions(-)
17 diff --git a/auth-dialog/main.c b/auth-dialog/main.c
18 index b078d48..7171247 100644
19 --- a/auth-dialog/main.c
20 +++ b/auth-dialog/main.c
21 @@ -180,7 +180,6 @@ typedef struct auth_ui_data {
22 GtkWidget *last_notice_icon;
29 @@ -1376,7 +1375,6 @@ static gboolean cookie_obtained(auth_ui_data *ui_data)
30 gtk_widget_show_all(ui_data->ssl_box);
31 gtk_widget_set_sensitive(ui_data->cancel_button, FALSE);
33 - ui_data->retval = 1;
34 } else if (!ui_data->cookie_retval) {
35 OPENCONNECT_X509 *cert;
37 @@ -1413,13 +1411,11 @@ static gboolean cookie_obtained(auth_ui_data *ui_data)
38 keyring_store_passwords,
41 - ui_data->retval = 0;
45 /* no cookie; user cancellation */
46 gtk_widget_show (ui_data->no_form_label);
47 - ui_data->retval = 1;
50 g_hash_table_remove_all (ui_data->success_secrets);
51 @@ -1672,7 +1668,6 @@ static auth_ui_data *init_ui_data (char *vpn_name, GHashTable *options, GHashTab
52 auth_ui_data *ui_data;
54 ui_data = g_slice_new0(auth_ui_data);
55 - ui_data->retval = 1;
57 ui_data->form_entries = g_queue_new();
58 g_mutex_init(&ui_data->form_mutex);
59 @@ -1848,5 +1843,5 @@ int main (int argc, char **argv)
63 - return _ui_data->retval;