X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=ssh.c;h=b30d0265df35678cd162937a21fdaed67d5fa5d8;hb=49d2cf19accb059b3b68d1fc2b78e606a578c3e8;hp=c55d217472e12da7e63ed4b61af337196f90f0b2;hpb=8fb9bd0216f49ef0ae94371a3325402301ad2d47;p=PuTTY.git diff --git a/ssh.c b/ssh.c index c55d2174..b30d0265 100644 --- a/ssh.c +++ b/ssh.c @@ -134,7 +134,7 @@ static const char *const ssh2_disconnect_reasons[] = { "protocol error", "key exchange failed", "host authentication failed", - "mac error", + "MAC error", "compression error", "service not available", "protocol version not supported", @@ -1587,7 +1587,7 @@ static void ssh_pkt_ensure(struct Packet *pkt, int length) { if (pkt->maxlen < length) { unsigned char *body = pkt->body; - int offset = body ? pkt->data - body : 0; + int offset = body ? body - pkt->data : 0; pkt->maxlen = length + 256; pkt->data = sresize(pkt->data, pkt->maxlen + APIEXTRA, unsigned char); if (body) pkt->body = pkt->data + offset; @@ -1697,10 +1697,10 @@ static struct Packet *ssh1_pkt_init(int pkt_type) static struct Packet *ssh2_pkt_init(int pkt_type) { struct Packet *pkt = ssh_new_packet(); - pkt->length = 5; + pkt->length = 5; /* space for packet length + padding length */ pkt->forcepad = 0; ssh_pkt_addbyte(pkt, (unsigned char) pkt_type); - pkt->body = pkt->data + pkt->length; + pkt->body = pkt->data + pkt->length; /* after packet type */ return pkt; } @@ -6640,7 +6640,7 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen, if (keytype == SSH_KEYTYPE_SSH2) { s->publickey_blob = ssh2_userkey_loadpub(&ssh->cfg.keyfile, NULL, - &s->publickey_bloblen, NULL); + &s->publickey_bloblen, NULL, NULL); } else { char *msgbuf; logeventf(ssh, "Unable to use this key file (%s)", @@ -6982,7 +6982,7 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen, (unsigned char *)ssh2_userkey_loadpub(&ssh->cfg.keyfile, &algorithm, &pub_blob_len, - NULL); + NULL, NULL); if (pub_blob) { s->pktout = ssh2_pkt_init(SSH2_MSG_USERAUTH_REQUEST); ssh2_pkt_addstring(s->pktout, s->username);