/* Check software version */
- if (len < strlen(silc_version_string))
+ cp = version + 9;
+ if (!cp)
status = SILC_SKE_STATUS_BAD_VERSION;
- cp = version + 9;
maj = atoi(cp);
cp = strchr(cp, '.');
if (cp) {
min = atoi(cp + 1);
cp++;
}
- cp = strchr(cp, '.');
- if (cp)
- build = atoi(cp + 1);
+ if (cp) {
+ cp = strchr(cp, '.');
+ if (cp)
+ build = atoi(cp + 1);
+ }
cp = silc_version_string + 9;
+ if (!cp)
+ status = SILC_SKE_STATUS_BAD_VERSION;
+
maj2 = atoi(cp);
cp = strchr(cp, '.');
if (cp) {
min2 = atoi(cp + 1);
cp++;
}
- cp = strchr(cp, '.');
- if (cp)
- build2 = atoi(cp + 1);
+ if (cp) {
+ cp = strchr(cp, '.');
+ if (cp)
+ build2 = atoi(cp + 1);
+ }
if (maj != maj2)
status = SILC_SKE_STATUS_BAD_VERSION;
/* Remote end is client */
if (conn_type == SILC_SOCKET_TYPE_CLIENT) {
- SilcServerConfigSectionClientConnection *client = ctx->config;
+ SilcServerConfigSectionClientConnection *client = ctx->cconfig;
if (client) {
switch(client->auth_meth) {
/* Remote end is server */
if (conn_type == SILC_SOCKET_TYPE_SERVER) {
- SilcServerConfigSectionServerConnection *serv = ctx->config;
+ SilcServerConfigSectionServerConnection *serv = ctx->sconfig;
if (serv) {
switch(serv->auth_meth) {
/* Remote end is router */
if (conn_type == SILC_SOCKET_TYPE_ROUTER) {
- SilcServerConfigSectionServerConnection *serv = ctx->config;
+ SilcServerConfigSectionServerConnection *serv = ctx->rconfig;
if (serv) {
switch(serv->auth_meth) {