dbus/test
David Zeuthen 8734e4a16f Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication method
When libdbus-1 moved to using monotonic time support for the
DBUS_COOKIE_SHA1 authentication was broken, in particular
interoperability with non-libdbus-1 implementations such as GDBus.

The problem is that if monotonic clocks are available in the OS,
_dbus_get_current_time() will not return the number of seconds since
the Epoch so using it for DBUS_COOKIE_SHA1 will violate the D-Bus
specification. If both peers are using libdbus-1 it's not a problem
since both ends will use the wrong time and thus agree. However, if
the other end is another implementation and following the spec it will
not work.

First, we change _dbus_get_current_time() back so it always returns
time since the Epoch and we then rename it _dbus_get_real_time() to
make this clear. We then introduce _dbus_get_monotonic_time() and
carefully make all current users of _dbus_get_current_time() use it,
if applicable. During this audit, one of the callers,
_dbus_generate_uuid(), was currently using monotonic time but it was
decided to make it use real time instead.

Signed-off-by: David Zeuthen <davidz@redhat.com>
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48580
2012-04-12 10:53:50 -04:00
..
data test: enforce own_prefix policy rules 2012-03-22 11:51:23 +00:00
internals Port to glib 2.31.x g_thread API 2012-01-23 11:11:24 +00:00
name-test Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication method 2012-04-12 10:53:50 -04:00
.gitignore Add a test for marshalling and endian-swapping 2011-06-10 18:32:43 +01:00
break-loader.c Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication method 2012-04-12 10:53:50 -04:00
corrupt.c corrupt test: compile successfully against older GLib (Debian stable) 2011-11-02 15:20:51 +00:00
dbus-daemon-eavesdrop.c Revert addition of files which were only meant to exist on master, too 2012-01-23 10:27:32 +00:00
dbus-daemon.c Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
dbus-test-runner Add support for installing most of the modular tests 2011-06-10 18:32:35 +01:00
loopback.c Fix copyright dates 2011-06-10 18:33:22 +01:00
Makefile.am Merge branch 'dbus-1.4' 2012-03-12 11:55:27 +00:00
marshal.c Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
relay.c relay test: don't leak the server's address 2011-08-05 14:46:09 +01:00
shell-test.c Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
spawn-test.c Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
syntax.c Add a regression test for validating various string types with the public API 2012-02-24 12:44:14 +00:00
test-exit.c Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
test-names.c Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
test-segfault.c Make more signal and locale interface use conditional. 2010-03-22 17:28:55 +01:00
test-service.c Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
test-shell-service.c Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
test-sleep-forever.c fix warning, use Sleep, not _sleep on windows (cherry picked from commit ea36c743ad60a2dd5c6286571d1a475903519809) 2009-11-30 12:00:14 +01:00
test-utils.c Revert all changes since a36d4918a6 2012-01-04 17:44:23 +00:00
test-utils.h Consistently include <config.h> in all C source files and never in header files. 2010-03-19 20:11:48 +01:00
unused-code-gc.py 2005-01-16 Havoc Pennington <hp@redhat.com> 2005-01-17 03:53:40 +00:00