Display nm-secure-lock in appet if wlan is secure

2011-06-11 Thread Goldstein
Hi guys,

I'm new to the list. Sorry if this kind of message is not appropriate.

The thing is that I find it a bit annoying that nm applet does not show
the nm-secure-lock icon on top of the nm-signal-XX icon when I'm
connected to a secure wlan network. I connect to may different wlans on
a daily basis. In some of them my packets are transmitted encrypted, in
some others are transmitted in the clear, and it would be great to have
a visual aid to remind me to which kind of wlan I'm connected to (so I
don't, for example, check my email using POP3).

I wanted to provide a proper patch for the issue but I haven't been able
to compile nm from the sources. However, I attach an incomplete and
untested patch, that maybe one of you guys can use. Do you think
something like this could be implemented in trunk?

Thank you very much for your help.

Regards,

G.

 
--- applet-device-wifi.c	2010-08-10 20:47:03.0 +0200
+++ applet-device-wifi.c.patched	2011-06-11 13:10:15.0 +0200
@@ -1262,6 +1262,16 @@
 	g_free (esc_ssid);
 }
 
+int current_wlan_is_secure(){
+// If current connection is secure
+//   return 1
+// else
+// TODO: Unimplemented @todo: This function should check from some global
+// variable if the wireless connection is secure or not.
+return 0;
+}
+
+
 static GdkPixbuf *
 wireless_get_icon (NMDevice *device,
NMDeviceState state,
@@ -1271,7 +1281,7 @@
 {
 	NMSettingConnection *s_con;
 	NMAccessPoint *ap;
-	GdkPixbuf *pixbuf = NULL;
+	GdkPixbuf *pixbuf = NULL, *top = NULL;
 	const char *id;
 	char *ssid = NULL;
 
@@ -1330,6 +1340,16 @@
 			pixbuf = nma_icon_check_and_load (nm-signal-00, applet-wireless_00_icon, applet);
 			*tip = g_strdup_printf (_(Wireless network connection '%s' active), id);
 		}
+
+/* If the AP is secure, composite the lock icon on top of the signal bars */
+if ( current_wlan_is_secure() ) {
+top = nma_icon_check_and_load (nm-secure-lock, applet-secure_lock_icon, applet);
+gdk_pixbuf_composite (top, pixbuf, 0, 0, gdk_pixbuf_get_width (top),
+  gdk_pixbuf_get_height (top),
+  0, 0, 1.0, 1.0,
+  GDK_INTERP_NEAREST, 255);
+}
+
 		break;
 	default:
 		break;
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Display nm-secure-lock in appet if wlan is secure

2011-06-11 Thread Pantelis Koukousoulas
On Sat, Jun 11, 2011 at 2:26 PM, Goldstein goldstein...@gmail.com wrote:
 Hi guys,

 I'm new to the list. Sorry if this kind of message is not appropriate.

 The thing is that I find it a bit annoying that nm applet does not show the
 nm-secure-lock icon on top of the nm-signal-XX icon when I'm connected to a
 secure wlan network. I connect to may different wlans on a daily basis. In
 some of them my packets are transmitted encrypted, in some others are
 transmitted in the clear, and it would be great to have a visual aid to
 remind me to which kind of wlan I'm connected to (so I don't, for example,
 check my email using POP3).

 I wanted to provide a proper patch for the issue but I haven't been able to
 compile nm from the sources. However, I attach an incomplete and untested
 patch, that maybe one of you guys can use. Do you think something like this
 could be implemented in trunk?

IMHO, independent of the usefulness of the patch, you should really use
application level encryption (ssh, https, pop3s) for transfer of data you
consider sensitive. Even in the case of an encrypted wireless link, it is
far from impossible that someone is sniffing the traffic at the router
or even ISP.

What's more, there is no guarantee that these logs are not persistent,
which means a lot of people might look and search them.

Again, the above is independent of the potential value ot the patch itself.

Cheers,
Pantelis
___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list


Re: Display nm-secure-lock in appet if wlan is secure

2011-06-11 Thread Goldstein
On 06/11/2011 07:06 PM, Pantelis Koukousoulas wrote:
 On Sat, Jun 11, 2011 at 2:26 PM, Goldstein goldstein...@gmail.com wrote:
 Hi guys,

 I'm new to the list. Sorry if this kind of message is not appropriate.

 The thing is that I find it a bit annoying that nm applet does not show the
 nm-secure-lock icon on top of the nm-signal-XX icon when I'm connected to a
 secure wlan network. I connect to may different wlans on a daily basis. In
 some of them my packets are transmitted encrypted, in some others are
 transmitted in the clear, and it would be great to have a visual aid to
 remind me to which kind of wlan I'm connected to (so I don't, for example,
 check my email using POP3).

 I wanted to provide a proper patch for the issue but I haven't been able to
 compile nm from the sources. However, I attach an incomplete and untested
 patch, that maybe one of you guys can use. Do you think something like this
 could be implemented in trunk?
 IMHO, independent of the usefulness of the patch, you should really use
 application level encryption (ssh, https, pop3s) for transfer of data you
 consider sensitive. Even in the case of an encrypted wireless link, it is
 far from impossible that someone is sniffing the traffic at the router
 or even ISP.

 What's more, there is no guarantee that these logs are not persistent,
 which means a lot of people might look and search them.

 Again, the above is independent of the potential value ot the patch itself.

Hi Pantelis,

Thank you for your warning. However I am already aware of the security
implications of transmitting data in the clear through the Internet. I
just wanted to present a simple usage scenario for the functionality I'm
requesting.

Regards,

G.




___
networkmanager-list mailing list
networkmanager-list@gnome.org
http://mail.gnome.org/mailman/listinfo/networkmanager-list