summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--dispatch.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/dispatch.c b/dispatch.c
index 71f8fc7..0c3fffa 100644
--- a/dispatch.c
+++ b/dispatch.c
@@ -133,6 +133,16 @@ static char *serverName(void) {
 	return NULL;
 }
 
+static const uint8_t Alert[] = {
+	0x15, 0x03, 0x03, 0x00, 0x02, // TLSPlaintext
+	0x02, 0x70, // Alert fatal unrecognized_name
+};
+
+static void alert(int sock) {
+	ssize_t len = send(sock, Alert, sizeof(Alert), 0);
+	if (len < 0) warn("send");
+}
+
 int main(int argc, char *argv[]) {
 	const char *host = "localhost";
 	const char *port = "6697";
@@ -268,6 +278,7 @@ int main(int argc, char *argv[]) {
 
 			char *name = serverName();
 			if (!name || name[0] == '.' || name[0] == '/') {
+				alert(event.ptr[i].fd);
 				eventRemove(i);
 				continue;
 			}
@@ -288,11 +299,16 @@ int main(int argc, char *argv[]) {
 #else
 			error = connect(sock, (struct sockaddr *)&addr, SUN_LEN(&addr));
 #endif
-			if (error) warn("%s", name);
 
-			if (!error) {
+			if (error) {
+				warn("%s", name);
+				alert(event.ptr[i].fd);
+			} else {
 				len = sendfd(sock, event.ptr[i].fd);
-				if (len < 0) warn("%s", name);
+				if (len < 0) {
+					warn("%s", name);
+					alert(event.ptr[i].fd);
+				}
 			}
 
 			close(sock);
p;id=20e2ef936b182c461b604fa874a556abd07c98e2&follow=1'>import: Add missing scripts/wrap-compiler-for-flag-checkJune McEnroe 2021-05-08Import LibreSSL 3.3.3June McEnroe 2021-04-18build: Remove added x509_verify.3 links 3.3.2June McEnroe 2021-04-18tls: Use EC_KEY_set_ex_dataJune McEnroe 2021-04-18Import LibreSSL 3.3.2June McEnroe 2021-03-05Bump version to 3.3.1p1 3.3.1p1June McEnroe 2021-03-05build: Add OpenSSL includes to libcompatJune McEnroe Some compat sources (getentropy_linux.c for example) require OpenSSL. Reported by Robert Scheck. 2020-12-15Import LibreSSL 3.3.1June McEnroe 2020-11-24Import LibreSSL 3.3.0June McEnroe 2020-10-22Import LibreSSL 3.2.2June McEnroe 2020-09-29Import LibreSSL 3.2.1June McEnroe 2020-09-29import: Add m4/ax_add_fortify_source.m4June McEnroe 2020-08-05build: Add README.7 to EXTRA_DIST 3.2.0June McEnroe 2020-08-03doc: Indicate that only OpenSSL 1.1.1b and newer workJune McEnroe