os: auth: consolidate GenerateAuthorization()
No need for having two implementations in os/ vs xwin. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
0da8fc466d
commit
73abb7150d
|
@ -57,23 +57,6 @@ static unsigned int g_uiAuthDataLen = 0;
|
||||||
static char *g_pAuthData = NULL;
|
static char *g_pAuthData = NULL;
|
||||||
static xcb_auth_info_t auth_info;
|
static xcb_auth_info_t auth_info;
|
||||||
|
|
||||||
/*
|
|
||||||
* Code to generate a MIT-MAGIC-COOKIE-1, copied from under XCSECURITY
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef XCSECURITY
|
|
||||||
XID
|
|
||||||
GenerateAuthorization(unsigned name_length,
|
|
||||||
const char *name,
|
|
||||||
unsigned data_length,
|
|
||||||
const char *data,
|
|
||||||
unsigned *data_length_return, char **data_return)
|
|
||||||
{
|
|
||||||
return MitGenerateCookie(data_length, data,
|
|
||||||
FakeClientID(0), data_length_return, data_return);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Generate authorization cookie for internal server clients
|
* Generate authorization cookie for internal server clients
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -59,9 +59,7 @@ struct protocol {
|
||||||
AuthRstCFunc Reset; /* delete all authorization data entries */
|
AuthRstCFunc Reset; /* delete all authorization data entries */
|
||||||
AuthFromIDFunc FromID; /* convert ID to cookie */
|
AuthFromIDFunc FromID; /* convert ID to cookie */
|
||||||
AuthRemCFunc Remove; /* remove a specific cookie */
|
AuthRemCFunc Remove; /* remove a specific cookie */
|
||||||
#ifdef XCSECURITY
|
|
||||||
AuthGenCFunc Generate;
|
AuthGenCFunc Generate;
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct protocol protocols[] = {
|
static struct protocol protocols[] = {
|
||||||
|
@ -72,9 +70,7 @@ static struct protocol protocols[] = {
|
||||||
.Reset = MitResetCookie,
|
.Reset = MitResetCookie,
|
||||||
.FromID = MitFromID,
|
.FromID = MitFromID,
|
||||||
.Remove = MitRemoveCookie,
|
.Remove = MitRemoveCookie,
|
||||||
#ifdef XCSECURITY
|
|
||||||
.Generate = MitGenerateCookie
|
.Generate = MitGenerateCookie
|
||||||
#endif
|
|
||||||
},
|
},
|
||||||
#ifdef HASXDMAUTH
|
#ifdef HASXDMAUTH
|
||||||
{
|
{
|
||||||
|
@ -281,8 +277,6 @@ AddAuthorization(unsigned name_length, const char *name,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XCSECURITY
|
|
||||||
|
|
||||||
XID
|
XID
|
||||||
GenerateAuthorization(unsigned name_length,
|
GenerateAuthorization(unsigned name_length,
|
||||||
const char *name,
|
const char *name,
|
||||||
|
@ -304,8 +298,6 @@ GenerateAuthorization(unsigned name_length,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* XCSECURITY */
|
|
||||||
|
|
||||||
void
|
void
|
||||||
GenerateRandomData(int len, char *buf)
|
GenerateRandomData(int len, char *buf)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue