2008-07-23 18:34:08 +00:00
|
|
|
diff -up openssh-5.1p1/contrib/gnome-ssh-askpass2.c.progress openssh-5.1p1/contrib/gnome-ssh-askpass2.c
|
|
|
|
--- openssh-5.1p1/contrib/gnome-ssh-askpass2.c.progress 2008-07-23 19:05:26.000000000 +0200
|
|
|
|
+++ openssh-5.1p1/contrib/gnome-ssh-askpass2.c 2008-07-23 19:05:26.000000000 +0200
|
2005-11-22 16:48:57 +00:00
|
|
|
@@ -53,6 +53,7 @@
|
|
|
|
#include <string.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <X11/Xlib.h>
|
|
|
|
+#include <glib.h>
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include <gdk/gdkx.h>
|
|
|
|
|
2008-07-23 18:34:08 +00:00
|
|
|
@@ -83,13 +84,24 @@ ok_dialog(GtkWidget *entry, gpointer dia
|
2005-11-22 16:48:57 +00:00
|
|
|
gtk_dialog_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
+static void
|
|
|
|
+move_progress(GtkWidget *entry, gpointer progress)
|
|
|
|
+{
|
|
|
|
+ gdouble step;
|
|
|
|
+ g_return_if_fail(GTK_IS_PROGRESS_BAR(progress));
|
|
|
|
+
|
|
|
|
+ step = g_random_double_range(0.03, 0.1);
|
|
|
|
+ gtk_progress_bar_set_pulse_step(GTK_PROGRESS_BAR(progress), step);
|
|
|
|
+ gtk_progress_bar_pulse(GTK_PROGRESS_BAR(progress));
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
static int
|
|
|
|
passphrase_dialog(char *message)
|
|
|
|
{
|
|
|
|
const char *failed;
|
|
|
|
char *passphrase, *local;
|
|
|
|
int result, grab_tries, grab_server, grab_pointer;
|
|
|
|
- GtkWidget *dialog, *entry;
|
|
|
|
+ GtkWidget *dialog, *entry, *progress, *hbox;
|
|
|
|
GdkGrabStatus status;
|
|
|
|
|
|
|
|
grab_server = (getenv("GNOME_SSH_ASKPASS_GRAB_SERVER") != NULL);
|
2008-07-23 18:34:08 +00:00
|
|
|
@@ -102,13 +114,31 @@ passphrase_dialog(char *message)
|
2005-11-22 16:48:57 +00:00
|
|
|
"%s",
|
|
|
|
message);
|
|
|
|
|
|
|
|
+ hbox = gtk_hbox_new(FALSE, 0);
|
|
|
|
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE,
|
2005-12-20 14:44:46 +00:00
|
|
|
+ FALSE, 0);
|
2005-11-22 16:48:57 +00:00
|
|
|
+ gtk_widget_show(hbox);
|
|
|
|
+
|
|
|
|
entry = gtk_entry_new();
|
|
|
|
- gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), entry, FALSE,
|
2005-12-20 14:44:46 +00:00
|
|
|
+ gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE,
|
|
|
|
FALSE, 0);
|
2005-11-22 16:48:57 +00:00
|
|
|
+ gtk_entry_set_width_chars(GTK_ENTRY(entry), 2);
|
|
|
|
gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
|
|
|
|
gtk_widget_grab_focus(entry);
|
|
|
|
gtk_widget_show(entry);
|
|
|
|
|
2005-12-20 14:44:46 +00:00
|
|
|
+ hbox = gtk_hbox_new(FALSE, 0);
|
|
|
|
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE,
|
|
|
|
+ FALSE, 8);
|
|
|
|
+ gtk_widget_show(hbox);
|
|
|
|
+
|
2005-11-22 16:48:57 +00:00
|
|
|
+ progress = gtk_progress_bar_new();
|
2005-12-20 14:44:46 +00:00
|
|
|
+
|
|
|
|
+ gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress), "Passphrase length hidden intentionally");
|
2005-11-22 16:48:57 +00:00
|
|
|
+ gtk_box_pack_start(GTK_BOX(hbox), progress, TRUE,
|
2005-12-20 14:44:46 +00:00
|
|
|
+ TRUE, 5);
|
2005-11-22 16:48:57 +00:00
|
|
|
+ gtk_widget_show(progress);
|
|
|
|
+
|
|
|
|
gtk_window_set_title(GTK_WINDOW(dialog), "OpenSSH");
|
|
|
|
gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
|
2008-07-23 18:34:08 +00:00
|
|
|
gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE);
|
|
|
|
@@ -119,6 +149,8 @@ passphrase_dialog(char *message)
|
2005-11-22 16:48:57 +00:00
|
|
|
gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
|
|
|
|
g_signal_connect(G_OBJECT(entry), "activate",
|
|
|
|
G_CALLBACK(ok_dialog), dialog);
|
|
|
|
+ g_signal_connect(G_OBJECT(entry), "changed",
|
|
|
|
+ G_CALLBACK(move_progress), progress);
|
|
|
|
|
|
|
|
gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE);
|
|
|
|
|