From c4e81ae9e971c743717ced21ed98a26f4c793fde Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sat, 22 Sep 2012 19:31:55 -0500 Subject: [PATCH] m_starttls: handle error condition with ERR_STARTTLS (691) numeric per tls-3.2 specification --- include/numeric.h | 2 ++ modules/m_starttls.c | 1 + src/messages.tab | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/numeric.h b/include/numeric.h index 2fca4990..9bdc827e 100644 --- a/include/numeric.h +++ b/include/numeric.h @@ -319,6 +319,8 @@ extern const char *form_str(int); #define RPL_STARTTLS 670 /* ircv3.atheme.org tls-3.1 */ #define RPL_WHOISSECURE 671 /* Unreal3.2 --nenolod */ +#define ERR_STARTTLS 691 /* ircv3.atheme.org tls-3.2 */ + #define RPL_MODLIST 702 #define RPL_ENDOFMODLIST 703 diff --git a/modules/m_starttls.c b/modules/m_starttls.c index 81c7952a..b976f794 100644 --- a/modules/m_starttls.c +++ b/modules/m_starttls.c @@ -54,6 +54,7 @@ mr_starttls(struct Client *client_p, struct Client *source_p, int parc, const ch if (rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &F[0], &F[1], "STARTTLS ssld session") == -1) { ilog_error("error creating SSL/TLS socketpair for ssld slave"); + sendto_one_numeric(client_p, ERR_STARTTLS, form_str(ERR_STARTTLS), "Unable to create SSL/TLS socketpair for ssld offload slave"); return 1; } diff --git a/src/messages.tab b/src/messages.tab index 864d1cfa..942f8664 100644 --- a/src/messages.tab +++ b/src/messages.tab @@ -716,7 +716,7 @@ static const char * replies[] = { /* 688 */ NULL, /* 689 */ NULL, /* 690 */ NULL, -/* 691 */ NULL, +/* 691 ERR_STARTTLS */ ":%s", /* 692 */ NULL, /* 693 */ NULL, /* 694 */ NULL,