Index: daemon/data/gnome-keyring.schemas.in
===================================================================
--- daemon/data/gnome-keyring.schemas.in	(revision 1466)
+++ daemon/data/gnome-keyring.schemas.in	(working copy)
@@ -1,6 +1,18 @@
 <gconfschemafile>
 	<schemalist>
 		<schema>
+			<key>/schemas/apps/gnome-keyring/general/password_strength</key>
+			<applyto>/apps/gnome-keyring/general/password_strength</applyto>
+			<owner>gnome-keyring</owner>
+			<type>float</type>
+			<default>1.0</default>
+			<locale name="C">
+				<short>Required keyring password strength</short>
+				<long>Required keyring password strength.
+				Ranges from 0.0 to 1.0.</long>
+			</locale>
+		</schema>
+		<schema>
 			<key>/schemas/apps/gnome-keyring/daemon-components/ssh</key>
 			<applyto>/apps/gnome-keyring/daemon-components/ssh</applyto>
 			<owner>gnome-keyring</owner>
Index: daemon/ui/gkr-ask-request.c
===================================================================
--- daemon/ui/gkr-ask-request.c	(revision 1466)
+++ daemon/ui/gkr-ask-request.c	(working copy)
@@ -81,6 +81,7 @@
 	
 	gboolean completed;
 	guint flags;
+	gdouble pwstrength;
 	
 	gint ask_pid;
 	gint in_fd;
@@ -407,6 +408,9 @@
 	
 	g_key_file_set_integer (key_file, "general", "flags", pv->flags);
 
+	g_key_file_set_double (key_file, "general",
+	                                 "password_strength", pv->pwstrength);
+
 	if (pv->checktext) {
 		g_key_file_set_boolean (key_file, "check", "check-enable", TRUE);
 		g_key_file_set_value (key_file, "check", "check-text", pv->checktext);
@@ -670,6 +674,30 @@
 	return TRUE;
 }
 
+#define MAXPWSTRENGTH 1.0
+
+static gdouble
+get_pwstrength (void)
+{
+        GConfClient *client;
+        GError *err = NULL;
+        gdouble pwstrength;
+        gchar *key;
+
+        client = gconf_client_get_default ();
+        g_return_val_if_fail (client, MAXPWSTRENGTH);
+
+        key = "/apps/gnome-keyring/general/password_strength";
+        pwstrength = gconf_client_get_float (client, key, &err);
+        g_object_unref (client);
+
+        if (err) {
+                return MAXPWSTRENGTH;
+        }
+
+        return pwstrength;
+}
+
 /* -----------------------------------------------------------------------------
  * OBJECT 
  */
@@ -785,6 +813,7 @@
 	g_free (pv->primary);
 	pv->primary = g_strdup (primary ? primary : "");
 	pv->flags = flags;
+	pv->pwstrength = get_pwstrength ();
 	
 	return ask;
 }
Index: daemon/ui/gkr-ask-request.h
===================================================================
--- daemon/ui/gkr-ask-request.h	(revision 1466)
+++ daemon/ui/gkr-ask-request.h	(working copy)
@@ -26,6 +26,9 @@
 
 #include <glib-object.h>
 
+#include <gconf/gconf.h>
+#include <gconf/gconf-client.h>
+
 G_BEGIN_DECLS
 
 typedef enum {
Index: daemon/ui/gkr-ask-tool.c
===================================================================
--- daemon/ui/gkr-ask-tool.c	(revision 1466)
+++ daemon/ui/gkr-ask-tool.c	(working copy)
@@ -258,18 +258,14 @@
  	return ret == GTK_RESPONSE_ACCEPT;
 }
 
