#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];
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);