Ver Fonte

* Kill connection if no shared cipher

Bryan Drewery há 15 anos atrás
pai
commit
f1aec87d01
1 ficheiros alterados com 8 adições e 0 exclusões
  1. 8 0
      src/enclink.c

+ 8 - 0
src/enclink.c

@@ -291,6 +291,14 @@ void link_challenge_to(int idx, char *buf) {
     }
     free(tmpp);
 
+    // No shared type!
+    if (i == -1) {
+      sdprintf(STR("No shared cipher with %s"), dcc[idx].nick);
+      killsock(dcc[idx].sock);
+      lostdcc(idx);
+      return;
+    }
+
     sdprintf(STR("Choosing '%s' (%d/%d) for link to %s"), enclink[i].name, enclink[i].type, i, dcc[idx].nick);
     link_hash(idx, rand);
     dprintf(-dcc[idx].sock, STR("neg %s %d %s\n"), dcc[idx].shahash, enclink[i].type, dcc[idx].nick);