Closed
Bug 368998
Opened 18 years ago
Closed 18 years ago
when normalizing hostnames, we don't properly escape non-alphanumerics
Categories
(Toolkit :: Safe Browsing, defect)
Toolkit
Safe Browsing
Tracking
()
RESOLVED
FIXED
People
(Reporter: tony, Assigned: tony)
References
Details
Attachments
(3 files, 3 obsolete files)
7.48 KB,
patch
|
bryner
:
review+
|
Details | Diff | Splinter Review |
27.06 KB,
patch
|
bryner
:
review+
|
Details | Diff | Splinter Review |
17.09 KB,
patch
|
Details | Diff | Splinter Review |
According to the spec on the wiki:
http://wiki.mozilla.org/Phishing_Protection:_Server_Spec#Canonical_Hostname_Creation
When canonicalizing hostnames, the final step is to url escape everything that is not alphanumeric or hyphen or dot. In the client code, we use encodeURI, but that doesn't do the escaping we want. We'll need to write our own function to do this.
Assignee | ||
Comment 1•18 years ago
|
||
Attachment #254340 -
Flags: review?(bryner)
Comment 2•18 years ago
|
||
Comment on attachment 254340 [details] [diff] [review]
do our own escaping of hostnames
looks good
Attachment #254340 -
Flags: review?(bryner) → review+
Assignee | ||
Comment 3•18 years ago
|
||
On trunk
Checking in toolkit/components/url-classifier/content/enchash-decrypter.js;
/cvsroot/mozilla/toolkit/components/url-classifier/content/enchash-decrypter.js,v <-- enchash-decrypter.js
new revision: 1.9; previous revision: 1.8
done
Checking in testing/mochitest/tests/test_bug356355.xhtml;
/cvsroot/mozilla/testing/mochitest/tests/test_bug356355.xhtml,v <-- test_bug356355.xhtml
new revision: 1.3; previous revision: 1.2
done
Checking in testing/mochitest/tests/test_bug368998.xhtml;
/cvsroot/mozilla/testing/mochitest/tests/test_bug368998.xhtml,v <-- test_bug368998.xhtml
initial revision: 1.1
Assignee | ||
Comment 4•18 years ago
|
||
same as above patch minus tests because mochitest isn't on branch
Attachment #254433 -
Flags: review?(bryner)
Attachment #254433 -
Flags: approval1.8.1.3?
Updated•18 years ago
|
Attachment #254433 -
Flags: review?(bryner) → review+
Assignee | ||
Comment 5•18 years ago
|
||
Refactor the escaping code so we can unittest it separately. Migrate server side tests to mochitest and consolidate all tests into a single file. I'll get rid of the old mochitest files once the test tinderboxen are clobbered.
Attachment #256874 -
Flags: review?(bryner)
Assignee | ||
Updated•18 years ago
|
Attachment #254433 -
Attachment is obsolete: true
Attachment #254433 -
Flags: approval1.8.1.3?
Comment 6•18 years ago
|
||
Comment on attachment 256874 [details] [diff] [review]
refactor to allow unittesting
looks great, thanks for doing this
Attachment #256874 -
Flags: review?(bryner) → review+
Assignee | ||
Comment 7•18 years ago
|
||
on trunk, branch patch coming up
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 8•18 years ago
|
||
Attachment #256907 -
Flags: review?(bryner)
Updated•18 years ago
|
Attachment #256907 -
Flags: review?(bryner) → review+
Assignee | ||
Comment 9•18 years ago
|
||
Comment on attachment 256907 [details] [diff] [review]
branch patch
Ugh, it turns out this is slow for really long hostnames. This needs to be in C++, I'll add it to the utils component in bug 370860.
Attachment #256907 -
Attachment is obsolete: true
Assignee | ||
Comment 10•18 years ago
|
||
Do the hostname escaping in c++. Also use unescape instead of the JS hexDecode because it's much faster.
Attachment #257048 -
Flags: review?(bryner)
Comment 11•18 years ago
|
||
Comment on attachment 257048 [details] [diff] [review]
move host encoding to c++ (url classifier utils component)
>--- url-classifier/public/nsIUrlClassifierUtils.idl 27 Feb 2007 23:49:44 -0000 1.1
>+++ url-classifier/public/nsIUrlClassifierUtils.idl 2 Mar 2007 19:20:40 -0000
>-[scriptable, uuid(9afd3add-eadc-409f-a187-e3bf60e47290)]
>+[scriptable, uuid(89ea43b0-a23f-4db2-8d23-6d90dc55f67a)]
> interface nsIUrlClassifierUtils : nsISupports
I guess changing this interface on the branch will be ok if we never shipped a release with the old version?
>--- url-classifier/src/nsUrlClassifierUtils.h 27 Feb 2007 23:49:44 -0000 1.1
>+++ url-classifier/src/nsUrlClassifierUtils.h 2 Mar 2007 19:20:40 -0000
>@@ -34,21 +34,25 @@
> *
> * ***** END LICENSE BLOCK ***** */
>
> #ifndef nsUrlClassifierUtils_h_
> #define nsUrlClassifierUtils_h_
>
> #include "nsIUrlClassifierUtils.h"
>
>+class Charmap;
This is kind of a generic class name, and there's nothing to scope it. Maybe have it be a nested class in nsUrlClassifierUtils?
>+ Charmap *mEscapeCharmap;
This seems like a good place to use nsAutoPtr.
Looks good otherwise.
Attachment #257048 -
Flags: review?(bryner) → review+
Assignee | ||
Comment 12•18 years ago
|
||
use nsAutoPtr and move Charmap class inside nsUrlClassifierUtils class
Attachment #257048 -
Attachment is obsolete: true
Assignee | ||
Comment 13•18 years ago
|
||
"v2: move host encoding to c++" is on trunk
Updated•11 years ago
|
Product: Firefox → Toolkit
You need to log in
before you can comment on or make changes to this bug.
Description
•