[PATCH xserver v2 3/7] os: make MitGenerateCookie() independent of XCSECURITY

Emil Velikov emil.l.velikov at gmail.com
Tue Aug 22 10:48:27 UTC 2017


Analogous to previous commit.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
Reviewed-by: Jon Turney <jon.turney at dronecode.org.uk>
---
 hw/xwin/winauth.c | 26 --------------------------
 os/mitauth.c      |  4 ----
 2 files changed, 30 deletions(-)

diff --git a/hw/xwin/winauth.c b/hw/xwin/winauth.c
index b7d1e2c7d..14278390f 100644
--- a/hw/xwin/winauth.c
+++ b/hw/xwin/winauth.c
@@ -68,32 +68,6 @@ static xcb_auth_info_t auth_info;
  */
 
 #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
     XID
diff --git a/os/mitauth.c b/os/mitauth.c
index e75d700e1..a268f62f9 100644
--- a/os/mitauth.c
+++ b/os/mitauth.c
@@ -133,8 +133,6 @@ MitRemoveCookie(unsigned short data_length, const char *data)
     return 0;
 }
 
-#ifdef XCSECURITY
-
 static char cookie[16];         /* 128 bits */
 
 XID
@@ -161,5 +159,3 @@ MitGenerateCookie(unsigned data_length,
     }
     return id;
 }
-
-#endif                          /* XCSECURITY */
-- 
2.14.0



More information about the xorg-devel mailing list