Index: debian/grub-installer.templates
===================================================================
--- debian/grub-installer.templates	(revision 39741)
+++ debian/grub-installer.templates	(working copy)
@@ -61,6 +61,18 @@
  .
  If you do not wish to set a GRUB password, leave this field blank.
 
+Template: grub-installer/password-again
+Type: password
+_Description: Re-enter GRUB password to verify:
+ Please enter the same GRUB password again to verify you have typed it
+ correctly.
+
+Template: grub-installer/password-mismatch
+Type: note
+_Description: Password mismatch
+ The two passwords you entered were not the same. Please enter a password
+ again.
+
 Template: grub-installer/password-crypted
 Type: boolean
 Default: false
Index: grub-installer
===================================================================
--- grub-installer	(revision 39741)
+++ grub-installer	(working copy)
@@ -366,13 +366,38 @@
 update_grub
 
 # Set up a password if asked.
-db_input low grub-installer/password || true
-if ! db_go; then
-	# back up to menu
+while [ 1 ]; do
+    db_set grub-installer/password ""
+    db_set grub-installer/password-again ""
+    db_input low grub-installer/password || true
+    db_input low grub-installer/password-again || true
+    if ! db_go; then
+        # back up to menu
 	db_progress STOP
 	exit 10
-fi
-db_get grub-installer/password
+    fi
+    db_get grub-installer/password
+    if [ "$RET" ]; then
+	PW="$RET"
+	db_get grub-installer/password-again
+	if [ "$RET" ]; then
+	    if [ $RET != "$PW" ]; then
+		db_input critical grub-installer/password-mismatch || true
+		if ! db_go; then
+                    # back up to menu
+		    db_progress STOP
+		    exit 10
+		fi
+	    else 
+		RET="$PW"
+		break
+	    fi
+	fi
+    else
+	break
+    fi
+done
+
 if [ "$RET" ]; then
 	password="$RET"
 	# check if the password is crypted
