From 73abb7150d352cb481267e26461eec494513d065 Mon Sep 17 00:00:00 2001 From: "Enrico Weigelt, metux IT consult" Date: Mon, 10 Mar 2025 10:16:43 +0100 Subject: [PATCH] os: auth: consolidate GenerateAuthorization() No need for having two implementations in os/ vs xwin. Signed-off-by: Enrico Weigelt, metux IT consult --- hw/xwin/winauth.c | 17 ----------------- os/auth.c | 8 -------- 2 files changed, 25 deletions(-) diff --git a/hw/xwin/winauth.c b/hw/xwin/winauth.c index 09469e0a9..c16e63e87 100644 --- a/hw/xwin/winauth.c +++ b/hw/xwin/winauth.c @@ -57,23 +57,6 @@ static unsigned int g_uiAuthDataLen = 0; static char *g_pAuthData = NULL; 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 */ diff --git a/os/auth.c b/os/auth.c index b28e7308c..a22980efd 100644 --- a/os/auth.c +++ b/os/auth.c @@ -59,9 +59,7 @@ struct protocol { AuthRstCFunc Reset; /* delete all authorization data entries */ AuthFromIDFunc FromID; /* convert ID to cookie */ AuthRemCFunc Remove; /* remove a specific cookie */ -#ifdef XCSECURITY AuthGenCFunc Generate; -#endif }; static struct protocol protocols[] = { @@ -72,9 +70,7 @@ static struct protocol protocols[] = { .Reset = MitResetCookie, .FromID = MitFromID, .Remove = MitRemoveCookie, -#ifdef XCSECURITY .Generate = MitGenerateCookie -#endif }, #ifdef HASXDMAUTH { @@ -281,8 +277,6 @@ AddAuthorization(unsigned name_length, const char *name, return 0; } -#ifdef XCSECURITY - XID GenerateAuthorization(unsigned name_length, const char *name, @@ -304,8 +298,6 @@ GenerateAuthorization(unsigned name_length, return -1; } -#endif /* XCSECURITY */ - void GenerateRandomData(int len, char *buf) {