Browse Source

replaced magic 60 with COOKIE_SEED_LEN

pull/1/head
Maximilian Münchow 8 years ago
parent
commit
5a002888d0
  1. 5
      src/libxt_TS3INIT_SET_COOKIE.c
  2. 5
      src/libxt_ts3init_get_puzzle.c
  3. 2
      src/ts3init_cookie_seed.h

5
src/libxt_TS3INIT_SET_COOKIE.c

@ -27,9 +27,10 @@ static void ts3init_set_cookie_tg_help(void) @@ -27,9 +27,10 @@ static void ts3init_set_cookie_tg_help(void)
printf(
"TS3INIT_SET_COOKIE target options:\n"
" --zero-random-sequence Always return 0 as random sequence.\n"
" --seed <seed> Seed is a 60 byte lowercase hex number in.\n"
" --seed <seed> Seed is a %i byte lowercase hex number in.\n"
" A source could be /dev/random.\n"
" --seed-file <file> Read the seed from a file.\n");
" --seed-file <file> Read the seed from a file.\n",
COOKIE_SEED_LEN);
}
static const struct option ts3init_set_cookie_tg_opts[] = {

5
src/libxt_ts3init_get_puzzle.c

@ -29,9 +29,10 @@ static void ts3init_get_puzzle_help(void) @@ -29,9 +29,10 @@ static void ts3init_get_puzzle_help(void)
"ts3init_get_puzzle match options:\n"
" --min-client n The sending client needs to be at least version.\n"
" --check-cookie Check that the cookie was generated by same seed.\n"
" --seed <seed> Seed is a 60 byte lowercase hex number in.\n"
" --seed <seed> Seed is a %i byte lowercase hex number in.\n"
" A source could be /dev/random.\n"
" --seed-file <file> Read the seed from a file.\n"
" --seed-file <file> Read the seed from a file.\n",
COOKIE_SEED_LEN
);
}

2
src/ts3init_cookie_seed.h

@ -9,7 +9,7 @@ enum { @@ -9,7 +9,7 @@ enum {
static inline bool hex2int_seed(const char *src, __u8* dst)
{
int i, j;
for (i = 0; i < 60; ++i)
for (i = 0; i < COOKIE_SEED_LEN; ++i)
{
int v = 0;
for ( j = 0; j < 2; ++j)

Loading…
Cancel
Save