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 :-)
git-svn-id: svn://svn.tartarus.org/sgt/putty@1003
cda61777-01e9-0310-a592-
d414129be87e
/*
* This is a v2 server. Begin v2 protocol.
*/
/*
* 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_Init(&exhashbase);
/*
* Hash our version string and their version string.
/*
* This is a v1 server. Begin v1 protocol.
*/
/*
* 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);
sprintf(vlog, "We claim version: %s", vstring);
vlog[strcspn(vlog, "\r\n")] = '\0';
logevent(vlog);
extern const struct ssh_mac ssh_sha1;
extern const struct ssh_mac ssh_sha1_buggy;
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
#ifndef MSCRYPTOAPI
void SHATransform(word32 *digest, word32 *data);
#endif
#if defined SNAPSHOT
char ver[] = "Development snapshot " STR(SNAPSHOT);
#if defined SNAPSHOT
char ver[] = "Development snapshot " STR(SNAPSHOT);
+char sshver[] = "PuTTY-Snapshot-" STR(SNAPSHOT);
#elif defined RELEASE
char ver[] = "Release " STR(RELEASE);
#elif defined RELEASE
char ver[] = "Release " STR(RELEASE);
+char sshver[] = "PuTTY-Release-" STR(RELEASE);
#else
char ver[] = "Unidentified build, " __DATE__ " " __TIME__;
#else
char ver[] = "Unidentified build, " __DATE__ " " __TIME__;
+char sshver[] = "PuTTY-Local: " __DATE__ " " __TIME__;
+
+/*
+ * 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) };