2017-01-02 14:42:13 +00:00
|
|
|
diff -up openssh-7.4p1/contrib/gnome-ssh-askpass2.c.progress openssh-7.4p1/contrib/gnome-ssh-askpass2.c
|
|
|
|
--- openssh-7.4p1/contrib/gnome-ssh-askpass2.c.progress 2016-12-19 05:59:41.000000000 +0100
|
|
|
|
+++ openssh-7.4p1/contrib/gnome-ssh-askpass2.c 2016-12-23 13:31:16.545211926 +0100
|
2005-11-22 16:48:57 +00:00
|
|
|
@@ -53,6 +53,7 @@
|
|
|
|
#include <unistd.h>
|
2020-09-21 11:19:05 +00:00
|
|
|
|
2005-11-22 16:48:57 +00:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
+#include <glib.h>
|
|
|
|
#include <gtk/gtk.h>
|
|
|
|
#include <gdk/gdkx.h>
|
2020-09-21 11:19:05 +00:00
|
|
|
#include <gdk/gdkkeysyms.h>
|
2020-02-17 10:57:13 +00:00
|
|
|
@@ -81,14 +82,25 @@ ok_dialog(GtkWidget *entry, gpointer dia
|
2020-09-21 11:19:05 +00:00
|
|
|
return 1;
|
2005-11-22 16:48:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
+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
|
2020-02-17 10:57:13 +00:00
|
|
|
passphrase_dialog(char *message, int prompt_type)
|
2005-11-22 16:48:57 +00:00
|
|
|
{
|
|
|
|
const char *failed;
|
|
|
|
char *passphrase, *local;
|
|
|
|
int result, grab_tries, grab_server, grab_pointer;
|
2020-02-17 10:57:13 +00:00
|
|
|
int buttons, default_response;
|
2017-01-02 14:42:13 +00:00
|
|
|
- GtkWidget *parent_window, *dialog, *entry;
|
|
|
|
+ GtkWidget *parent_window, *dialog, *entry, *progress, *hbox;
|
2005-11-22 16:48:57 +00:00
|
|
|
GdkGrabStatus status;
|
2020-09-21 11:19:05 +00:00
|
|
|
GdkColor fg, bg;
|
|
|
|
int fg_set = 0, bg_set = 0;
|
|
|
|
@@ -104,14 +116,19 @@ passphrase_dialog(char *message)
|
|
|
|
gtk_widget_modify_bg(dialog, GTK_STATE_NORMAL, &bg);
|
2005-11-22 16:48:57 +00:00
|
|
|
|
2020-09-21 11:19:05 +00:00
|
|
|
if (prompt_type == PROMPT_ENTRY || prompt_type == PROMPT_NONE) {
|
2020-02-17 10:57:13 +00:00
|
|
|
+ hbox = gtk_hbox_new(FALSE, 0);
|
|
|
|
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE,
|
|
|
|
+ FALSE, 0);
|
|
|
|
+ gtk_widget_show(hbox);
|
2005-11-22 16:48:57 +00:00
|
|
|
+
|
2020-02-17 10:57:13 +00:00
|
|
|
entry = gtk_entry_new();
|
2020-09-21 11:19:05 +00:00
|
|
|
if (fg_set)
|
|
|
|
gtk_widget_modify_fg(entry, GTK_STATE_NORMAL, &fg);
|
|
|
|
if (bg_set)
|
|
|
|
gtk_widget_modify_bg(entry, GTK_STATE_NORMAL, &bg);
|
2020-02-17 10:57:13 +00:00
|
|
|
gtk_box_pack_start(
|
|
|
|
- GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
|
|
|
|
- entry, FALSE, FALSE, 0);
|
2020-09-21 11:19:05 +00:00
|
|
|
+ GTK_BOX(hbox), entry, TRUE, FALSE, 0);
|
2020-02-17 10:57:13 +00:00
|
|
|
+ gtk_entry_set_width_chars(GTK_ENTRY(entry), 2);
|
|
|
|
gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
|
|
|
|
gtk_widget_grab_focus(entry);
|
2020-09-21 11:19:05 +00:00
|
|
|
if (prompt_type == PROMPT_ENTRY) {
|
|
|
|
@@ -130,6 +145,22 @@ passphrase_dialog(char *message)
|
|
|
|
g_signal_connect(G_OBJECT(entry), "key_press_event",
|
|
|
|
G_CALLBACK(check_none), dialog);
|
|
|
|
}
|
2020-02-17 10:57:13 +00:00
|
|
|
+
|
|
|
|
+ hbox = gtk_hbox_new(FALSE, 0);
|
2020-09-21 11:19:05 +00:00
|
|
|
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),
|
|
|
|
+ hbox, FALSE, FALSE, 8);
|
2020-02-17 10:57:13 +00:00
|
|
|
+ gtk_widget_show(hbox);
|
2005-12-20 14:44:46 +00:00
|
|
|
+
|
2020-02-17 10:57:13 +00:00
|
|
|
+ progress = gtk_progress_bar_new();
|
2005-11-22 16:48:57 +00:00
|
|
|
+
|
2020-09-21 11:19:05 +00:00
|
|
|
+ gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress),
|
|
|
|
+ "Passphrase length hidden intentionally");
|
2020-02-17 10:57:13 +00:00
|
|
|
+ gtk_box_pack_start(GTK_BOX(hbox), progress, TRUE,
|
|
|
|
+ TRUE, 5);
|
|
|
|
+ gtk_widget_show(progress);
|
|
|
|
+ g_signal_connect(G_OBJECT(entry), "changed",
|
|
|
|
+ G_CALLBACK(move_progress), progress);
|
|
|
|
+
|
|
|
|
}
|
2005-11-22 16:48:57 +00:00
|
|
|
|
2020-02-17 10:57:13 +00:00
|
|
|
/* Grab focus */
|