X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=command.c;h=1a090e49d71bb3d1ff3545236265f4c052bf83fe;hp=ece87e168a7e42b406526a9638ef5bf7126cd45c;hb=15ddd9078769b8c866061a8f715f5dbdcea66fd0;hpb=a5ec1a6f44b149c0b018c1da8c1703109c5bdc8c diff --git a/command.c b/command.c index ece87e16..1a090e49 100644 --- a/command.c +++ b/command.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include @@ -730,7 +729,7 @@ __noreturn void handle_connect(int fd, const char *peername) int ret, argc; char buf[4096]; unsigned char rand_buf[CHALLENGE_SIZE + 2 * SESSION_KEY_LEN]; - unsigned char challenge_sha1[HASH_SIZE]; + unsigned char challenge_hash[HASH_SIZE]; struct user *u; struct server_command *cmd = NULL; char **argv = NULL; @@ -795,14 +794,14 @@ __noreturn void handle_connect(int fd, const char *peername) if (!u) goto net_err; /* - * The correct response is the sha1 of the first CHALLENGE_SIZE bytes + * The correct response is the hash of the first CHALLENGE_SIZE bytes * of the random data. */ ret = -E_BAD_AUTH; if (numbytes != HASH_SIZE) goto net_err; - sha1_hash((char *)rand_buf, CHALLENGE_SIZE, challenge_sha1); - if (memcmp(challenge_sha1, buf, HASH_SIZE)) + hash_function((char *)rand_buf, CHALLENGE_SIZE, challenge_hash); + if (memcmp(challenge_hash, buf, HASH_SIZE)) goto net_err; /* auth successful */ alarm(0);