If we are not serving TLS, shutdown the connection if someone tries TLS. - geomyidae - A small C-based gopherd.
(HTM) git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
(DIR) LICENSE
---
(DIR) commit 91ac958ffd895f773c056c5a5a0301c64e6db50c
(DIR) parent 2f68d11cbcca3d8d0a6d6488de48bca802c3090d
(HTM) Author: Christoph Lohmann <20h@r-36.net>
Date: Sun, 15 Nov 2020 13:56:18 +0100
If we are not serving TLS, shutdown the connection if someone tries TLS.
Diffstat:
M main.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
---
(DIR) diff --git a/main.c b/main.c
@@ -780,12 +780,12 @@ main(int argc, char *argv[])
if (tls_handshake(tlsclientctx) < 0)
return 1;
}
-#else /* ENABLE_TLS */
+#endif /* ENABLE_TLS */
/*
* Some TLS request. Help them determine we only
* serve plaintext.
*/
- if (byte0 == 0x16) {
+ if (byte0 == 0x16 && !dotls) {
if (loglvl & CONN) {
logentry(clienth, clientp, "-",
"disconnected");
@@ -796,7 +796,6 @@ main(int argc, char *argv[])
return 1;
}
-#endif /* ENABLE_TLS */
maxrecv = sizeof(recvb) - 1;
do {