|
@@ -124,17 +124,17 @@ static void
|
|
|
rotate_key(char* key, int& seed)
|
|
rotate_key(char* key, int& seed)
|
|
|
{
|
|
{
|
|
|
if (seed) {
|
|
if (seed) {
|
|
|
- *(uint32_t *) & key[0] = prand(&seed, 0xFFFFFFFF);
|
|
|
|
|
- *(uint32_t *) & key[4] = prand(&seed, 0xFFFFFFFF);
|
|
|
|
|
- *(uint32_t *) & key[8] = prand(&seed, 0xFFFFFFFF);
|
|
|
|
|
- *(uint32_t *) & key[12] = prand(&seed, 0xFFFFFFFF);
|
|
|
|
|
|
|
+ *(uint32_t *) (&key + 0) = prand(&seed, 0xFFFFFFFF);
|
|
|
|
|
+ *(uint32_t *) (&key + 4) = prand(&seed, 0xFFFFFFFF);
|
|
|
|
|
+ *(uint32_t *) (&key + 8) = prand(&seed, 0xFFFFFFFF);
|
|
|
|
|
+ *(uint32_t *) (&key + 12) = prand(&seed, 0xFFFFFFFF);
|
|
|
|
|
|
|
|
if (!seed)
|
|
if (!seed)
|
|
|
seed++;
|
|
seed++;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static int ghost_read(int snum, char *src, size_t *len)
|
|
|
|
|
|
|
+static int ghost_read(int snum, char *src)
|
|
|
{
|
|
{
|
|
|
char *line = decrypt_string(socklist[snum].ikey, src);
|
|
char *line = decrypt_string(socklist[snum].ikey, src);
|
|
|
|
|
|
|
@@ -142,7 +142,6 @@ static int ghost_read(int snum, char *src, size_t *len)
|
|
|
OPENSSL_cleanse(line, strlen(line) + 1);
|
|
OPENSSL_cleanse(line, strlen(line) + 1);
|
|
|
free(line);
|
|
free(line);
|
|
|
rotate_key(socklist[snum].ikey, socklist[snum].iseed);
|
|
rotate_key(socklist[snum].ikey, socklist[snum].iseed);
|
|
|
-// *len = strlen(src);
|
|
|
|
|
return OK;
|
|
return OK;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -251,12 +250,12 @@ void link_link(int idx, int type, int i, direction_t direction)
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-int link_read(int snum, char *buf, size_t *len)
|
|
|
|
|
|
|
+int link_read(int snum, char *buf)
|
|
|
{
|
|
{
|
|
|
int i = socklist[snum].enclink;
|
|
int i = socklist[snum].enclink;
|
|
|
|
|
|
|
|
if (i != -1 && enclink[i].read)
|
|
if (i != -1 && enclink[i].read)
|
|
|
- return (enclink[i].read) (snum, buf, len);
|
|
|
|
|
|
|
+ return (enclink[i].read) (snum, buf);
|
|
|
|
|
|
|
|
return -1;
|
|
return -1;
|
|
|
}
|
|
}
|