summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2015-11-20 12:50:22 +1300
committerRobert Ancell <robert.ancell@canonical.com>2015-11-20 12:50:22 +1300
commit3d160784fd90f82be10ba2cb7d5e15521fff96c4 (patch)
treee7a9e3e5fab4b87abbdb062c03dd957c7c2a7fac
parent2178138278219b3b97930bd28295408c570135e6 (diff)
downloadlightdm-3d160784fd90f82be10ba2cb7d5e15521fff96c4.tar.gz
Test authentication data coming back from the XDMCP server
-rw-r--r--tests/scripts/xdmcp-server-autologin.conf2
-rw-r--r--tests/scripts/xdmcp-server-double-login.conf4
-rw-r--r--tests/scripts/xdmcp-server-guest.conf2
-rw-r--r--tests/scripts/xdmcp-server-invalid-authentication.conf2
-rw-r--r--tests/scripts/xdmcp-server-login.conf2
-rw-r--r--tests/scripts/xdmcp-server-open-file-descriptors.conf2
-rw-r--r--tests/scripts/xdmcp-server-request-invalid-authentication.conf2
-rw-r--r--tests/scripts/xdmcp-server-request-invalid-authorization.conf2
-rw-r--r--tests/scripts/xdmcp-server-request-without-addresses.conf2
-rw-r--r--tests/scripts/xdmcp-server-request-without-authorization.conf2
-rw-r--r--tests/scripts/xdmcp-server-xdm-authentication-invalid-authorization.conf2
-rw-r--r--tests/scripts/xdmcp-server-xdm-authentication-long-data.conf2
-rw-r--r--tests/scripts/xdmcp-server-xdm-authentication-missing-data.conf2
-rw-r--r--tests/scripts/xdmcp-server-xdm-authentication-no-key.conf2
-rw-r--r--tests/scripts/xdmcp-server-xdm-authentication-required.conf2
-rw-r--r--tests/scripts/xdmcp-server-xdm-authentication-short-data.conf2
-rw-r--r--tests/scripts/xdmcp-server-xdm-authentication.conf2
-rw-r--r--tests/src/X.c33
-rw-r--r--tests/src/xdmcp-client.c8
-rw-r--r--tests/src/xdmcp-client.h4
20 files changed, 57 insertions, 24 deletions
diff --git a/tests/scripts/xdmcp-server-autologin.conf b/tests/scripts/xdmcp-server-autologin.conf
index 2bfa5623..c080ec89 100644
--- a/tests/scripts/xdmcp-server-autologin.conf
+++ b/tests/scripts/xdmcp-server-autologin.conf
@@ -26,7 +26,7 @@ autologin-user=have-password1
# Connect - daemon says OK
#?*XSERVER-98 SEND-REQUEST ADDRESSES="127.0.0.1" AUTHORIZATION-NAMES="MIT-MAGIC-COOKIE-1"
-#?XSERVER-98 GOT-ACCEPT SESSION-ID=[0-9]* AUTHENTICATION-NAME="" AUTHORIZATION-NAME="MIT-MAGIC-COOKIE-1"
+#?XSERVER-98 GOT-ACCEPT SESSION-ID=[0-9]+ AUTHENTICATION-NAME="" AUTHENTICATION-DATA= AUTHORIZATION-NAME="MIT-MAGIC-COOKIE-1" AUTHORIZATION-DATA=[0-9A-F]{32}
#?*XSERVER-98 SEND-MANAGE
# LightDM connects to X server
diff --git a/tests/scripts/xdmcp-server-double-login.conf b/tests/scripts/xdmcp-server-double-login.conf
index 6acc2052..e05a76cc 100644
--- a/tests/scripts/xdmcp-server-double-login.conf
+++ b/tests/scripts/xdmcp-server-double-login.conf
@@ -25,7 +25,7 @@ user-session=default
# Connect - daemon says OK
#?*XSERVER-98 SEND-REQUEST ADDRESSES="127.0.0.1" AUTHORIZATION-NAMES="MIT-MAGIC-COOKIE-1"
-#?XSERVER-98 GOT-ACCEPT SESSION-ID=[0-9]* AUTHENTICATION-NAME="" AUTHORIZATION-NAME="MIT-MAGIC-COOKIE-1"
+#?XSERVER-98 GOT-ACCEPT SESSION-ID=[0-9]+ AUTHENTICATION-NAME="" AUTHENTICATION-DATA= AUTHORIZATION-NAME="MIT-MAGIC-COOKIE-1" AUTHORIZATION-DATA=[0-9A-F]{32}
#?*XSERVER-98 SEND-MANAGE
# LightDM connects to X server
@@ -63,7 +63,7 @@ user-session=default
# Connect - daemon says OK
#?*XSERVER-99 SEND-REQUEST ADDRESSES="127.0.0.1" AUTHORIZATION-NAMES="MIT-MAGIC-COOKIE-1" MFID="TEST XSERVER"
-#?XSERVER-99 GOT-ACCEPT SESSION-ID=[0-9]* AUTHENTICATION-NAME="" AUTHORIZATION-NAME="MIT-MAGIC-COOKIE-1"
+#?XSERVER-99 GOT-ACCEPT SESSION-ID=[0-9]+ AUTHENTICATION-NAME="" AUTHENTICATION-DATA= AUTHORIZATION-NAME="MIT-MAGIC-COOKIE-1" AUTHORIZATION-DATA=[0-9A-F]{32}
#?*XSERVER-99 SEND-MANAGE
# LightDM connects to X server
diff --git a/tests/scripts/xdmcp-server-guest.conf b/tests/scripts/xdmcp-server-guest.conf
index 3dfea24e..f1aa8ae6 100644
--- a/tests/scripts/xdmcp-server-guest.conf
+++ b/tests/scripts/xdmcp-server-guest.conf
@@ -25,7 +25,7 @@ user-session=default
# Connect - daemon says OK
#?*XSERVER-98 SEND-REQUEST ADDRESSES="127.0.0.1" AUTHORIZATION-NAMES="MIT-MAGIC-COOKIE-1"
-#?XSERVER-98 GOT-ACCEPT SESSION-ID=[0-9]* AUTHENTICATION-NAME="" AUTHORIZATION-NAME="MIT-MAGIC-COOKIE-1"
+#?XSERVER-98 GOT-ACCEPT SESSION-ID=[0-9]+ AUTHENTICATION-NAME="" AUTHENTICATION-DATA= AUTHORIZATION-NAME="MIT-MAGIC-COOKIE-1" AUTHORIZATION-DATA=[0-9A-F]{32}
#?*XSERVER-98 SEND-MANAGE
# LightDM connects to X server
diff --git a/tests/scripts/xdmcp-server-invalid-authentication.conf b/tests/scripts/xdmcp-server-invalid-authentication.conf
index e852f64c..c35bb730 100644
--- a/tests/scripts/xdmcp-server-invalid-authentication.conf
+++ b/tests/scripts/xdmcp-server-invalid-authentication.conf
@@ -26,7 +26,7 @@ autologin-user=have-password1
# Try anyway - daemon declines
#?*XSERVER-98 SEND-REQUEST ADDRESSES="127.0.0.1" AUTHENTICATION-NAME="NO-SUCH-AUTHENTICATION" AUTHORIZATION-NAMES="MIT-MAGIC-COOKIE-1"
-#?XSERVER-98 GOT-DECLINE STATUS="No matching authentication, server only supports unauthenticated connections" AUTHENTICATION-NAME=""
+#?XSERVER-98 GOT-DECLINE STATUS="No matching authentication, server only supports unauthenticated connections" AUTHENTICATION-NAME="" AUTHENTICATION-DATA=
# Clean up
#?*STOP-DAEMON
diff --git a/tests/scripts/xdmcp-server-login.conf b/tests/scripts/xdmcp-server-login.conf
index 3ca44b52..ddb52ca6 100644
--- a/tests/scripts/xdmcp-server-login.conf
+++ b/tests/scripts/xdmcp-server-login.conf
@@ -25,7 +25,7 @@ user-session=default
# Connect - daemon says OK
#?*XSERVER-98 SEND-REQUEST ADDRESSES="127.0.0.1" AUTHORIZATION-NAMES="MIT-MAGIC-COOKIE-1"
-#?XSERVER-98 GOT-ACCEPT SESSION-ID=[0-9]* AUTHENTICATION-NAME="" AUTHORIZATION-NAME="MIT-MAGIC-COOKIE-1"
+#?XSERVER-98 GOT-ACCEPT SESSION-ID=[0-9]+ AUTHENTICATION-NAME="" AUTHENTICATION-DATA= AUTHORIZATION-NAME="MIT-MAGIC-COOKIE-1" AUTHORIZATION-DATA=[0-9A-F]{32}
#?*XSERVER-98 SEND-MANAGE
# LightDM connects to X server
diff --git a/tests/scripts/xdmcp-server-open-file-descriptors.conf b/tests/scripts/xdmcp-server-open-file-descriptors.conf
index 8cb7a902..a6511f8d 100644
--- a/tests/scripts/xdmcp-server-open-file-descriptors.conf
+++ b/tests/scripts/xdmcp-server-open-file-descriptors.conf
@@ -25,7 +25,7 @@ user-session=default
# Connect - daemon says OK
#?*XSERVER-98 SEND-REQUEST ADDRESSES="127.0.0.1" AUTHORIZATION-NAMES="MIT-MAGIC-COOKIE-1"
-#?XSERVER-98 GOT-ACCEPT SESSION-ID=[0-9]* AUTHENTICATION-NAME="" AUTHORIZATION-NAME="MIT-MAGIC-COOKIE-1"
+#?XSERVER-98 GOT-ACCEPT SESSION-ID=[0-9]+ AUTHENTICATION-NAME="" AUTHENTICATION-DATA= AUTHORIZATION-NAME="MIT-MAGIC-COOKIE-1" AUTHORIZATION-DATA=[0-9A-F]{32}
#?*XSERVER-98 SEND-MANAGE
# LightDM connects to X server
diff --git a/tests/scripts/xdmcp-server-request-invalid-authentication.conf b/tests/scripts/xdmcp-server-request-invalid-authentication.conf
index 3b3a2aa2..fbb63d2a 100644
--- a/tests/scripts/xdmcp-server-request-invalid-authentication.conf
+++ b/tests/scripts/xdmcp-server-request-invalid-authentication.conf
@@ -22,7 +22,7 @@ enabled=true
# Connect with an invalid authentication - daemon declines
#?*XSERVER-98 SEND-REQUEST ADDRESSES="127.0.0.1" AUTHENTICATION-NAME="NO-SUCH-AUTHENTICATION" AUTHORIZATION-NAMES="MIT-MAGIC-COOKIE-1"
-#?XSERVER-98 GOT-DECLINE STATUS="No matching authentication, server only supports unauthenticated connections" AUTHENTICATION-NAME=""
+#?XSERVER-98 GOT-DECLINE STATUS="No matching authentication, server only supports unauthenticated connections" AUTHENTICATION-NAME="" AUTHENTICATION-DATA=
# Clean up
#?*STOP-DAEMON
diff --git a/tests/scripts/xdmcp-server-request-invalid-authorization.conf b/tests/scripts/xdmcp-server-request-invalid-authorization.conf
index a577a01f..47f41750 100644
--- a/tests/scripts/xdmcp-server-request-invalid-authorization.conf
+++ b/tests/scripts/xdmcp-server-request-invalid-authorization.conf
@@ -22,7 +22,7 @@ enabled=true
# Connect with an invalid authorization - daemon declines
#?*XSERVER-98 SEND-REQUEST ADDRESSES="127.0.0.1" AUTHORIZATION-NAMES="NO-SUCH-AUTHORIZATION"
-#?XSERVER-98 GOT-DECLINE STATUS="No matching authorization, server requires MIT-MAGIC-COOKIE-1" AUTHENTICATION-NAME=""
+#?XSERVER-98 GOT-DECLINE STATUS="No matching authorization, server requires MIT-MAGIC-COOKIE-1" AUTHENTICATION-NAME="" AUTHENTICATION-DATA=
# Clean up
#?*STOP-DAEMON
diff --git a/tests/scripts/xdmcp-server-request-without-addresses.conf b/tests/scripts/xdmcp-server-request-without-addresses.conf
index 31b358e1..f289d548 100644
--- a/tests/scripts/xdmcp-server-request-without-addresses.conf
+++ b/tests/scripts/xdmcp-server-request-without-addresses.conf
@@ -22,7 +22,7 @@ enabled=true
# Connect without providing an address - daemon declines
#?*XSERVER-98 SEND-REQUEST ADDRESSES="" AUTHORIZATION-NAMES="MIT-MAGIC-COOKIE-1"
-#?XSERVER-98 GOT-DECLINE STATUS="No valid address found" AUTHENTICATION-NAME=""
+#?XSERVER-98 GOT-DECLINE STATUS="No valid address found" AUTHENTICATION-NAME="" AUTHENTICATION-DATA=
# Clean up
#?*STOP-DAEMON
diff --git a/tests/scripts/xdmcp-server-request-without-authorization.conf b/tests/scripts/xdmcp-server-request-without-authorization.conf
index 2cb1a13f..34499ac7 100644
--- a/tests/scripts/xdmcp-server-request-without-authorization.conf
+++ b/tests/scripts/xdmcp-server-request-without-authorization.conf
@@ -22,7 +22,7 @@ enabled=true
# Connect without authorization - daemon says no
#?*XSERVER-98 SEND-REQUEST ADDRESSES="127.0.0.1" AUTHORIZATION-NAMES=""
-#?XSERVER-98 GOT-DECLINE STATUS="No matching authorization, server requires MIT-MAGIC-COOKIE-1" AUTHENTICATION-NAME=""
+#?XSERVER-98 GOT-DECLINE STATUS="No matching authorization, server requires MIT-MAGIC-COOKIE-1" AUTHENTICATION-NAME="" AUTHENTICATION-DATA=
# Clean up
#?*STOP-DAEMON
diff --git a/tests/scripts/xdmcp-server-xdm-authentication-invalid-authorization.conf b/tests/scripts/xdmcp-server-xdm-authentication-invalid-authorization.conf
index efac51bc..3346efbe 100644
--- a/tests/scripts/xdmcp-server-xdm-authentication-invalid-authorization.conf
+++ b/tests/scripts/xdmcp-server-xdm-authentication-invalid-authorization.conf
@@ -27,7 +27,7 @@ autologin-user=have-password1
# Connect with wrong authorization - daemon declines
#?*XSERVER-98 SEND-REQUEST ADDRESSES="127.0.0.1" AUTHENTICATION-NAME="XDM-AUTHENTICATION-1" AUTHENTICATION-DATA="0123456789ABCDEF" AUTHORIZATION-NAMES="MIT-MAGIC-COOKIE-1"
-#?XSERVER-98 GOT-DECLINE STATUS="No matching authorization, server requires XDM-AUTHORIZATION-1" AUTHENTICATION-NAME="XDM-AUTHENTICATION-1"
+#?XSERVER-98 GOT-DECLINE STATUS="No matching authorization, server requires XDM-AUTHORIZATION-1" AUTHENTICATION-NAME="XDM-AUTHENTICATION-1" AUTHENTICATION-DATA=E9D2BDD16E64C251
# Clean up
#?*STOP-DAEMON
diff --git a/tests/scripts/xdmcp-server-xdm-authentication-long-data.conf b/tests/scripts/xdmcp-server-xdm-authentication-long-data.conf
index 71dcd211..d6310d65 100644
--- a/tests/scripts/xdmcp-server-xdm-authentication-long-data.conf
+++ b/tests/scripts/xdmcp-server-xdm-authentication-long-data.conf
@@ -27,7 +27,7 @@ autologin-user=have-password1
# Connect without any authentication data - daemon declines
#?*XSERVER-98 SEND-REQUEST ADDRESSES="127.0.0.1" AUTHENTICATION-NAME="XDM-AUTHENTICATION-1" AUTHENTICATION-DATA="DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF" AUTHORIZATION-NAMES="XDM-AUTHORIZATION-1"
-#?XSERVER-98 GOT-DECLINE STATUS="Invalid XDM-AUTHENTICATION-1 data provided" AUTHENTICATION-NAME=""
+#?XSERVER-98 GOT-DECLINE STATUS="Invalid XDM-AUTHENTICATION-1 data provided" AUTHENTICATION-NAME="" AUTHENTICATION-DATA=
# Clean up
#?*STOP-DAEMON
diff --git a/tests/scripts/xdmcp-server-xdm-authentication-missing-data.conf b/tests/scripts/xdmcp-server-xdm-authentication-missing-data.conf
index 1ed1724f..0cd23be5 100644
--- a/tests/scripts/xdmcp-server-xdm-authentication-missing-data.conf
+++ b/tests/scripts/xdmcp-server-xdm-authentication-missing-data.conf
@@ -27,7 +27,7 @@ autologin-user=have-password1
# Connect without any authentication data - daemon declines
#?*XSERVER-98 SEND-REQUEST ADDRESSES="127.0.0.1" AUTHENTICATION-NAME="XDM-AUTHENTICATION-1" AUTHENTICATION-DATA="" AUTHORIZATION-NAMES="XDM-AUTHORIZATION-1"
-#?XSERVER-98 GOT-DECLINE STATUS="Invalid XDM-AUTHENTICATION-1 data provided" AUTHENTICATION-NAME=""
+#?XSERVER-98 GOT-DECLINE STATUS="Invalid XDM-AUTHENTICATION-1 data provided" AUTHENTICATION-NAME="" AUTHENTICATION-DATA=
# Clean up
#?*STOP-DAEMON
diff --git a/tests/scripts/xdmcp-server-xdm-authentication-no-key.conf b/tests/scripts/xdmcp-server-xdm-authentication-no-key.conf
index 567be1e7..d113dc1b 100644
--- a/tests/scripts/xdmcp-server-xdm-authentication-no-key.conf
+++ b/tests/scripts/xdmcp-server-xdm-authentication-no-key.conf
@@ -26,7 +26,7 @@ autologin-user=have-password1
# Try anyway - daemon rejects
#?*XSERVER-98 SEND-REQUEST ADDRESSES="127.0.0.1" AUTHENTICATION-NAME="XDM-AUTHENTICATION-1" AUTHORIZATION-NAME="XDM-AUTHORIZATION-1"
-#?XSERVER-98 GOT-DECLINE STATUS="No matching authentication, server only supports unauthenticated connections" AUTHENTICATION-NAME=""
+#?XSERVER-98 GOT-DECLINE STATUS="No matching authentication, server only supports unauthenticated connections" AUTHENTICATION-NAME="" AUTHENTICATION-DATA=
# Clean up
#?*STOP-DAEMON
diff --git a/tests/scripts/xdmcp-server-xdm-authentication-required.conf b/tests/scripts/xdmcp-server-xdm-authentication-required.conf
index d87b668c..b6a8e052 100644
--- a/tests/scripts/xdmcp-server-xdm-authentication-required.conf
+++ b/tests/scripts/xdmcp-server-xdm-authentication-required.conf
@@ -27,7 +27,7 @@ autologin-user=have-password1
# Try anyway - daemon rejects
#?*XSERVER-98 SEND-REQUEST ADDRESSES="127.0.0.1" AUTHENTICATION-NAME="" AUTHORIZATION-NAMES="XDM-AUTHORIZATION-1"
-#?XSERVER-98 GOT-DECLINE STATUS="No matching authentication, server requires XDM-AUTHENTICATION-1" AUTHENTICATION-NAME=""
+#?XSERVER-98 GOT-DECLINE STATUS="No matching authentication, server requires XDM-AUTHENTICATION-1" AUTHENTICATION-NAME="" AUTHENTICATION-DATA=
# Clean up
#?*STOP-DAEMON
diff --git a/tests/scripts/xdmcp-server-xdm-authentication-short-data.conf b/tests/scripts/xdmcp-server-xdm-authentication-short-data.conf
index 3f3d442f..30dcc773 100644
--- a/tests/scripts/xdmcp-server-xdm-authentication-short-data.conf
+++ b/tests/scripts/xdmcp-server-xdm-authentication-short-data.conf
@@ -27,7 +27,7 @@ autologin-user=have-password1
# Connect without any authentication data - daemon declines
#?*XSERVER-98 SEND-REQUEST ADDRESSES="127.0.0.1" AUTHENTICATION-NAME="XDM-AUTHENTICATION-1" AUTHENTICATION-DATA="00" AUTHORIZATION-NAMES="XDM-AUTHORIZATION-1"
-#?XSERVER-98 GOT-DECLINE STATUS="Invalid XDM-AUTHENTICATION-1 data provided" AUTHENTICATION-NAME=""
+#?XSERVER-98 GOT-DECLINE STATUS="Invalid XDM-AUTHENTICATION-1 data provided" AUTHENTICATION-NAME="" AUTHENTICATION-DATA=
# Clean up
#?*STOP-DAEMON
diff --git a/tests/scripts/xdmcp-server-xdm-authentication.conf b/tests/scripts/xdmcp-server-xdm-authentication.conf
index aae66e44..2ce2d86c 100644
--- a/tests/scripts/xdmcp-server-xdm-authentication.conf
+++ b/tests/scripts/xdmcp-server-xdm-authentication.conf
@@ -27,7 +27,7 @@ autologin-user=have-password1
# Connect - daemon says OK
#?*XSERVER-98 SEND-REQUEST ADDRESSES="127.0.0.1" AUTHENTICATION-NAME="XDM-AUTHENTICATION-1" AUTHENTICATION-DATA="0123456789ABCDEF" AUTHORIZATION-NAMES="XDM-AUTHORIZATION-1"
-#?XSERVER-98 GOT-ACCEPT SESSION-ID=[0-9]* AUTHENTICATION-NAME="XDM-AUTHENTICATION-1" AUTHORIZATION-NAME="XDM-AUTHORIZATION-1"
+#?XSERVER-98 GOT-ACCEPT SESSION-ID=[0-9]+ AUTHENTICATION-NAME="XDM-AUTHENTICATION-1" AUTHENTICATION-DATA=E9D2BDD16E64C251 AUTHORIZATION-NAME="XDM-AUTHORIZATION-1" AUTHORIZATION-DATA=[0-9A-F]{16}
#?*XSERVER-98 SEND-MANAGE
# LightDM connects to X server
diff --git a/tests/src/X.c b/tests/src/X.c
index 210781f7..ca25c532 100644
--- a/tests/src/X.c
+++ b/tests/src/X.c
@@ -115,10 +115,35 @@ xdmcp_unwilling_cb (XDMCPClient *client, XDMCPUnwilling *message)
status_notify ("%s GOT-UNWILLING HOSTNAME=\"%s\" STATUS=\"%s\"", id, message->hostname, message->status);
}
+static gchar *
+data_to_string (guint8 *data, gsize data_length)
+{
+ static gchar hex_char[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
+ gchar *text;
+ gsize i;
+
+ text = malloc (data_length * 2 + 1);
+ for (i = 0; i < data_length; i++)
+ {
+ text[i*2] = hex_char [data[i] >> 4];
+ text[i*2 + 1] = hex_char [data[i] & 0xF];
+ }
+ text[i*2] = '\0';
+
+ return text;
+}
+
static void
xdmcp_accept_cb (XDMCPClient *client, XDMCPAccept *message)
{
- status_notify ("%s GOT-ACCEPT SESSION-ID=%d AUTHENTICATION-NAME=\"%s\" AUTHORIZATION-NAME=\"%s\"", id, message->session_id, message->authentication_name, message->authorization_name);
+ gchar *authentication_data_text, *authorization_data_text;
+
+ authentication_data_text = data_to_string (message->authentication_data, message->authentication_data_length);
+ authorization_data_text = data_to_string (message->authorization_data, message->authorization_data_length);
+ status_notify ("%s GOT-ACCEPT SESSION-ID=%d AUTHENTICATION-NAME=\"%s\" AUTHENTICATION-DATA=%s AUTHORIZATION-NAME=\"%s\" AUTHORIZATION-DATA=%s",
+ id, message->session_id, message->authentication_name, authentication_data_text, message->authorization_name, authorization_data_text);
+ g_free (authentication_data_text);
+ g_free (authorization_data_text);
xdmcp_session_id = message->session_id;
@@ -131,7 +156,11 @@ xdmcp_accept_cb (XDMCPClient *client, XDMCPAccept *message)
static void
xdmcp_decline_cb (XDMCPClient *client, XDMCPDecline *message)
{
- status_notify ("%s GOT-DECLINE STATUS=\"%s\" AUTHENTICATION-NAME=\"%s\"", id, message->status, message->authentication_name);
+ gchar *authentication_data_text;
+
+ authentication_data_text = data_to_string (message->authentication_data, message->authentication_data_length);
+ status_notify ("%s GOT-DECLINE STATUS=\"%s\" AUTHENTICATION-NAME=\"%s\" AUTHENTICATION-DATA=%s", id, message->status, message->authentication_name, authentication_data_text);
+ g_free (authentication_data_text);
}
static void
diff --git a/tests/src/xdmcp-client.c b/tests/src/xdmcp-client.c
index 75e01c34..e81bfad3 100644
--- a/tests/src/xdmcp-client.c
+++ b/tests/src/xdmcp-client.c
@@ -123,8 +123,8 @@ decode_accept (XDMCPClient *client, const guint8 *buffer, gssize buffer_length)
message->session_id = read_card32 (buffer, buffer_length, X_BYTE_ORDER_MSB, &offset);
length = read_card16 (buffer, buffer_length, X_BYTE_ORDER_MSB, &offset);
message->authentication_name = read_string (buffer, buffer_length, length, &offset);
- length = read_card16 (buffer, buffer_length, X_BYTE_ORDER_MSB, &offset);
- read_string8 (buffer, buffer_length, length, &offset);
+ message->authentication_data_length = read_card16 (buffer, buffer_length, X_BYTE_ORDER_MSB, &offset);
+ message->authentication_data = read_string8 (buffer, buffer_length, message->authentication_data_length, &offset);
length = read_card16 (buffer, buffer_length, X_BYTE_ORDER_MSB, &offset);
message->authorization_name = read_string (buffer, buffer_length, length, &offset);
message->authorization_data_length = read_card16 (buffer, buffer_length, X_BYTE_ORDER_MSB, &offset);
@@ -151,8 +151,8 @@ decode_decline (XDMCPClient *client, const guint8 *buffer, gssize buffer_length)
message->status = read_string (buffer, buffer_length, length, &offset);
length = read_card16 (buffer, buffer_length, X_BYTE_ORDER_MSB, &offset);
message->authentication_name = read_string (buffer, buffer_length, length, &offset);
- length = read_card16 (buffer, buffer_length, X_BYTE_ORDER_MSB, &offset);
- read_string8 (buffer, buffer_length, length, &offset);
+ message->authentication_data_length = read_card16 (buffer, buffer_length, X_BYTE_ORDER_MSB, &offset);
+ message->authentication_data = read_string8 (buffer, buffer_length, message->authentication_data_length, &offset);
g_signal_emit (client, xdmcp_client_signals[XDMCP_CLIENT_DECLINE], 0, message);
diff --git a/tests/src/xdmcp-client.h b/tests/src/xdmcp-client.h
index 66814f32..7d13fca5 100644
--- a/tests/src/xdmcp-client.h
+++ b/tests/src/xdmcp-client.h
@@ -30,6 +30,8 @@ typedef struct
{
guint32 session_id;
gchar *authentication_name;
+ guint16 authentication_data_length;
+ guint8 *authentication_data;
gchar *authorization_name;
guint16 authorization_data_length;
guint8 *authorization_data;
@@ -39,6 +41,8 @@ typedef struct
{
gchar *status;
gchar *authentication_name;
+ guint16 authentication_data_length;
+ guint8 *authentication_data;
} XDMCPDecline;
typedef struct