Diff

Differences From Artifact [96c51356e7]:

To Artifact [7e5ab59810]:


199
200
201
202
203
204
205

206
207
208
209
210
211
212
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213







+







static struct ssh_compress *cscomp = NULL;
static struct ssh_compress *sccomp = NULL;
static struct ssh_kex *kex = NULL;
static struct ssh_hostkey *hostkey = NULL;
int (*ssh_get_password)(const char *prompt, char *str, int maxlen) = NULL;

static char *savedhost;
static int savedport;
static int ssh_send_ok;

/*
 * 2-3-4 tree storing channels.
 */
struct ssh_channel {
    unsigned remoteid, localid;
700
701
702
703
704
705
706

707
708
709
710
711
712
713
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715







+







    savedhost = malloc(1+strlen(host));
    if (!savedhost)
	fatalbox("Out of memory");
    strcpy(savedhost, host);

    if (port < 0)
	port = 22;		       /* default ssh port */
    savedport = port;

#ifdef FWHACK
    FWhost = host;
    FWport = port;
    host = FWSTR;
    port = 23;
#endif
1144
1145
1146
1147
1148
1149
1150
1151

1152
1153
1154
1155
1156
1157
1158
1146
1147
1148
1149
1150
1151
1152

1153
1154
1155
1156
1157
1158
1159
1160







-
+







        int len = rsastr_len(&hostkey);
        char fingerprint[100];
        char *keystr = malloc(len);
        if (!keystr)
            fatalbox("Out of memory");
        rsastr_fmt(keystr, &hostkey);
        rsa_fingerprint(fingerprint, sizeof(fingerprint), &hostkey);
        verify_ssh_host_key(savedhost, "rsa", keystr, fingerprint);
        verify_ssh_host_key(savedhost, savedport, "rsa", keystr, fingerprint);
        free(keystr);
    }

    for (i=0; i<32; i++) {
	rsabuf[i] = session_key[i];
	if (i < 16)
	    rsabuf[i] ^= session_id[i];
2052
2053
2054
2055
2056
2057
2058
2059


2060
2061
2062
2063
2064
2065
2066
2054
2055
2056
2057
2058
2059
2060

2061
2062
2063
2064
2065
2066
2067
2068
2069







-
+
+








    /*
     * Authenticate remote host: verify host key. (We've already
     * checked the signature of the exchange hash.)
     */
    keystr = hostkey->fmtkey();
    fingerprint = hostkey->fingerprint();
    verify_ssh_host_key(savedhost, hostkey->keytype, keystr, fingerprint);
    verify_ssh_host_key(savedhost, savedport, hostkey->keytype,
                        keystr, fingerprint);
    logevent("Host key fingerprint is:");
    logevent(fingerprint);
    free(fingerprint);
    free(keystr);

    /*
     * Send SSH2_MSG_NEWKEYS.