• David Zeuthen's avatar
    Avoid using monotonic time in the DBUS_COOKIE_SHA1 authentication method · 8734e4a1
    David Zeuthen authored
    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: default avatarDavid Zeuthen <davidz@redhat.com>
    Reviewed-by: default avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
    Bug: https://bugs.freedesktop.org/show_bug.cgi?id=48580
    8734e4a1
Name
Last commit
Last update
..
.gitignore Loading commit data...
Makefile.am Loading commit data...
activation-exit-codes.h Loading commit data...
activation-helper-bin.c Loading commit data...
activation-helper.c Loading commit data...
activation-helper.h Loading commit data...
activation.c Loading commit data...
activation.h Loading commit data...
bus.c Loading commit data...
bus.h Loading commit data...
config-loader-expat.c Loading commit data...
config-loader-libxml.c Loading commit data...
config-parser-common.c Loading commit data...
config-parser-common.h Loading commit data...
config-parser-trivial.c Loading commit data...
config-parser-trivial.h Loading commit data...
config-parser.c Loading commit data...
config-parser.h Loading commit data...
connection.c Loading commit data...
connection.h Loading commit data...
dbus.service.in Loading commit data...
dbus.socket.in Loading commit data...
desktop-file.c Loading commit data...
desktop-file.h Loading commit data...
dir-watch-default.c Loading commit data...
dir-watch-dnotify.c Loading commit data...
dir-watch-inotify.c Loading commit data...
dir-watch-kqueue.c Loading commit data...
dir-watch.h Loading commit data...
dispatch.c Loading commit data...
dispatch.h Loading commit data...
driver.c Loading commit data...
driver.h Loading commit data...
expirelist.c Loading commit data...
expirelist.h Loading commit data...
main.c Loading commit data...
messagebus-config.in Loading commit data...
messagebus.in Loading commit data...
org.freedesktop.dbus-session.plist.in Loading commit data...
policy.c Loading commit data...
policy.h Loading commit data...
rc.messagebus.in Loading commit data...
selinux.c Loading commit data...
selinux.h Loading commit data...
services.c Loading commit data...
services.h Loading commit data...
session.conf.in Loading commit data...
signals.c Loading commit data...
signals.h Loading commit data...
stats.c Loading commit data...
stats.h Loading commit data...
system.conf.in Loading commit data...
test-launch-helper.c Loading commit data...
test-main.c Loading commit data...
test-system.c Loading commit data...
test.c Loading commit data...
test.h Loading commit data...
utils.c Loading commit data...
utils.h Loading commit data...