|
![](https://seccdn.libravatar.org/avatar/bc84285c5ca7a993e6013b3df0cd5c6239503a336104c5aa0ee7e4edc788fe90?s=16&d=retro) |
6cf9b8e |
diff -up openssh-7.4p1/contrib/gnome-ssh-askpass2.c.progress openssh-7.4p1/contrib/gnome-ssh-askpass2.c
|
|
![](https://seccdn.libravatar.org/avatar/bc84285c5ca7a993e6013b3df0cd5c6239503a336104c5aa0ee7e4edc788fe90?s=16&d=retro) |
6cf9b8e |
--- openssh-7.4p1/contrib/gnome-ssh-askpass2.c.progress 2016-12-19 05:59:41.000000000 +0100
|
|
![](https://seccdn.libravatar.org/avatar/bc84285c5ca7a993e6013b3df0cd5c6239503a336104c5aa0ee7e4edc788fe90?s=16&d=retro) |
6cf9b8e |
+++ openssh-7.4p1/contrib/gnome-ssh-askpass2.c 2016-12-23 13:31:16.545211926 +0100
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
@@ -53,6 +53,7 @@
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
#include <string.h>
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
#include <unistd.h>
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
#include <X11/Xlib.h>
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+#include <glib.h>
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
#include <gtk/gtk.h>
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
#include <gdk/gdkx.h>
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
|
|
![](https://seccdn.libravatar.org/avatar/bc84285c5ca7a993e6013b3df0cd5c6239503a336104c5aa0ee7e4edc788fe90?s=16&d=retro) |
6cf9b8e |
@@ -81,13 +82,24 @@ ok_dialog(GtkWidget *entry, gpointer dia
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
gtk_dialog_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
}
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+static void
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+move_progress(GtkWidget *entry, gpointer progress)
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+{
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+ gdouble step;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+ g_return_if_fail(GTK_IS_PROGRESS_BAR(progress));
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+ step = g_random_double_range(0.03, 0.1);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+ gtk_progress_bar_set_pulse_step(GTK_PROGRESS_BAR(progress), step);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+ gtk_progress_bar_pulse(GTK_PROGRESS_BAR(progress));
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+}
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
static int
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
passphrase_dialog(char *message)
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
{
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
const char *failed;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
char *passphrase, *local;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
int result, grab_tries, grab_server, grab_pointer;
|
|
![](https://seccdn.libravatar.org/avatar/bc84285c5ca7a993e6013b3df0cd5c6239503a336104c5aa0ee7e4edc788fe90?s=16&d=retro) |
6cf9b8e |
- GtkWidget *parent_window, *dialog, *entry;
|
|
![](https://seccdn.libravatar.org/avatar/bc84285c5ca7a993e6013b3df0cd5c6239503a336104c5aa0ee7e4edc788fe90?s=16&d=retro) |
6cf9b8e |
+ GtkWidget *parent_window, *dialog, *entry, *progress, *hbox;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
GdkGrabStatus status;
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
grab_server = (getenv("GNOME_SSH_ASKPASS_GRAB_SERVER") != NULL);
|
|
![](https://seccdn.libravatar.org/avatar/bc84285c5ca7a993e6013b3df0cd5c6239503a336104c5aa0ee7e4edc788fe90?s=16&d=retro) |
6cf9b8e |
@@ -104,14 +116,32 @@ passphrase_dialog(char *message)
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
"%s",
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
message);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+ hbox = gtk_hbox_new(FALSE, 0);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE,
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
bb93ea2 |
+ FALSE, 0);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+ gtk_widget_show(hbox);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
entry = gtk_entry_new();
|
|
![](https://seccdn.libravatar.org/avatar/bc84285c5ca7a993e6013b3df0cd5c6239503a336104c5aa0ee7e4edc788fe90?s=16&d=retro) |
6cf9b8e |
gtk_box_pack_start(
|
|
![](https://seccdn.libravatar.org/avatar/bc84285c5ca7a993e6013b3df0cd5c6239503a336104c5aa0ee7e4edc788fe90?s=16&d=retro) |
6cf9b8e |
- GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), entry,
|
|
![](https://seccdn.libravatar.org/avatar/bc84285c5ca7a993e6013b3df0cd5c6239503a336104c5aa0ee7e4edc788fe90?s=16&d=retro) |
6cf9b8e |
- FALSE, FALSE, 0);
|
|
![](https://seccdn.libravatar.org/avatar/bc84285c5ca7a993e6013b3df0cd5c6239503a336104c5aa0ee7e4edc788fe90?s=16&d=retro) |
6cf9b8e |
+ GTK_BOX(hbox), entry,
|
|
![](https://seccdn.libravatar.org/avatar/bc84285c5ca7a993e6013b3df0cd5c6239503a336104c5aa0ee7e4edc788fe90?s=16&d=retro) |
6cf9b8e |
+ TRUE, FALSE, 0);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+ gtk_entry_set_width_chars(GTK_ENTRY(entry), 2);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
gtk_widget_grab_focus(entry);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
gtk_widget_show(entry);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
bb93ea2 |
+ hbox = gtk_hbox_new(FALSE, 0);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
bb93ea2 |
+ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE,
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
bb93ea2 |
+ FALSE, 8);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
bb93ea2 |
+ gtk_widget_show(hbox);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
bb93ea2 |
+
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+ progress = gtk_progress_bar_new();
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
bb93ea2 |
+
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
bb93ea2 |
+ gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress), "Passphrase length hidden intentionally");
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+ gtk_box_pack_start(GTK_BOX(hbox), progress, TRUE,
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
bb93ea2 |
+ TRUE, 5);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+ gtk_widget_show(progress);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
gtk_window_set_title(GTK_WINDOW(dialog), "OpenSSH");
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
ec52761 |
gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE);
|
|
![](https://seccdn.libravatar.org/avatar/bc84285c5ca7a993e6013b3df0cd5c6239503a336104c5aa0ee7e4edc788fe90?s=16&d=retro) |
6cf9b8e |
@@ -120,6 +150,8 @@ passphrase_dialog(char *message)
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
g_signal_connect(G_OBJECT(entry), "activate",
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
G_CALLBACK(ok_dialog), dialog);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+ g_signal_connect(G_OBJECT(entry), "changed",
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
+ G_CALLBACK(move_progress), progress);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
gtk_window_set_keep_above(GTK_WINDOW(dialog), TRUE);
|
|
![](https://seccdn.libravatar.org/avatar/dedd662cd18533e6b346ba9fced85f9b3e4c6ff8041e69506ad783477abed011?s=16&d=retro) |
09d7e68 |
|