1
0

0001-Respect-SSLConnect-option-for-incoming-connections.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From d09dc33e7d0f148ff9c0afff905414cc13d636fc Mon Sep 17 00:00:00 2001
  2. From: Alexander Barton <alex@barton.de>
  3. Date: Mon, 1 Jan 2024 18:20:26 +0100
  4. Subject: [PATCH 01/20] Respect "SSLConnect" option for incoming connections
  5. Bug-Debian: https://bugs.debian.org/1067237
  6. Don't accept incoming plain-text ("non SSL") server connections for
  7. servers configured with "SSLConnect" enabled.
  8. If "SSLConnect" is not set for an incoming connection the server still
  9. accepts both plain-text and encrypted connections.
  10. This change prevents an authenticated client-server being able to force
  11. the server-server to send its password on a plain-text connection when
  12. SSL/TLS was intended.
  13. (cherry picked from commit 21c1751b045b0be49e584a4ba191a330e0c381bb)
  14. ---
  15. src/ngircd/irc-server.c | 13 +++++++++++++
  16. 1 file changed, 13 insertions(+)
  17. --- a/src/ngircd/irc-server.c
  18. +++ b/src/ngircd/irc-server.c
  19. @@ -87,6 +87,19 @@
  20. return DISCONNECTED;
  21. }
  22. +#ifdef SSL_SUPPORT
  23. + /* Does this server require an SSL connection? */
  24. + if (Conf_Server[i].SSLConnect &&
  25. + !(Conn_Options(Client_Conn(Client)) & CONN_SSL)) {
  26. + Log(LOG_ERR,
  27. + "Connection %d: Server \"%s\" requires a secure connection!",
  28. + Client_Conn(Client), Req->argv[0]);
  29. + Conn_Close(Client_Conn(Client), NULL,
  30. + "Secure connection required", true);
  31. + return DISCONNECTED;
  32. + }
  33. +#endif
  34. +
  35. /* Check server password */
  36. if (strcmp(Conn_Password(Client_Conn(Client)),
  37. Conf_Server[i].pwd_in) != 0) {