From 572488e0295bd054d9b75021d3cfe8faf56afb4f Mon Sep 17 00:00:00 2001 From: Jilles Tjoelker Date: Mon, 4 Apr 2011 00:59:20 +0200 Subject: [PATCH] If the sasl mechanism is EXTERNAL, send the certfp in the initial S message. --- modules/m_sasl.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/m_sasl.c b/modules/m_sasl.c index 41bf823d..8dbbf0e7 100644 --- a/modules/m_sasl.c +++ b/modules/m_sasl.c @@ -106,8 +106,15 @@ 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]);