X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=command.c;h=00f8dc31cdd8f0be3fbebfd9a9bf0e25650844f0;hp=531c776a3249e6d555c6570746c1e6036e125f7d;hb=a87d4a87ac7418084eb78f0bcb3accff1388df3a;hpb=685a2bc66e77978104039b8173a6039a80d8b733 diff --git a/command.c b/command.c index 531c776a..00f8dc31 100644 --- a/command.c +++ b/command.c @@ -32,10 +32,6 @@ #include "daemon.h" #include "string.h" -void (*crypt_function_recv)(unsigned long len, const unsigned char *indata, - unsigned char *outdata) = NULL; -void (*crypt_function_send)(unsigned long len, const unsigned char *indata, - unsigned char *outdata) = NULL; static RC4_KEY rc4_recv_key; static RC4_KEY rc4_send_key; static unsigned char rc4_buf[2 * RC4_KEY_LEN]; @@ -1171,11 +1167,8 @@ int handle_connect(int fd, struct sockaddr_in *addr) ret = send_bin_buffer(fd, buf, numbytes); if (ret < 0) goto err_out; - if (use_rc4) { - crypt_function_recv = rc4_recv; - crypt_function_send = rc4_send; - PARA_INFO_LOG("%s", "rc4 encryption activated\n"); - } + if (use_rc4) + enable_crypt(fd, rc4_recv, rc4_send); /* read command */ while ((numbytes = recv_buffer(fd, buf, sizeof(buf))) > 0) { // PARA_INFO_LOG("recvd: %s (%d)\n", buf, numbytes);