X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/d8c45202e39f71ca967b7c1264c8b8911afc0755..b2c208be091670e3c5259eba77187bae6ac6eece:/modules/m_sasl.c diff --git a/modules/m_sasl.c b/modules/m_sasl.c index b17e6bdc..8dbbf0e7 100644 --- a/modules/m_sasl.c +++ b/modules/m_sasl.c @@ -77,6 +77,12 @@ mr_authenticate(struct Client *client_p, struct Client *source_p, if(!IsCapable(source_p, CLICAP_SASL)) return 0; + if (strlen(client_p->id) == 3) + { + exit_client(client_p, client_p, client_p, "Mixing client and server protocol"); + return 0; + } + if(source_p->preClient->sasl_complete) { sendto_one(source_p, form_str(ERR_SASLALREADY), me.name, EmptyString(source_p->name) ? "*" : source_p->name); @@ -100,12 +106,18 @@ mr_authenticate(struct Client *client_p, struct Client *source_p, agent_p = find_id(source_p->preClient->sasl_agent); if(agent_p == NULL) - sendto_server(NULL, NULL, CAP_TS6|CAP_ENCAP, NOCAPS, ":%s ENCAP * SASL %s * S %s", me.id, - source_p->id, parv[1]); + { + if (!strcmp(parv[1], "EXTERNAL") && source_p->certfp != NULL) + sendto_server(NULL, NULL, CAP_TS6|CAP_ENCAP, NOCAPS, ":%s ENCAP * SASL %s * S %s %s", me.id, + source_p->id, parv[1], + source_p->certfp); + else + sendto_server(NULL, NULL, CAP_TS6|CAP_ENCAP, NOCAPS, ":%s ENCAP * SASL %s * S %s", me.id, + source_p->id, parv[1]); + } else sendto_one(agent_p, ":%s ENCAP %s SASL %s %s C %s", me.id, agent_p->servptr->name, source_p->id, agent_p->id, parv[1]); - source_p->preClient->sasl_out++; return 0;