#include <regex.h>
#include <sys/types.h>
-#include <dirent.h>
#include "para.h"
#include "error.h"
#include "sched.h"
#include "client.cmdline.h"
#include "crypt.h"
-#include "rc4.h"
#include "net.h"
#include "fd.h"
#include "string.h"
#include "client.cmdline.h"
#include "client.h"
-#include "hash.h"
#include "buffer_tree.h"
/** The size of the receiving buffer. */
/* decrypted challenge/session key buffer */
unsigned char crypt_buf[1024];
/* the SHA1 of the decrypted challenge */
- unsigned char challenge_sha1[HASH_SIZE];
+ unsigned char challenge_hash[HASH_SIZE];
ret = client_recv_buffer(ct, &s->rfds, buf, sizeof(buf), &n);
if (ret < 0 || n == 0)
(unsigned char *)buf, n);
if (ret < 0)
goto out;
- sha1_hash((char *)crypt_buf, CHALLENGE_SIZE, challenge_sha1);
+ hash_function((char *)crypt_buf, CHALLENGE_SIZE, challenge_hash);
ct->scc.send = sc_new(crypt_buf + CHALLENGE_SIZE, SESSION_KEY_LEN);
ct->scc.recv = sc_new(crypt_buf + CHALLENGE_SIZE + SESSION_KEY_LEN,
SESSION_KEY_LEN);
- hash_to_asc(challenge_sha1, buf);
+ hash_to_asc(challenge_hash, buf);
PARA_INFO_LOG("--> %s\n", buf);
- ret = send_bin_buffer(ct->scc.fd, (char *)challenge_sha1,
+ ret = send_bin_buffer(ct->scc.fd, (char *)challenge_hash,
HASH_SIZE);
if (ret < 0)
goto out;