]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/libsystemd/sd-bus/bus-socket.c
sd-bus: fix SASL reply to empty AUTH
authorDavid Rheinsberg <david.rheinsberg@gmail.com>
Thu, 14 Mar 2019 12:33:28 +0000 (13:33 +0100)
committerDavid Rheinsberg <david.rheinsberg@gmail.com>
Thu, 14 Mar 2019 12:33:28 +0000 (13:33 +0100)
commit2010873b4b49b223e0cc07d28205b09c693ef005
tree4a1f396f29f9db82a029455e434f34824becd4e7
parent3cacdab925c40a5d9b7cf3f67719201bbaa17f67
sd-bus: fix SASL reply to empty AUTH

The correct way to reply to "AUTH <protocol>" without any payload is to
send "DATA" rather than "OK". The "DATA" reply triggers the client to
respond with the requested payload.

In fact, adding the data as hex-encoded argument like
"AUTH <protocol> <hex-data>" is an optimization that skips the "DATA"
roundtrip. The standard way to perform an authentication is to send the
"DATA" line.

This commit fixes sd-bus to properly send the "DATA" line. Surprisingly
no existing implementation depends on this, as they all pass the data
directly as argument to "AUTH". This will not work if we want to pass
an empty argument, though.

Signed-off-by: David Rheinsberg <david.rheinsberg@gmail.com>
src/libsystemd/sd-bus/bus-socket.c