Check-in [8291e66ea6]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:At long last: PuTTY will now report its version to the server sensibly, as a release or a snapshot or a local build. With any luck this should make bug reporting easier to handle, because anyone who sends their Event Log should automatically include the version :-)
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8291e66ea66979fa8eec59a8a3ab9d1c10d2062f
User & Date: simon 2001-03-15 06:15:02.000
Context
2001-03-15
07:25
David Brinegar's workaround for an error reporting problem in some WinSocks. check-in: c4ef2ddd63 user: simon tags: trunk
06:15
At long last: PuTTY will now report its version to the server sensibly, as a release or a snapshot or a local build. With any luck this should make bug reporting easier to handle, because anyone who sends their Event Log should automatically include the version :-) check-in: 8291e66ea6 user: simon tags: trunk
06:14
Fix a trivial compiler warning check-in: 5dad092a2a user: simon tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to ssh.c.
1189
1190
1191
1192
1193
1194
1195
1196

1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216

1217
1218
1219
1220
1221
1222
1223
     * Server version "1.99" means we can choose whether we use v1
     * or v2 protocol. Choice is based on cfg.sshprot.
     */
    if (ssh_versioncmp(version, cfg.sshprot == 1 ? "2.0" : "1.99") >= 0) {
        /*
         * This is a v2 server. Begin v2 protocol.
         */
        char *verstring = "SSH-2.0-PuTTY";

        SHA_Init(&exhashbase);
        /*
         * Hash our version string and their version string.
         */
        sha_string(&exhashbase, verstring, strlen(verstring));
        sha_string(&exhashbase, vstring, strcspn(vstring, "\r\n"));
        sprintf(vstring, "%s\n", verstring);
        sprintf(vlog, "We claim version: %s", verstring);
        logevent(vlog);
        logevent("Using SSH protocol version 2");
        sk_write(s, vstring, strlen(vstring));
        ssh_protocol = ssh2_protocol;
        ssh_version = 2;
        s_rdpkt = ssh2_rdpkt;
    } else {
        /*
         * This is a v1 server. Begin v1 protocol.
         */
        sprintf(vstring, "SSH-%s-PuTTY\n",
                (ssh_versioncmp(version, "1.5") <= 0 ? version : "1.5"));

        sprintf(vlog, "We claim version: %s", vstring);
        vlog[strcspn(vlog, "\r\n")] = '\0';
        logevent(vlog);
        logevent("Using SSH protocol version 1");
        sk_write(s, vstring, strlen(vstring));
        ssh_protocol = ssh1_protocol;
        ssh_version = 1;







|
>


















|
|
>







1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
     * Server version "1.99" means we can choose whether we use v1
     * or v2 protocol. Choice is based on cfg.sshprot.
     */
    if (ssh_versioncmp(version, cfg.sshprot == 1 ? "2.0" : "1.99") >= 0) {
        /*
         * This is a v2 server. Begin v2 protocol.
         */
        char verstring[80];
        sprintf(verstring, "SSH-2.0-%s", sshver);
        SHA_Init(&exhashbase);
        /*
         * Hash our version string and their version string.
         */
        sha_string(&exhashbase, verstring, strlen(verstring));
        sha_string(&exhashbase, vstring, strcspn(vstring, "\r\n"));
        sprintf(vstring, "%s\n", verstring);
        sprintf(vlog, "We claim version: %s", verstring);
        logevent(vlog);
        logevent("Using SSH protocol version 2");
        sk_write(s, vstring, strlen(vstring));
        ssh_protocol = ssh2_protocol;
        ssh_version = 2;
        s_rdpkt = ssh2_rdpkt;
    } else {
        /*
         * This is a v1 server. Begin v1 protocol.
         */
        sprintf(vstring, "SSH-%s-%s\n",
                (ssh_versioncmp(version, "1.5") <= 0 ? version : "1.5"),
                sshver);
        sprintf(vlog, "We claim version: %s", vstring);
        vlog[strcspn(vlog, "\r\n")] = '\0';
        logevent(vlog);
        logevent("Using SSH protocol version 1");
        sk_write(s, vstring, strlen(vstring));
        ssh_protocol = ssh1_protocol;
        ssh_version = 1;
Changes to ssh.h.
178
179
180
181
182
183
184





185
186
187
188
189
190
191
extern const struct ssh_kex ssh_diffiehellman_gex;
extern const struct ssh_signkey ssh_dss;
extern const struct ssh_signkey ssh_rsa;
extern const struct ssh_mac ssh_md5;
extern const struct ssh_mac ssh_sha1;
extern const struct ssh_mac ssh_sha1_buggy;






#ifndef MSCRYPTOAPI
void SHATransform(word32 *digest, word32 *data);
#endif

int random_byte(void);
void random_add_noise(void *noise, int length);
void random_add_heavynoise(void *noise, int length);







>
>
>
>
>







178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
extern const struct ssh_kex ssh_diffiehellman_gex;
extern const struct ssh_signkey ssh_dss;
extern const struct ssh_signkey ssh_rsa;
extern const struct ssh_mac ssh_md5;
extern const struct ssh_mac ssh_sha1;
extern const struct ssh_mac ssh_sha1_buggy;

/*
 * PuTTY version number formatted as an SSH version string. 
 */
extern char sshver[];

#ifndef MSCRYPTOAPI
void SHATransform(word32 *digest, word32 *data);
#endif

int random_byte(void);
void random_add_noise(void *noise, int length);
void random_add_heavynoise(void *noise, int length);
Changes to version.c.
1
2
3
4
5
6
7
8
9
10

11
12
13
14

15
16
17
18

19
20






/*
 * PuTTY version numbering
 */

#define STR1(x) #x
#define STR(x) STR1(x)

#if defined SNAPSHOT

char ver[] = "Development snapshot " STR(SNAPSHOT);


#elif defined RELEASE

char ver[] = "Release " STR(RELEASE);


#else

char ver[] = "Unidentified build, " __DATE__ " " __TIME__;


#endif
















>




>




>


>
>
>
>
>
>
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
/*
 * PuTTY version numbering
 */

#define STR1(x) #x
#define STR(x) STR1(x)

#if defined SNAPSHOT

char ver[] = "Development snapshot " STR(SNAPSHOT);
char sshver[] = "PuTTY-Snapshot-" STR(SNAPSHOT);

#elif defined RELEASE

char ver[] = "Release " STR(RELEASE);
char sshver[] = "PuTTY-Release-" STR(RELEASE);

#else

char ver[] = "Unidentified build, " __DATE__ " " __TIME__;
char sshver[] = "PuTTY-Local: " __DATE__ " " __TIME__;

#endif

/*
 * SSH local version string MUST be under 40 characters. Here's a
 * compile time assertion to verify this.
 */
enum { vorpal_sword = 1 / (sizeof(sshver) <= 40) };