os: make MitGenerateCookie() independent of XCSECURITY

Analogous to previous commit.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
This commit is contained in:
Emil Velikov 2017-08-22 11:48:27 +01:00 committed by Adam Jackson
parent 292ee71516
commit 1ef6569225
2 changed files with 0 additions and 30 deletions

View File

@ -68,32 +68,6 @@ static xcb_auth_info_t auth_info;
*/ */
#ifndef XCSECURITY #ifndef XCSECURITY
static char cookie[16]; /* 128 bits */
XID
MitGenerateCookie(unsigned data_length,
const char *data,
XID id, unsigned *data_length_return, char **data_return)
{
int i = 0;
int status;
while (data_length--) {
cookie[i++] += *data++;
if (i >= sizeof(cookie))
i = 0;
}
GenerateRandomData(sizeof(cookie), cookie);
status = MitAddCookie(sizeof(cookie), cookie, id);
if (!status) {
id = -1;
}
else {
*data_return = cookie;
*data_length_return = sizeof(cookie);
}
return id;
}
static static
XID XID

View File

@ -133,8 +133,6 @@ MitRemoveCookie(unsigned short data_length, const char *data)
return 0; return 0;
} }
#ifdef XCSECURITY
static char cookie[16]; /* 128 bits */ static char cookie[16]; /* 128 bits */
XID XID
@ -161,5 +159,3 @@ MitGenerateCookie(unsigned data_length,
} }
return id; return id;
} }
#endif /* XCSECURITY */