s_write(pktout.data, biglen+4);
}
+static int ssh_versioncmp(char *a, char *b) {
+ char *ae, *be;
+ unsigned long av, bv;
+
+ av = strtoul(a, &ae, 10);
+ bv = strtoul(b, &be, 10);
+ if (av != bv) return (av < bv ? -1 : +1);
+ if (*ae == '.') ae++;
+ if (*be == '.') be++;
+ av = strtoul(ae, &ae, 10);
+ bv = strtoul(be, &be, 10);
+ if (av != bv) return (av < bv ? -1 : +1);
+ return 0;
+}
+
static int do_ssh_init(void) {
char c;
char version[10];
break;
}
- sprintf(vstring, "SSH-%s-7.7.7\n",
- (strcmp(version, "1.5") <= 0 ? version : "1.5"));
+ sprintf(vstring, "SSH-%s-PuTTY\n",
+ (ssh_versioncmp(version, "1.5") <= 0 ? version : "1.5"));
s_write(vstring, strlen(vstring));
return 1;
}
int cipher_type;
extern struct ssh_cipher ssh_3des;
+ extern struct ssh_cipher ssh_des;
extern struct ssh_cipher ssh_blowfish;
crBegin;
}
cipher_type = cfg.cipher == CIPHER_BLOWFISH ? SSH_CIPHER_BLOWFISH :
+ cfg.cipher == CIPHER_DES ? SSH_CIPHER_DES :
SSH_CIPHER_3DES;
if ((supported_ciphers_mask & (1 << cipher_type)) == 0) {
c_write("Selected cipher not supported, falling back to 3DES\r\n", 53);
free(rsabuf);
cipher = cipher_type == SSH_CIPHER_BLOWFISH ? &ssh_blowfish :
+ cipher_type == SSH_CIPHER_DES ? &ssh_des :
&ssh_3des;
cipher->sesskey(session_key);