~psiphon-inc/psiphon/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/*
 * Copyright (c) 2010, Psiphon Inc.
 * All rights reserved.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#pragma once

#include <string>

using namespace std;

// These string constants are placeholders that will be overwritten
// in the EXE when the client is downloaded.  They are set to a long
// random value that is almost surely unique in the final EXE.
// The overwrite must be the same length for the EXE to remain
// valid, so 512 characters are allocated; the overwriter will
// replace this with a URL padded with spaces up to 512 characters.

static const char* HTTP_PROXY_PORT_NUMBER =
    "938B0F3298373DC739BA6FF2755090400F38512D59912410B144DB4F36B2D3A5"
    "94AE0DB5E7D9E92BEB0D59D1C8B8ADABF9FB0CFA4A9D27F76ED297CC9965DB18"
    "2C39C874EDD978FDAE1842DBF97F534593AC53E59DF0D545BCEEABDE4CE11831"
    "508CD6A1BF06C15E5E1CCDC420F89E385871B31D95AD574D2A20C989EF844F09"
    "A6D451065A6A8C835675A5170B2CF5D7FE049D6A738F3720040ABB0C1450B462"
    "CC462C3D192C4F2E1744659D278A1493151ECED35C00FF9740C0C3C2528FC235"
    "2393A89D40827099DABF53C2FAECEA7743E40DB4F3329E8EA27C812E06D59385"
    "50020A285A69ADB17659FE8E60B2AE512EBBAB499C9AF86ED423EEF15F710030";

static const char* SSH_SERVER_HOST =
    "B4FDCA80A6C01F6B5B2712BCDFD56FB890E2A0CDA58BE9E36788D45BFAB69FBE"
    "FF51CBA580FF7B5600F1D163B52CC4201B115B82DCDED5AD389E94E677590F03"
    "A45B239D99A2418F8DD4E32AAFE780B03696249D21339C6E50202CCAF38887B1"
    "8C09A857D20BF284531677264F33B30D0A83F6DCAA4663620DF80ED445A0DA82"
    "C5F4BC6A4335473F0D37B0252ED1E54F9466D6D8EAB23A3970C4DB15053947E8"
    "3627AE9F649776818692052E14CCD75DC8275A915C8C78B523307BCE7684D2FC"
    "2E3C285C5A7C3D6A0EB8FD754D5B6D913BEADEAE254147F752391F052BFB4B61"
    "5CEAC356123C4C3AD8B00169F08397EBEE6D96AC0E42748F853C97D427901815";

static const char* SSH_SERVER_PORT_NUMBER =
    "997AE2C56FA7B92342541F4386B4402B82B27F32D7A12EF6A5E0F78922BFFD4E"
    "C8CCDD8729580712EB3E48407398D3CEB97B5DF615AD85C5DEFD47ADB82E5848"
    "C039F8CEE15BA64721251FD8364BA9BCF25181A2E2333365C1DA0190D7368CEB"
    "9E4AE5E96535E989AB85C41A0BA453C7008A3C64E12DCFD9BE13C9C707210609"
    "62F6D63260C91CFE6EFE9BE74692AD522A0E718798045DDEB2A41802C92375B7"
    "985B19DE665DB03422C6BDFC0489B72E6EA06A1526AD612038DCAEAC5EAF409F"
    "F291FFB8DD959518C82327928DFF735002B300A5B29064217B7E8774CAC37255"
    "34D6C26CF8ED2D6D81286E3CB42C7D55E61368202F7E29D29E7B2C33F0120EEB";

static const char* SSH_USER_NAME =
    "C189DF9EF00E9BAC0983DB979EE71543FEEC24F1A450C2B4DEC87DB9851AA941"
    "86851AD05EF9F72C617EEAB0FB3DA90B637A5CB3D5395800A6063355EC99A027"
    "11D52F53196A6D5F3241EA6CBDE89897B5D0620F7990397EA51332EE72515D73"
    "15892B5F61E1835FD3B7AF164392F40E790695066F70AB32B61124B20BC59CFD"
    "8918C649FBDB5000611C92D6B5BEE27B80A3D06B3EF04E036A95CDB85A7BA6E5"
    "FB98AEBBA647593B85EC15D04F022A761BD43831D07A054583DC33C53A0A5CB4"
    "E4CA356EA7FAD42EB2863B47D708F309530298D0308639CAFA61093B7A37C6E6"
    "3C6CA2E9EFC11BB2E6A0E819231986C75B2F30A56457692B399EF9E07DFC3C39";

static const char* SSH_USER_PASSWORD =
    "C187FA288F23AB96F2FC884A7E1659C0538D1265DE34687D47EA0D4D207E5B79"
    "066DFDA630FD955A4FFCB6B8A783431DE48091E62148DE66BD88D4B708862D2F"
    "C78D636B2D735091CF18121104F0121FF5DB799DA814B4CDB2933AD7220C93D6"
    "1A58AFB2A1667F8792E17C20ABF4B3FE22CA72F6101E905EE0C3CCCDCFEC2CCC"
    "F55FCFB66CDCB1AC1A5052CF256F044C1CC442BD1D727D5B2445AD39BCE82ECE"
    "AAF14950BF403C4408C9B94B5EC98410D1CD04F5B0C40615A470070837225CA8"
    "8167AA6E4619BD2CF43F9760DD28D7C2FA08407F5B2E1A37D429F5DA659A2B61"
    "F480509F635AA2DEB1BDAFACD56536B23BA205C9D0F559D3A15195FE663A2A2B";

static const char* SSH_SERVER_FINGERPRINT =
    "666A052FD8A2C6C29583C070DC7865831B69858F561B1C51CEBD18620F008C8F"
    "2EB54325B1053713F1B56F2AD4E99C26D4B8E8ABEBDBA1263384A8EF77B212AD"
    "AADFCAC475E781AF4C2702932D6D03839ED17562F27451F879563027DBD56321"
    "0B03384EA75135F76B44131A59AB2C01246D88C920169588A4A1866A181DF433"
    "E7AF903C5EE7BA0B0D0201478169108FE1D12E4078F93963F8B47E4D43B23438"
    "74EEC9B0A52EDB56ECC8EC552575874A231BA0D2DE8D33429ED9BD998FD5377F"
    "8F6809857640CEF633DA4082BD3D17B11BE2FEB95CF3DEF6CC4389790A315E32"
    "B5EA0FB3D16F2EAFFAD5A4A3A666E3B63BC9DFEE457D5F1E96B61AB55B339BDA";

static const char* HOME_PAGE =
    "F0714E23DD7F3ED63AE73E788FC026C7C35AA1EF7D26B78F4560769FDE6FD1DC"
    "EB28BE6761AB008DF977D2E2C33E7C1D7D8CB9AE1780472CB3BA49C715683EF5"
    "5958BA45F1E9A32F1C5FA6FC078BE3D7FB1B59A6D98803D38659DB0304645F30"
    "B114D3C0C68C7B2B029C6EA07590EC01008276DF195C1251F38BA3AD6D57B86E"
    "FE345018E8E6E32E0EAEFFD77D727609B3A4B4D20611A9CC11FF033657A3A068"
    "48377A21CA5A6394A2F2DD6194D8DD23BEB4F2A85A5D268698C61E09629A3D29"
    "E88196FC00FB89DD9601390276634FBCCF90357DAD36E003D29B6C076E13805B"
    "60F225933A3BFF281801A3FBB58BF76AFFD3E61EF2221A5F727A2DF6621BBF92";

// Un-pad the 512 character string.  We expect that the random
// string has been replaced, in the EXE, with a real value that's
// padded with spaces.

static string UnpadValue(const char* paddedValue)
{
    // NOTE: this will not work for 0-length strings but we know we don't have any.
    // TODO: make this function more robust
    int padIndex = strlen(paddedValue) - 1;

    for (; padIndex > 0; padIndex--)
    {
        if (paddedValue[padIndex] != ' ')
        {
            break;
        }
    }

    return string(paddedValue, padIndex + 1);
}