X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=apps%2Fsilcd%2Fprotocol.c;h=fbe1f566d0a15b8a24baea01817dfb488cc05e92;hb=4519ed70ffbb48c8f92709af462f8499e78f31f3;hp=685b5ab654250a9c5ff10b64d9db5566c23710dd;hpb=58b8d8f72ac021305b83f61d27865a0178dc7715;p=silc.git diff --git a/apps/silcd/protocol.c b/apps/silcd/protocol.c index 685b5ab6..fbe1f566 100644 --- a/apps/silcd/protocol.c +++ b/apps/silcd/protocol.c @@ -115,12 +115,26 @@ static void silc_server_protocol_ke_set_keys(SilcSKE ske, sock->user_data = (void *)conn_data; } -/* XXX TODO */ +/* Check remote host version string */ SilcSKEStatus silc_ske_check_version(SilcSKE ske, unsigned char *version, unsigned int len) { - return SILC_SKE_STATUS_OK; + SilcSKEStatus status = SILC_SKE_STATUS_OK; + + /* Check for initial version string */ + if (!strstr(version, "SILC-1.0-")) + status = SILC_SKE_STATUS_BAD_VERSION; + + /* Check software version */ + + if (len < strlen(silc_version_string)) + status = SILC_SKE_STATUS_BAD_VERSION; + + /* XXX for now there is no other tests due to the abnormal version + string that is used */ + + return status; } /* Performs key exchange protocol. This is used for both initiator