rpms/xulrunner/devel mozilla-1.9.0.2-pwmgr.patch, NONE, 1.1 mozilla-1.9.0.2-pwmgr2.patch, NONE, 1.1 xulrunner.spec, 1.136, 1.137

Christopher Aillon caillon at fedoraproject.org
Mon Oct 27 22:45:12 UTC 2008


Author: caillon

Update of /cvs/extras/rpms/xulrunner/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv30937

Modified Files:
	xulrunner.spec 
Added Files:
	mozilla-1.9.0.2-pwmgr.patch mozilla-1.9.0.2-pwmgr2.patch 
Log Message:
* Mon Oct 27 2008 Christopher Aillon <caillon at redhat.com> 1.9.0.2-5
- Password manager fixes from upstream


mozilla-1.9.0.2-pwmgr.patch:

--- NEW FILE mozilla-1.9.0.2-pwmgr.patch ---
https://bugzilla.mozilla.org/show_bug.cgi?id=454708

Index: toolkit/components/passwordmgr/src/storage-Legacy.js
===================================================================
RCS file: /cvsroot/mozilla/toolkit/components/passwordmgr/src/storage-Legacy.js,v
retrieving revision 1.28
diff -u -p -8 -r1.28 storage-Legacy.js
--- toolkit/components/passwordmgr/src/storage-Legacy.js	26 Aug 2008 19:05:49 -0000	1.28
+++ toolkit/components/passwordmgr/src/storage-Legacy.js	24 Sep 2008 17:38:18 -0000
@@ -845,17 +845,21 @@ LoginManagerStorage_legacy.prototype = {
         var parseState = STATE.HEADER;
 
         var nsLoginInfo = new Components.Constructor(
                 "@mozilla.org/login-manager/loginInfo;1", Ci.nsILoginInfo);
         var processEntry = false;
 
         do {
             var hasMore = lineStream.readLine(line);
-            line.value = this._utfConverter.ConvertToUnicode(line.value);
+            try {
+              line.value = this._utfConverter.ConvertToUnicode(line.value);
+            } catch (e) {
+              this.log("Bad UTF8 conversion: " + line.value);
+            }
 
             switch (parseState) {
                 // Check file header
                 case STATE.HEADER:
                     if (line.value == "#2c") {
                         formatVersion = 0x2c;
                     } else if (line.value == "#2d") {
                         formatVersion = 0x2d;
Index: toolkit/components/passwordmgr/test/unit/test_storage_legacy_3.js
===================================================================
RCS file: /cvsroot/mozilla/toolkit/components/passwordmgr/test/unit/test_storage_legacy_3.js,v
retrieving revision 1.7
diff -u -p -8 -r1.7 test_storage_legacy_3.js
--- toolkit/components/passwordmgr/test/unit/test_storage_legacy_3.js	26 Aug 2008 19:05:49 -0000	1.7
+++ toolkit/components/passwordmgr/test/unit/test_storage_legacy_3.js	24 Sep 2008 17:38:18 -0000
@@ -536,16 +536,45 @@ storage.setLoginSavingEnabled(utfHost, f
 
 LoginTest.checkStorageData(storage, [utfHost], [utfUser1, utfUser2]);
 
 testdesc = "[flush and reload for verification]"
 LoginTest.initStorage(storage, OUTDIR, "output-451155.txt");
 LoginTest.checkStorageData(storage, [utfHost], [utfUser1, utfUser2]);
 
 
+/*
+ * ---------------------- Bug 454708 ----------------------
+ * Check that previous saved entries that are not valid UTF8
+ * are read without blowing up.
+ */
+
+/* ========== 15 ========== */
+testnum++;
+testdesc = "ensure bogus UTF8 strings don't cause failures."
+
+var badHost = "https://FcK" + String.fromCharCode(0x8a) + ".jp";
+var bad8User = Cc["@mozilla.org/login-manager/loginInfo;1"].
+               createInstance(Ci.nsILoginInfo);
+bad8User.init(badHost, badHost, null,
+              "dummydude", "itsasecret", "put_user_here", "put_pw_here");
+
+LoginTest.initStorage(storage,
+                      INDIR, "signons-454708.txt",
+                      OUTDIR, "output-454708.txt");
+LoginTest.checkStorageData(storage, [], [bad8User]);
+
+// The output file should contain valid UTF8 now, but the resulting
+// JS string value remains the same.
+
+testdesc = "[flush and reload for verification]"
+LoginTest.initStorage(storage, OUTDIR, "output-454708.txt");
+LoginTest.checkStorageData(storage, [], [bad8User]);
+
+
 
 
 /* ========== end ========== */
 } catch (e) {
     throw ("FAILED in test #" + testnum + " -- " + testdesc + ": " + e);
 }
 
 };
Index: toolkit/components/passwordmgr/test/unit/data/signons-454708.txt
===================================================================
RCS file: toolkit/components/passwordmgr/test/unit/data/signons-454708.txt
diff -N toolkit/components/passwordmgr/test/unit/data/signons-454708.txt
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ toolkit/components/passwordmgr/test/unit/data/signons-454708.txt	24 Sep 2008 17:38:18 -0000
@@ -0,0 +1,10 @@
+#2e
+.
+https://FcKŠ.jp
+put_user_here
+MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECEnlbhAkNBbBBBCexD5eaffSLGH/ORiFlQ4X
+*put_pw_here
+MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECHmiTaseYjkkBBAA0ILJTFSa5CnlpD5PTEYR
+https://FcKŠ.jp
+---
+.

mozilla-1.9.0.2-pwmgr2.patch:

--- NEW FILE mozilla-1.9.0.2-pwmgr2.patch ---
https://bugzilla.mozilla.org/show_bug.cgi?id=457358

Index: toolkit/components/passwordmgr/src/storage-Legacy.js
===================================================================
RCS file: /cvsroot/mozilla/toolkit/components/passwordmgr/src/storage-Legacy.js,v
retrieving revision 1.29
diff -u -p -8 -r1.29 storage-Legacy.js
--- toolkit/components/passwordmgr/src/storage-Legacy.js	24 Sep 2008 17:39:34 -0000	1.29
+++ toolkit/components/passwordmgr/src/storage-Legacy.js	3 Oct 2008 21:00:37 -0000
@@ -79,16 +79,20 @@ LoginManagerStorage_legacy.prototype = {
         if (!this.__utfConverter) {
             this.__utfConverter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
                                   createInstance(Ci.nsIScriptableUnicodeConverter);
             this.__utfConverter.charset = "UTF-8";
         }
         return this.__utfConverter;
     },
 
+    _utfConverterReset : function() {
+        this.__utfConverter = null;
+    },
+
     __profileDir: null,  // nsIFile for the user's profile dir
     get _profileDir() {
         if (!this.__profileDir) {
             var dirService = Cc["@mozilla.org/file/directory_service;1"].
                              getService(Ci.nsIProperties);
             this.__profileDir = dirService.get("ProfD", Ci.nsIFile);
         }
         return this.__profileDir;
@@ -849,16 +853,17 @@ LoginManagerStorage_legacy.prototype = {
         var processEntry = false;
 
         do {
             var hasMore = lineStream.readLine(line);
             try {
               line.value = this._utfConverter.ConvertToUnicode(line.value);
             } catch (e) {
               this.log("Bad UTF8 conversion: " + line.value);
+              this._utfConverterReset();
             }
 
             switch (parseState) {
                 // Check file header
                 case STATE.HEADER:
                     if (line.value == "#2c") {
                         formatVersion = 0x2c;
                     } else if (line.value == "#2d") {
@@ -1290,16 +1295,19 @@ LoginManagerStorage_legacy.prototype = {
             } else {
                 plainOctet = this._decoderRing.decryptString(cipherText);
             }
             plainText = this._utfConverter.ConvertToUnicode(plainOctet);
         } catch (e) {
             this.log("Failed to decrypt string: " + cipherText +
                 " (" + e.name + ")");
 
+            // In the unlikely event the converter threw, reset it.
+            this._utfConverterReset();
+
             // If the user clicks Cancel, we get NS_ERROR_NOT_AVAILABLE.
             // If the cipherText is bad / wrong key, we get NS_ERROR_FAILURE
             // Wrong passwords are handled by the decoderRing reprompting;
             // we get no notification.
             if (e.result == Components.results.NS_ERROR_NOT_AVAILABLE)
                 userCanceled = true;
         }
 
Index: toolkit/components/passwordmgr/test/unit/test_storage_legacy_3.js
===================================================================
RCS file: /cvsroot/mozilla/toolkit/components/passwordmgr/test/unit/test_storage_legacy_3.js,v
retrieving revision 1.8
diff -u -p -8 -r1.8 test_storage_legacy_3.js
--- toolkit/components/passwordmgr/test/unit/test_storage_legacy_3.js	24 Sep 2008 17:39:34 -0000	1.8
+++ toolkit/components/passwordmgr/test/unit/test_storage_legacy_3.js	3 Oct 2008 21:00:37 -0000
@@ -565,16 +565,173 @@ LoginTest.checkStorageData(storage, [], 
 // The output file should contain valid UTF8 now, but the resulting
 // JS string value remains the same.
 
 testdesc = "[flush and reload for verification]"
 LoginTest.initStorage(storage, OUTDIR, "output-454708.txt");
 LoginTest.checkStorageData(storage, [], [bad8User]);
 
 
+/*
+ * ---------------------- Bug 457358 ----------------------
+ * need to reset UTF8 converter after it encounters invalid input
+ * (pwmgr problems in FF3.0.3)
+ */
+
+/* ========== 16 ========== */
+testnum++;
+testdesc = "ensure UTF8 converter isn't left in bad state."
+
+var utfRealm = "Acc" +
+               String.fromCharCode(0xe8) +
+               "s reserv" +
+               String.fromCharCode(0xe9);
+bad8User.init("https://bugzilla.mozilla.org", null, utfRealm,
+            "dummydude", "itsasecret", "", "");
+
+LoginTest.initStorage(storage,
+                      INDIR, "signons-457358-1.txt",
+                      OUTDIR, "output-457358-1.txt");
+LoginTest.checkStorageData(storage, [], [bad8User]);
+
+// The output file should contain valid UTF8 now, but the resulting
+// JS string value remains the same.
+
+testdesc = "[flush and reload for verification]"
+LoginTest.initStorage(storage, OUTDIR, "output-457358-1.txt");
+LoginTest.checkStorageData(storage, [], [bad8User]);
+
+/* ========== 17 ========== */
+testnum++;
+testdesc = "ensure UTF8 converter isn't left in bad state."
+
+// The username field here is "Acc" + String.fromCharCode(0xe8), but the last
+// character is invalid UTF8 -- it's the beginning of a multibyte sequence,
+// but at the end of the input. The unicode converter silently truncates the
+// string, and will throw when we feed it the next chunk of input (the
+// encrypted username)
+//
+// Test for an expected login -- everthing fine except for the truncated field
+// name (which we don't use anyway)
+bad8User.init("https://bugzilla.mozilla.org", "https://bugzilla.mozilla.org", null,
+            "dummydude", "itsasecret", "Acc", "pass");
+
+LoginTest.initStorage(storage,
+                      INDIR, "signons-457358-2.txt",
+                      OUTDIR, "output-457358-2.txt");
+LoginTest.checkStorageData(storage, [], [bad8User]);
+
+// The output file should contain valid UTF8 now, but the resulting
+// JS string value remains the same.
+
+testdesc = "[flush and reload for verification]"
+LoginTest.initStorage(storage, OUTDIR, "output-457358-2.txt");
+LoginTest.checkStorageData(storage, [], [bad8User]);
+
+/* ========== 18 ========== */
+testnum++;
+testdesc = "ensure UTF8 converter isn't left in bad state."
+
+// As with previous test, but triggered with both field names.
+
+bad8User.init("https://bugzilla.mozilla.org", "https://bugzilla.mozilla.org", null,
+            "dummydude", "itsasecret", "u-Acc", "p-Acc");
+
+LoginTest.initStorage(storage,
+                      INDIR, "signons-457358-3.txt",
+                      OUTDIR, "output-457358-3.txt");
+LoginTest.checkStorageData(storage, [], [bad8User]);
+
+// The output file should contain valid UTF8 now, but the resulting
+// JS string value remains the same.
+
+testdesc = "[flush and reload for verification]"
+LoginTest.initStorage(storage, OUTDIR, "output-457358-3.txt");
+LoginTest.checkStorageData(storage, [], [bad8User]);
+
+/* ========== 19 ========== */
+testnum++;
+testdesc = "ensure UTF8 converter isn't left in bad state."
+
+// Last character in the realm, this time. Not trunated, because the
+// "http://site.com (realm)" format means there's always a trailing character,
+// so the conversino throws.
+
+bad8User.init("https://bugzilla.mozilla.org", null, "Acc" + String.fromCharCode(0xe8),
+            "dummydude", "itsasecret", "", "");
+
+LoginTest.initStorage(storage,
+                      INDIR, "signons-457358-4.txt",
+                      OUTDIR, "output-457358-4.txt");
+LoginTest.checkStorageData(storage, [], [bad8User]);
+
+// The output file should contain valid UTF8 now, but the resulting
+// JS string value remains the same.
+
+testdesc = "[flush and reload for verification]"
+LoginTest.initStorage(storage, OUTDIR, "output-457358-4.txt");
+LoginTest.checkStorageData(storage, [], [bad8User]);
+
+/* ========== 20 ========== */
+testnum++;
+testdesc = "ensure UTF8 converter isn't left in bad state."
+
+// Like last test, but try adding and removing a login too.
+
+bad8User.init("https://bugzilla.mozilla.org", null, "Acc" + String.fromCharCode(0xe8),
+            "dummydude", "itsasecret", "", "");
+
+LoginTest.initStorage(storage,
+                      INDIR, "signons-457358-4.txt",
+                      OUTDIR, "output-457358-4b.txt");
+
+var anotherUser = Cc["@mozilla.org/login-manager/loginInfo;1"].
+              createInstance(Ci.nsILoginInfo);
+anotherUser.init("http://mozilla.org", null,
+                 String.fromCharCode(0xe8) + "xtra user " + String.fromCharCode(0x0163) + "est",
+                 "dummydude", "itsasecret", "", "");
+
+storage.addLogin(anotherUser);
+LoginTest.checkStorageData(storage, [], [bad8User, anotherUser]);
+
+testdesc = "[flush and reload for verification]"
+LoginTest.initStorage(storage, OUTDIR, "output-457358-4b.txt");
+LoginTest.checkStorageData(storage, [], [bad8User, anotherUser]);
+
+storage.removeLogin(anotherUser);
+LoginTest.checkStorageData(storage, [], [bad8User]);
+
+testdesc = "[flush and reload for verification 2]"
+LoginTest.initStorage(storage, OUTDIR, "output-457358-4b.txt");
+LoginTest.checkStorageData(storage, [], [bad8User]);
+
+/* ========== 21 ========== */
+testnum++;
+testdesc = "ensure UTF8 converter isn't left in bad state."
+
+// The first login's username (plaintext) is invalid UTF8. It's handled as a
+// bad decryption so we don't see the login, but make sure the other login in
+// the file is ok.
+
+// This is the first login:
+//bad8User.init("https://www.google.com", "https://www.google.com", null,
+//              "Acc" + String.fromCharCode(0xe8) + "ss", "passw", "un", "pw");
+anotherUser.init("https://bugzilla.mozilla.org", null, "extra user test",
+                 "dummydude", "itsasecret", "", "");
+
+LoginTest.initStorage(storage,
+                      INDIR, "signons-457358-5.txt",
+                      OUTDIR, "output-457358-5.txt");
+LoginTest.checkStorageData(storage, [], [anotherUser]);
+
+testdesc = "[flush and reload for verification]"
+LoginTest.initStorage(storage, OUTDIR, "output-457358-5.txt");
+LoginTest.checkStorageData(storage, [], [anotherUser]);
+
+
 
 
 /* ========== end ========== */
 } catch (e) {
     throw ("FAILED in test #" + testnum + " -- " + testdesc + ": " + e);
 }
 
 };
Index: toolkit/components/passwordmgr/test/unit/data/signons-457358-1.txt
===================================================================
RCS file: toolkit/components/passwordmgr/test/unit/data/signons-457358-1.txt
diff -N toolkit/components/passwordmgr/test/unit/data/signons-457358-1.txt
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ toolkit/components/passwordmgr/test/unit/data/signons-457358-1.txt	3 Oct 2008 21:00:37 -0000
@@ -0,0 +1,10 @@
+#2e
+.
+https://bugzilla.mozilla.org (Accès reservé)
+
+MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECEnlbhAkNBbBBBCexD5eaffSLGH/ORiFlQ4X
+*
+MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECHmiTaseYjkkBBAA0ILJTFSa5CnlpD5PTEYR
+
+---
+.
Index: toolkit/components/passwordmgr/test/unit/data/signons-457358-2.txt
===================================================================
RCS file: toolkit/components/passwordmgr/test/unit/data/signons-457358-2.txt
diff -N toolkit/components/passwordmgr/test/unit/data/signons-457358-2.txt
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ toolkit/components/passwordmgr/test/unit/data/signons-457358-2.txt	3 Oct 2008 21:00:37 -0000
@@ -0,0 +1,10 @@
+#2e
+.
+https://bugzilla.mozilla.org
+Accè
+MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECEnlbhAkNBbBBBCexD5eaffSLGH/ORiFlQ4X
+*pass
+MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECHmiTaseYjkkBBAA0ILJTFSa5CnlpD5PTEYR
+https://bugzilla.mozilla.org
+---
+.
Index: toolkit/components/passwordmgr/test/unit/data/signons-457358-3.txt
===================================================================
RCS file: toolkit/components/passwordmgr/test/unit/data/signons-457358-3.txt
diff -N toolkit/components/passwordmgr/test/unit/data/signons-457358-3.txt
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ toolkit/components/passwordmgr/test/unit/data/signons-457358-3.txt	3 Oct 2008 21:00:37 -0000
@@ -0,0 +1,10 @@
+#2e
+.
+https://bugzilla.mozilla.org
+u-Accè
+MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECEnlbhAkNBbBBBCexD5eaffSLGH/ORiFlQ4X
+*p-Accè
+MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECHmiTaseYjkkBBAA0ILJTFSa5CnlpD5PTEYR
+https://bugzilla.mozilla.org
+---
+.
Index: toolkit/components/passwordmgr/test/unit/data/signons-457358-4.txt
===================================================================
RCS file: toolkit/components/passwordmgr/test/unit/data/signons-457358-4.txt
diff -N toolkit/components/passwordmgr/test/unit/data/signons-457358-4.txt
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ toolkit/components/passwordmgr/test/unit/data/signons-457358-4.txt	3 Oct 2008 21:00:37 -0000
@@ -0,0 +1,10 @@
+#2e
+.
+https://bugzilla.mozilla.org (Accè)
+
+MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECEnlbhAkNBbBBBCexD5eaffSLGH/ORiFlQ4X
+*
+MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECHmiTaseYjkkBBAA0ILJTFSa5CnlpD5PTEYR
+
+---
+.
Index: toolkit/components/passwordmgr/test/unit/data/signons-457358-5.txt
===================================================================
RCS file: toolkit/components/passwordmgr/test/unit/data/signons-457358-5.txt
diff -N toolkit/components/passwordmgr/test/unit/data/signons-457358-5.txt
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ toolkit/components/passwordmgr/test/unit/data/signons-457358-5.txt	3 Oct 2008 21:00:37 -0000
@@ -0,0 +1,18 @@
+#2e
+.
+https://www.google.com
+un
+MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECAcH36OqRDPBBAj4u1kKe2oefQ==
+*pw
+MDIEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECDG4MxIBIm3IBAjLrxoeWcW5eg==
+https://www.google.com
+---
+.
+https://bugzilla.mozilla.org (extra user test)
+
+MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECEnlbhAkNBbBBBCexD5eaffSLGH/ORiFlQ4X
+*
+MDoEEPgAAAAAAAAAAAAAAAAAAAEwFAYIKoZIhvcNAwcECHmiTaseYjkkBBAA0ILJTFSa5CnlpD5PTEYR
+
+---
+.


Index: xulrunner.spec
===================================================================
RCS file: /cvs/extras/rpms/xulrunner/devel/xulrunner.spec,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -r1.136 -r1.137
--- xulrunner.spec	7 Oct 2008 11:16:58 -0000	1.136
+++ xulrunner.spec	27 Oct 2008 22:44:41 -0000	1.137
@@ -8,7 +8,7 @@
 Summary:        XUL Runtime for Gecko Applications
 Name:           xulrunner
 Version:        1.9.0.2
-Release:        4%{?dist}
+Release:        5%{?dist}
 URL:            http://developer.mozilla.org/En/XULRunner
 License:        MPLv1.1 or GPLv2+ or LGPLv2+
 Group:          Applications/Internet
@@ -31,6 +31,8 @@
 # Upstream patches
 Patch26:        mozilla-ps-pdf-simplify-operators.patch
 Patch27:        mozilla-ssl-exception.patch
+Patch28:        mozilla-1.9.0.2-pwmgr.patch
+Patch29:        mozilla-1.9.0.2-pwmgr2.patch
 
 
 # ---------------------------------------------------
@@ -128,7 +130,9 @@
 %patch10 -p1 -b .pk
 
 %patch26 -p1 -b .ps-pdf-simplify-operators
-#%patch27 -p1 -b .ssl-exception
+%patch28 -p0 -b .pwmgr
+%patch29 -p0 -b .pwmgr2
+
 
 %{__rm} -f .mozconfig
 %{__cp} %{SOURCE10} .mozconfig
@@ -413,6 +417,9 @@
 #---------------------------------------------------------------------
 
 %changelog
+* Mon Oct 27 2008 Christopher Aillon <caillon at redhat.com> 1.9.0.2-5
+- Password manager fixes from upstream
+
 * Tue Oct  7 2008 Marco Pesenti Gritti <mpg at redhat.com> 1.9.0.2-4
 - Add missing dependency on python-devel
 




More information about the scm-commits mailing list