Commit Graph

14 Commits

Author SHA1 Message Date
Dan Williams 6aeeb6fa21 dbus: clean up new D-Bus interface getters and setters
A number of fixes/improvements here:

1) Remove casting of getter/setter function types which allows
us to change the prototypes in the future and not have hard-to-find
runtime segfaults

2) Instead of having the getters create a fake reply message which
then gets its arguments copied into the real reply message, and is
then disposed, just pass message iters around and have them add
their arguments to the message itself

3) For setters, just pass in the message iter positioned at the
start of the argument list, instead of each setter having to skip
over the standard interface+property name

4) Convert error handling to use DBusError and return the error
back down through the call stacks to the function that will
actually send the error back to the caller, instead of having a
fake DBusMessage of type DBUS_MESSAGE_TYPE_ERROR that then
needs to have the error extracted from it.

But most of all, this fixes various segfaults (like rh #725517
and #678625) which were caused by some functions deep down in the
getter callpaths wanting a source DBusMessage* when the getters were
used for two things: signals (which don't have a source DBusMessage)
and methods (which will have a source DBusMessage that's being
replied to).  This duality made the code fragile when handling
errors like invalid IEs over the air.

Signed-off-by: Dan Williams <dcbw@redhat.com>
2011-07-29 21:25:39 +03:00
Tomasz Bursztyka 1b232e479d dbus: Fix new dbus API for WPS
Start() method's optional Bssid argument needs a byte array, not an
array of arrays.
2010-11-26 19:47:24 +02:00
Jouni Malinen 3c5126a41f P2P: Set Device Password ID in WPS M1/M2 per new rules
If the P2P client (WPS Enrollee) uses a PIN from the GO (Registrar),
Device Password ID in M1 & M2 is set to Registrar-specified.
2010-09-09 07:17:19 -07:00
Jouni Malinen 9fa243b295 P2P: Let WPS code know if it is used in a P2P group 2010-09-09 07:17:16 -07:00
Witold Sowa abd7a4e353 dbus: Aggregate PropertiesChanged signals
Instead of sending PropertiesChanged signals for each changed
property separately, mark properties as changed and send aggregated
PropertiesChanged signals for each interface in each object.
Aggregated PropertiesChanged signal is sent
- for all object after responding on DBus call
- for specified object after manual call to
  wpa_dbus_flush_object_changed_properties() function
- for each object separately after short timeout (currently 5 ms)
  which starts when first property in object is marked changed
2010-01-04 17:15:57 +02:00
Jouni Malinen 6c68b0db5d dbus: Fix WPS ProcessCredentials property setter to use Boolean
The incorrect type used with property setter call did not allow
the property to be modified.
2010-01-01 23:06:10 +02:00
Jouni Malinen d8d8c6d02a dbus: Split wpas_dbus_handler_wps_start() into helper functions 2010-01-01 22:33:47 +02:00
Jouni Malinen db9a76c032 dbus: Fix a typo in function name (invald -> invalid) 2010-01-01 21:52:29 +02:00
Jouni Malinen c2b8c674cb dbus: Remove perror() calls
The perror() calls do not make much sense with libdbus functions and
wpa_printf() would really be used for all error printing anyway. In
addition, many of the error messages on out-of-memory cases are not
really of much use, so they were removed. This is also cleaning up
some of the error path handling to avoid duplicated code.
2010-01-01 20:50:12 +02:00
Jouni Malinen c49cf2d68f dbus: Clean up dbus_path/dbus_new_path use
These cannot be NULL, so there is no point in checking for that. In
addition, the accessor function for this is just making the code harder
to understand.
2010-01-01 19:12:31 +02:00
Witold Sowa fcea0b7d1d dbus: Add generic properties getter and setter 2010-01-01 11:56:56 +02:00
Jouni Malinen 8ddef94bd4 dbus: Share common initialization code for both old and new interface
This was mostly identical code that had been copied for the new D-Bus
API implementation and as such, should really have been shared from
the beginning. In addition, the copied code ended up generating
interesting stack traces since the actual D-Bus connection was being
shared even though the pointer to it was stored in two distinct
data structures. The old D-Bus code ended up dispatching some
D-Bus callbacks which ended up running the new D-Bus code.

Since the private context pointers were mostly identical, everything
seemed to more or less work, but this design was just making things
more complex and potentially very easy to break.
2009-12-31 00:15:56 +02:00
Jouni Malinen a206a29a54 dbus: Remove the confusing "ctrl_iface_" prefix from file names
The D-Bus interface does not really have anything to do with the
wpa_supplicant ctrl_iface interface and as such, this prefix in
dbus files is both confusing and unnecessarily. Make the file names
shorter by removing this prefix.
2009-12-20 21:11:35 +02:00
Jouni Malinen 36da1358bc dbus: Move some of conditional WPS code into separate files 2009-12-20 21:04:40 +02:00