-static void
-on_password_changed (GtkEditable     *editable,
-		     gpointer         user_data)
+static gdouble
+password_strength (const char *password)
 {
-	const char *password;
 	int length;
 	int i;
 	int upper, lower, digit, misc;
 	gdouble pwstrength;
 
-	password = gkr_ask_entry_get_text (GKR_ASK_ENTRY (editable));
-
 	/*
 	 * This code is based on the Master Password dialog in Firefox
 	 * (pref-masterpass.js)
@@ -321,9 +317,21 @@
 		pwstrength = 1.0;
 	}
 
-	gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (user_data), pwstrength);
+	return pwstrength;
 }
 
+static void
+on_password_changed (GtkEditable     *editable,
+		     gpointer         user_data)
+{
+	const char *password;
+
+	password = gkr_ask_entry_get_text (GKR_ASK_ENTRY (editable));
+
+	gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (user_data),
+	                               password_strength (password));
+}
+
 static gboolean
 grab_keyboard (GtkWidget *win, GdkEvent *event, gpointer data)
 {
@@ -389,6 +397,7 @@
 	const char *password, *original, *confirmation;
 	const char *env;
 	int row;
+	gdouble pwstrength;
 
 	value = g_key_file_get_value (input_data, "general", "title", NULL);
 	if (!value)
@@ -547,10 +556,28 @@
 					   confirm,
 					   1, 2, row - 1, row);
 
+		/* Fetch required password strength */
+		pwstrength = g_key_file_get_double (input_data, "general",
+		                                    "password_strength", NULL);
+
+		if (pwstrength < 0.0) {
+			pwstrength = 0.0;
+		}
+
+		if (pwstrength > 1.0) {
+			pwstrength = 1.0;
+		}
+
 		/* Strength bar: */
 		if (entry) {
 			gtk_table_resize (GTK_TABLE (ptable), ++row, 2);
 			strength_bar = gtk_progress_bar_new ();
+			gtk_progress_bar_set_text (GTK_PROGRESS_BAR (strength_bar), _("Required password strength"));
+			gtk_table_attach_defaults (GTK_TABLE (ptable), strength_bar, 1, 2, row - 1, row);
+	                gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (strength_bar), pwstrength);
+
+			gtk_table_resize (GTK_TABLE (ptable), ++row, 2);
+			strength_bar = gtk_progress_bar_new ();
 			gtk_progress_bar_set_text (GTK_PROGRESS_BAR (strength_bar), _("New password strength"));
 			g_signal_connect ((gpointer) entry, "changed", G_CALLBACK (on_password_changed), strength_bar);
 			gtk_table_attach_defaults (GTK_TABLE (ptable), strength_bar, 1, 2, row - 1, row);
@@ -619,24 +646,46 @@
 		*password_out = egg_secure_strdup (password);
 	}
 	
-	/* When it's a new password and blank, double check */
-	if (include_confirm && password && !password[0]) {
-		
-		/* Don't allow blank passwords if in paranoid mode */
-		env = g_getenv ("GNOME_KEYRING_PARANOID");
-		if (env && *env) {
-			notice_text = create_notice (_("Password cannot be blank"));
-			gtk_label_set_markup (notice, notice_text);
-			gtk_widget_show (GTK_WIDGET (notice));
-			g_free (notice_text);
-			goto retry;
-			
-		/* Double check with the user */ 
-		} else if (!confirm_blank_password (GTK_WINDOW (dialog))) {
-			goto retry;
+	/* New password, check it */
+	if (include_confirm && password) {
+		/* Password strength was set, use that */
+		if (pwstrength > 0) {
+			/* Don't allow blank passwords if strength is set */
+			if (!password[0]) {
+				notice_text = create_notice (_("Password cannot be blank"));
+				gtk_label_set_markup (notice, notice_text);
+				gtk_widget_show (GTK_WIDGET (notice));
+				g_free (notice_text);
+				goto retry;
+			}
+
+			/* Reject anything below required strength */
+			if (password_strength (password) < pwstrength) {
+				notice_text = create_notice (_("Password too weak"));
+				gtk_label_set_markup (notice, notice_text);
+				gtk_widget_show (GTK_WIDGET (notice));
+				g_free (notice_text);
+				goto retry;
+			}
 		}
+		/* When it's a new password and blank, double check */
+		else if (!password[0]) {
+			/* Don't allow blank passwords if in paranoid mode */
+			env = g_getenv ("GNOME_KEYRING_PARANOID");
+			if (env && *env) {
+				notice_text = create_notice (_("Password cannot be blank"));
+				gtk_label_set_markup (notice, notice_text);
+				gtk_widget_show (GTK_WIDGET (notice));
+				g_free (notice_text);
+				goto retry;
+				
+			/* Double check with the user */ 
+			} else if (!confirm_blank_password (GTK_WINDOW (dialog))) {
+				goto retry;
+			}
+		}
 	}
-	
+
 	if (check != NULL && response >= GKR_ASK_RESPONSE_ALLOW) {
 		g_key_file_set_boolean (output_data, "check", "check-active", 
 		                        gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check)));
