[network-manager-applet] gsm: remove 4-character PIN length restriction (bgo #582435)



commit 98965c4b7cb322a4e9248d63ab2b5746a43c55b3
Author: Dan Williams <dcbw redhat com>
Date:   Sun Feb 28 23:13:32 2010 -0800

    gsm: remove 4-character PIN length restriction (bgo #582435)
    
    At least part of the fix; need to figure out if the rest of the stack
    handles it too (NM & MM).

 src/applet-device-gsm.c |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/src/applet-device-gsm.c b/src/applet-device-gsm.c
index c460cab..31a3bd0 100644
--- a/src/applet-device-gsm.c
+++ b/src/applet-device-gsm.c
@@ -446,14 +446,18 @@ pin_entry_changed (GtkEditable *editable, gpointer user_data)
 	const char *s;
 	int i;
 	gboolean valid = FALSE;
+	guint32 len;
 
 	s = gtk_entry_get_text (GTK_ENTRY (editable));
-	if (s && strlen (s) == 4) {
-		valid = TRUE;
-		for (i = 0; i < 4; i++) {
-			if (!g_ascii_isdigit (s[i])) {
-				valid = FALSE;
-				break;
+	if (s) {
+		len = strlen (s);
+		if ((len >= 4) && (len <= 8)) {
+			valid = TRUE;
+			for (i = 0; i < len; i++) {
+				if (!g_ascii_isdigit (s[i])) {
+					valid = FALSE;
+					break;
+				}
 			}
 		}
 	}
@@ -675,8 +679,8 @@ ask_for_pin_puk (NMDevice *device,
 
 	w = gtk_entry_new ();
 	*out_secret_entry = GTK_ENTRY (w);
-	gtk_entry_set_max_length (GTK_ENTRY (w), 4);
-	gtk_entry_set_width_chars (GTK_ENTRY (w), 4);
+	gtk_entry_set_max_length (GTK_ENTRY (w), 8);
+	gtk_entry_set_width_chars (GTK_ENTRY (w), 8);
 	gtk_entry_set_activates_default (GTK_ENTRY (w), TRUE);
 	gtk_box_pack_start (box, w, FALSE, FALSE, 0);
 	g_signal_connect (w, "changed", G_CALLBACK (pin_entry_changed), ok_button);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]