Diff

Differences From Artifact [560b471690]:

To Artifact [8c192bb125]:


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
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 = "SSH-2.0-PuTTY";
        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-PuTTY\n",
                (ssh_versioncmp(version, "1.5") <= 0 ? version : "1.5"));
        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;