Author: Pekka Riikonen <priikone@silcnet.org>
- Copyright (C) 1997 - 2003 Pekka Riikonen
+ Copyright (C) 1997 - 2006 Pekka Riikonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
SilcSKEStatus silc_ske_check_version(SilcSKE ske, unsigned char *version,
SilcUInt32 len, void *context)
{
- SilcUInt32 l_protocol_version = 0, r_protocol_version = 0;
+ SilcUInt32 r_protocol_version = 0;
SILC_LOG_INFO(("%s (%s) is version %s", ske->sock->hostname,
ske->sock->ip, version));
return SILC_SKE_STATUS_BAD_VERSION;
}
- if (!silc_parse_version_string(silc_version_string,
- &l_protocol_version, NULL, NULL,
- NULL, NULL)) {
- SILC_LOG_ERROR(("%s (%s) %s is not allowed/supported version",
- ske->sock->hostname, ske->sock->ip, version));
- return SILC_SKE_STATUS_BAD_VERSION;
- }
-
- /* If remote is too new, don't connect */
- if (l_protocol_version < r_protocol_version) {
- SILC_LOG_ERROR(("%s (%s) %s is not allowed/supported version",
- ske->sock->hostname, ske->sock->ip, version));
- return SILC_SKE_STATUS_BAD_VERSION;
- }
-
ske->sock->version = r_protocol_version;
return SILC_SKE_STATUS_OK;
*/
/* Send abort notification */
- silc_ske_abort(ctx->ske, ctx->ske->status);
+ if (ctx->ske)
+ silc_ske_abort(ctx->ske, ctx->ske->status);
/* Unregister the timeout task since the protocol has ended.
This was the timeout task to be executed if the protocol is
* Error occured
*/
- if (ctx->pfs == TRUE)
+ if (ctx->pfs == TRUE && ctx->ske)
/* Send abort notification */
silc_ske_abort(ctx->ske, ctx->ske->status);