intl/chardet/tools/geneuctw.pl

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 #!/usr/local/bin/perl
     2 # This Source Code Form is subject to the terms of the Mozilla Public
     3 # License, v. 2.0. If a copy of the MPL was not distributed with this
     4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
     6 use strict;
     7 require "genverifier.pm";
     8 use genverifier;
    11 my(@euctw_cls);
    12 my(@euctw_st);
    13 my($euctw_ver);
    16 @euctw_cls = (
    17  [ 0x00 , 0x00 , 2 ],
    18  [ 0x0e , 0x0f , 0 ],
    19  [ 0x1b , 0x1b , 0 ],
    20  [ 0x01 , 0x7f , 2 ],
    21  [ 0x8e , 0x8e , 6 ],
    22  [ 0x80 , 0xa0 , 0 ],
    23  [ 0xff , 0xff , 0 ],
    24  [ 0xa1 , 0xa1 , 3 ],
    25  [ 0xa2 , 0xa7 , 4 ],
    26  [ 0xa8 , 0xa9 , 5 ],
    27  [ 0xaa , 0xc1 , 1 ],
    28  [ 0xc2 , 0xc2 , 3 ],
    29  [ 0xc3 , 0xc3 , 1 ],
    30  [ 0xc4 , 0xfe , 3 ],
    31 );
    33 package genverifier;
    34 @euctw_st = (
    35 #  0  1  2  3  4  5  6
    36    1, 1, 0, 3, 3, 3, 4, # state 0
    37    1, 1, 1, 1, 1, 1, 1, # Error State - 1
    38    2, 2, 2, 2, 2, 2, 2, # ItsMe State - 2
    39    1, 0, 1, 0, 0, 0, 1, # state 3
    40    1, 1, 1, 1, 5, 1, 1, # state 4
    41    1, 0, 1, 0, 0, 0, 1, # state 5
    42 );
    45 $euctw_ver = genverifier::GenVerifier("EUCTW", "x-euc-tw", \@euctw_cls, 7,     \@euctw_st);
    46 print $euctw_ver;

mercurial