After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 652460 - Widget for entering password with non-pageable memory + DH
Widget for entering password with non-pageable memory + DH
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Florian Müllner
gnome-shell-maint
Depends on: 652459 652653
Blocks:
 
 
Reported: 2011-06-13 14:01 UTC by Stef Walter
Modified: 2012-02-29 19:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use non-pageable memory for gnome-keyring passwords (12.33 KB, patch)
2012-02-10 16:44 UTC, Stef Walter
needs-work Details | Review
Rebase on new keyring prompt patch (11.30 KB, patch)
2012-02-29 09:08 UTC, Stef Walter
reviewed Details | Review
Updated for review. (11.24 KB, patch)
2012-02-29 13:11 UTC, Stef Walter
committed Details | Review

Description Stef Walter 2011-06-13 14:01:51 UTC
In order for gnome-keyring to prompt for passwords in gnome-shell we want to be able to get the password through all the different layers of javascript, dbus, and what have you, without it getting stuck in logs, paged memory, or other leaks.

In gnome-keyring we do this by using DH, and encrypting the password in transit.

Need a subclass of StEntry, which holds the password in non-pageable memory. It will also handle one side of the DH stuff.
Comment 1 Stef Walter 2012-02-10 16:44:09 UTC
Using another approach now that we have ClutterTextBuffer. No need to subclass StEntry or any of that strangeness.
Comment 2 Stef Walter 2012-02-10 16:44:19 UTC
Created attachment 207274 [details] [review]
Use non-pageable memory for gnome-keyring passwords

 * Use a ClutterTextBuffer that allocates non-pageable
   memory to hold passwords for gnome-keyring, ssh, gpg
 * Requires gcr 3.3.5 and clutter 1.9.4
Comment 3 Florian Müllner 2012-02-29 07:32:03 UTC
Comment on attachment 207274 [details] [review]
Use non-pageable memory for gnome-keyring passwords

Patch needs rebasing, getting it off the review list
Comment 4 Stef Walter 2012-02-29 09:08:03 UTC
Created attachment 208660 [details] [review]
Rebase on new keyring prompt patch
Comment 5 Florian Müllner 2012-02-29 12:01:27 UTC
Review of attachment 208660 [details] [review]:

Looks mostly good, minor comments below:

::: src/shell-keyring-prompt.c
@@ +655,3 @@
 {
+  ClutterTextBuffer *buffer;
+  ClutterActor *text;

Unused variable

::: src/shell-secure-text-buffer.c
@@ +54,3 @@
+static const gchar *
+shell_secure_text_buffer_real_get_text (ClutterTextBuffer *buffer,
+                                     gsize             *n_bytes)

wrong indentation

@@ +75,3 @@
+                                        guint              position,
+                                        const gchar       *chars,
+                                        guint              n_chars)

Dito.

@@ +132,3 @@
+shell_secure_text_buffer_real_delete_text (ClutterTextBuffer *buffer,
+                                        guint              position,
+                                        guint              n_chars)

...

@@ +138,3 @@
+
+  if (position > self->text_chars)
+    position = self->text_chars;

Any reason for not returning 0 here?

@@ +163,3 @@
+  self->text_chars = 0;
+  self->text_bytes = 0;
+  self->text_size = 0;

Unnecessary initialization (all instances returned by g_type_create_instance are already memset(0))
Comment 6 Stef Walter 2012-02-29 13:11:09 UTC
Created attachment 208680 [details] [review]
Updated for review.

Good catch on the n_chars :)
Comment 7 Florian Müllner 2012-02-29 13:23:41 UTC
Review of attachment 208680 [details] [review]:

Looks good, though the n_chars change is not what I meant

::: src/shell-secure-text-buffer.c
@@ +140,3 @@
+    {
+      position = self->text_chars;
+      n_chars = 0;

Mmh, that's not what I meant - n_chars would have been set to 0 with the next condition anyway (unless it already was 0 to begin with). I was just suggesting this shortcut:

if (position > self->text_chars)
  return 0;

If you don't like that, I would actually prefer the previous patch version :)
(but up to you really, neither variant is wrong)
Comment 8 Stef Walter 2012-02-29 19:33:51 UTC
Comment on attachment 208680 [details] [review]
Updated for review.


Ah right. Reverted that bit to the previous code. That way it matches what I've done elsewhere in similar buffer code for Gtk+.