Implementing a new auth mechanism

Zeeshan Ali zeenix at gstreamer.net
Fri Mar 9 07:26:22 PST 2007


Hello guys!
   After Havoc mentioned Cyrus SASL lib for plugable auth mechanisms,
I had a look at it's documentation and it seems to be quite a nice
library. Besides other very nice features, i find the following ones
very useful for D-Bus:

1. Authentication are plugins so it's not so hard to insert new ones
2. Some of the authentication mechanisms (e.g DIGEST-MD5) provides a
security layer so one can just use the tcp transport without worrying
about security.

So I started my attempt to write an auth mechanism based on this
library. As a start, i thought i should first implement a dummy
implementation, in which server just authenticates every client.
Looking into dbus-auth.c, i thought this would be as easy as filling
all_mechanisms[] with a new DBusAuthMechanismHandler having functions
whose definitions either don't contain anything or just a 'return
TRUE' if it's returns a boolean.

Unfortunately, it turned out to be not that simple and the client
hangs after sending server the string: "AUTH CYRUS_SASL \r\n" . As an
experiment, I replaced 'return TRUE' with 'return send_ok (auth);'  in
the  server_data_func implementation of mine and now i get a segfault
instead.

Can anyone please provide me with some useful pointers?

-- 
Regards,

Zeeshan Ali
Design Engineer, SW
Open Source Software Operations
Nokia Multimedia


More information about the dbus mailing list