]> git.tuebingen.mpg.de Git - paraslash.git/blobdiff - client_common.c
Document RC4_ALIGN.
[paraslash.git] / client_common.c
index ba419786ee036745972825ec49629d9f1cf342ab..33ad19546d2a6e8f5d072152f75e11fefbd6fb18 100644 (file)
@@ -8,7 +8,6 @@
 
 #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. */
@@ -183,7 +180,7 @@ static void client_post_select(struct sched *s, struct task *t)
                /* 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)
@@ -193,13 +190,13 @@ static void client_post_select(struct sched *s, struct task *t)
                        (unsigned char *)buf, n);
                if (ret < 0)
                        goto out;
-               sha1_hash((char *)crypt_buf, CHALLENGE_SIZE, challenge_sha1);
-               ct->scc.send = sc_new(crypt_buf + CHALLENGE_SIZE, RC4_KEY_LEN);
-               ct->scc.recv = sc_new(crypt_buf + CHALLENGE_SIZE + RC4_KEY_LEN,
-                       RC4_KEY_LEN);
-               hash_to_asc(challenge_sha1, buf);
+               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_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;