#include "reject.h"
#include "sslproc.h"
#include "capability.h"
+#include "s_assert.h"
#ifndef INADDR_NONE
#define INADDR_NONE ((unsigned int) 0xffffffff)
{
serv_capindex = capability_index_create("server capabilities");
+ /* These two are not set via CAPAB/GCAP keywords. */
+ CAP_CAP = capability_put_anonymous(serv_capindex);
+ CAP_TS6 = capability_put_anonymous(serv_capindex);
+
CAP_QS = capability_put(serv_capindex, "QS");
CAP_EX = capability_put(serv_capindex, "EX");
CAP_CHW = capability_put(serv_capindex, "CHW");
CAP_EOPMOD = capability_put(serv_capindex, "EOPMOD");
CAP_BAN = capability_put(serv_capindex, "BAN");
CAP_MLOCK = capability_put(serv_capindex, "MLOCK");
+
+ capability_require(serv_capindex, "QS");
+ capability_require(serv_capindex, "ENCAP");
}
static CNCB serv_connect_callback;
struct server_conf *tmp_p;
rb_dlink_node *ptr;
int error = -1;
+ const char *encr;
s_assert(NULL != client_p);
if(client_p == NULL)
{
if(ServerConfEncrypted(tmp_p))
{
- if(!strcmp(tmp_p->passwd, rb_crypt(client_p->localClient->passwd,
- tmp_p->passwd)))
+ encr = rb_crypt(client_p->localClient->passwd,
+ tmp_p->passwd);
+ if(encr != NULL && !strcmp(tmp_p->passwd, encr))
{
server_p = tmp_p;
break;
if(!IsServer(target_p) || !target_p->serv->caps) /* short circuit if no caps */
return msgbuf + 1;
+ rb_strlcat(msgbuf, " ", sizeof(msgbuf));
rb_strlcat(msgbuf, capability_index_list(serv_capindex, target_p->serv->caps), sizeof(msgbuf));
return msgbuf + 1;
me.id, client_p->name, client_p->id,
IsHidden(client_p) ? "(H) " : "", client_p->info);
- if(IsCapable(target_p, CAP_ENCAP) &&
- !EmptyString(client_p->serv->fullcaps))
+ if(!EmptyString(client_p->serv->fullcaps))
sendto_one(target_p, ":%s ENCAP * GCAP :%s",
client_p->id, client_p->serv->fullcaps);
}
me.name, client_p->name,
IsHidden(client_p) ? "(H) " : "", client_p->info);
- if(IsCapable(target_p, CAP_ENCAP) &&
- !EmptyString(client_p->serv->fullcaps))
+ if(!EmptyString(client_p->serv->fullcaps))
sendto_one(target_p, ":%s ENCAP * GCAP :%s",
client_p->name, client_p->serv->fullcaps);
}
target_p->name, target_p->hopcount + 1,
IsHidden(target_p) ? "(H) " : "", target_p->info);
- if(IsCapable(client_p, CAP_ENCAP) &&
- !EmptyString(target_p->serv->fullcaps))
+ if(!EmptyString(target_p->serv->fullcaps))
sendto_one(client_p, ":%s ENCAP * GCAP :%s",
get_id(target_p, client_p),
target_p->serv->fullcaps);