starttls: take ownership of 'tls' capability

This commit is contained in:
William Pitcock 2016-02-27 01:45:40 -06:00
parent 32df5e96a6
commit 0416a2cc86
3 changed files with 20 additions and 5 deletions

View file

@ -67,11 +67,9 @@ extern unsigned int CLICAP_SASL;
extern unsigned int CLICAP_ACCOUNT_NOTIFY;
extern unsigned int CLICAP_EXTENDED_JOIN;
extern unsigned int CLICAP_AWAY_NOTIFY;
extern unsigned int CLICAP_TLS;
extern unsigned int CLICAP_USERHOST_IN_NAMES;
extern unsigned int CLICAP_CAP_NOTIFY;
extern unsigned int CLICAP_CHGHOST;
extern unsigned int CLICAP_ACCOUNT_TAG;
/*
* XXX: this is kind of ugly, but this allows us to have backwards

View file

@ -100,7 +100,6 @@ unsigned int CLICAP_SASL;
unsigned int CLICAP_ACCOUNT_NOTIFY;
unsigned int CLICAP_EXTENDED_JOIN;
unsigned int CLICAP_AWAY_NOTIFY;
unsigned int CLICAP_TLS;
unsigned int CLICAP_USERHOST_IN_NAMES;
unsigned int CLICAP_CAP_NOTIFY;
unsigned int CLICAP_CHGHOST;
@ -148,7 +147,6 @@ init_builtin_capabs(void)
CLICAP_ACCOUNT_NOTIFY = capability_put(cli_capindex, "account-notify", NULL);
CLICAP_EXTENDED_JOIN = capability_put(cli_capindex, "extended-join", NULL);
CLICAP_AWAY_NOTIFY = capability_put(cli_capindex, "away-notify", NULL);
CLICAP_TLS = capability_put(cli_capindex, "tls", NULL);
CLICAP_USERHOST_IN_NAMES = capability_put(cli_capindex, "userhost-in-names", NULL);
CLICAP_CAP_NOTIFY = capability_put(cli_capindex, "cap-notify", NULL);
CLICAP_CHGHOST = capability_put(cli_capindex, "chghost", NULL);

View file

@ -41,7 +41,26 @@ struct Message starttls_msgtab = {
mapi_clist_av1 starttls_clist[] = { &starttls_msgtab, NULL };
DECLARE_MODULE_AV1(starttls, NULL, NULL, starttls_clist, NULL, NULL, "$Revision$");
unsigned int CLICAP_TLS = 0;
static int
_modinit(void)
{
#ifdef HAVE_LIBCRYPTO
CLICAP_TLS = capability_put(cli_capindex, "tls", NULL);
#endif
return 0;
}
static void
_moddeinit(void)
{
#ifdef HAVE_LIBCRYPTO
capability_orphan(cli_capindex, "tls");
#endif
}
DECLARE_MODULE_AV1(starttls, _modinit, _moddeinit, starttls_clist, NULL, NULL, "$Revision$");
static int
mr_starttls(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])