From patchwork Wed Jan 25 23:12:41 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Stewart X-Patchwork-Id: 138011 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from maxx.maxx.shmoo.com (maxx.shmoo.com [205.134.188.171]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "maxx.shmoo.com", Issuer "CA Cert Signing Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 69356B6F98 for ; Fri, 27 Jan 2012 05:51:31 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id 2570A9C1DC; Thu, 26 Jan 2012 13:51:28 -0500 (EST) X-Virus-Scanned: amavisd-new at maxx.shmoo.com Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PIJmqU+-GkfI; Thu, 26 Jan 2012 13:51:27 -0500 (EST) Received: from maxx.shmoo.com (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id B51529C13D; Thu, 26 Jan 2012 13:51:23 -0500 (EST) X-Original-To: mailman-post+hostap@maxx.shmoo.com Delivered-To: mailman-post+hostap@maxx.shmoo.com Received: from localhost (localhost [127.0.0.1]) by maxx.maxx.shmoo.com (Postfix) with ESMTP id D1D579C13C for ; Thu, 26 Jan 2012 13:51:22 -0500 (EST) X-Quarantine-ID: X-Virus-Scanned: amavisd-new at maxx.shmoo.com X-Amavis-Alert: BAD HEADER, Duplicate header field: "Cc" Received: from maxx.maxx.shmoo.com ([127.0.0.1]) by localhost (maxx.shmoo.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G8KjCw1W7L3N for ; Thu, 26 Jan 2012 13:51:19 -0500 (EST) Received: from mail-yx0-f202.google.com (mail-yx0-f202.google.com [209.85.213.202]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by maxx.maxx.shmoo.com (Postfix) with ESMTPS id F01049C13D for ; Thu, 26 Jan 2012 13:51:18 -0500 (EST) Received: by yenr8 with SMTP id r8so85439yen.5 for ; Thu, 26 Jan 2012 10:51:18 -0800 (PST) Received: by 10.236.125.34 with SMTP id y22mr5976598yhh.4.1327603878605; Thu, 26 Jan 2012 10:51:18 -0800 (PST) Received: by 10.236.125.34 with SMTP id y22mr5976576yhh.4.1327603878532; Thu, 26 Jan 2012 10:51:18 -0800 (PST) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id u47si2350055yhm.1.2012.01.26.10.51.18 (version=TLSv1/SSLv3 cipher=AES128-SHA); Thu, 26 Jan 2012 10:51:18 -0800 (PST) Received: from glenhelen.mtv.corp.google.com (glenhelen.mtv.corp.google.com [172.22.72.223]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 54BB010004D; Thu, 26 Jan 2012 10:51:18 -0800 (PST) Received: by glenhelen.mtv.corp.google.com (Postfix, from userid 110058) id DF08F2041A; Thu, 26 Jan 2012 10:51:17 -0800 (PST) From: Paul Stewart Date: Wed, 25 Jan 2012 15:12:41 -0800 Subject: [PATCH] Create DBus getter/setter for FastReauth To: hostap@lists.shmoo.com Message-Id: <20120126185117.DF08F2041A@glenhelen.mtv.corp.google.com> Cc: j@w1.fi, sleffler@chromium.org X-BeenThere: hostap@lists.shmoo.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: HostAP Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: hostap-bounces@lists.shmoo.com Errors-To: hostap-bounces@lists.shmoo.com Provide a means over DBus to set the conf->fast_reauth property, which controls whether TLS session resumption should be attempted for EAP-TLS 802.1x networks. Signed-off-by: Paul Stewart Cc: Jouni Malinen Cc: sleffler@chromium.org --- wpa_supplicant/dbus/dbus_new.c | 4 ++ wpa_supplicant/dbus/dbus_new_handlers.c | 53 +++++++++++++++++++++++++++++++ wpa_supplicant/dbus/dbus_new_handlers.h | 8 +++++ 3 files changed, 65 insertions(+), 0 deletions(-) diff --git a/wpa_supplicant/dbus/dbus_new.c b/wpa_supplicant/dbus/dbus_new.c index 2bf9be8..d54f3d5 100644 --- a/wpa_supplicant/dbus/dbus_new.c +++ b/wpa_supplicant/dbus/dbus_new.c @@ -2555,6 +2555,10 @@ static const struct wpa_dbus_property_desc wpas_dbus_interface_properties[] = { wpas_dbus_getter_networks, NULL }, + { "FastReauth", WPAS_DBUS_NEW_IFACE_INTERFACE, "u", + wpas_dbus_getter_fast_reauth, + wpas_dbus_setter_fast_reauth + }, #ifdef CONFIG_WPS { "ProcessCredentials", WPAS_DBUS_NEW_IFACE_WPS, "b", wpas_dbus_getter_process_credentials, diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c index f90c060..c8727fc 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers.c +++ b/wpa_supplicant/dbus/dbus_new_handlers.c @@ -2181,6 +2181,59 @@ dbus_bool_t wpas_dbus_setter_ap_scan(DBusMessageIter *iter, DBusError *error, /** + * wpas_dbus_getter_fast_reauth - Control fast + * reauthentication (TLS session resumption) + * @iter: Pointer to incoming dbus message iter + * @error: Location to store error on failure + * @user_data: Function specific data + * Returns: TRUE on success, FALSE on failure + * + * Getter function for "FastReauth" property. + */ +dbus_bool_t wpas_dbus_getter_fast_reauth(DBusMessageIter *iter, + DBusError *error, + void *user_data) +{ + struct wpa_supplicant *wpa_s = user_data; + dbus_uint32_t fast_reauth = wpa_s->conf->fast_reauth; + + return wpas_dbus_simple_property_getter(iter, DBUS_TYPE_UINT32, + &fast_reauth, error); +} + + +/** + * wpas_dbus_setter_fast_reauth - Control fast + * reauthentication (TLS session resumption) + * @iter: Pointer to incoming dbus message iter + * @error: Location to store error on failure + * @user_data: Function specific data + * Returns: TRUE on success, FALSE on failure + * + * Setter function for "FastReauth" property. + */ +dbus_bool_t wpas_dbus_setter_fast_reauth(DBusMessageIter *iter, + DBusError *error, + void *user_data) +{ + struct wpa_supplicant *wpa_s = user_data; + dbus_uint32_t fast_reauth; + + if (!wpas_dbus_simple_property_setter(iter, error, DBUS_TYPE_UINT32, + &fast_reauth)) + return FALSE; + + if (fast_reauth != 0 && fast_reauth != 1) { + dbus_set_error_const(error, DBUS_ERROR_FAILED, + "fast_reauth must be 0 or 1"); + return FALSE; + } + wpa_s->conf->fast_reauth = fast_reauth; + return TRUE; +} + + +/** * wpas_dbus_getter_bss_expire_age - Get BSS entry expiration age * @iter: Pointer to incoming dbus message iter * @error: Location to store error on failure diff --git a/wpa_supplicant/dbus/dbus_new_handlers.h b/wpa_supplicant/dbus/dbus_new_handlers.h index ac3af1f..c0272d5 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers.h +++ b/wpa_supplicant/dbus/dbus_new_handlers.h @@ -133,6 +133,14 @@ dbus_bool_t wpas_dbus_getter_ap_scan(DBusMessageIter *iter, DBusError *error, dbus_bool_t wpas_dbus_setter_ap_scan(DBusMessageIter *iter, DBusError *error, void *user_data); +dbus_bool_t wpas_dbus_getter_fast_reauth(DBusMessageIter *iter, + DBusError *error, + void *user_data); + +dbus_bool_t wpas_dbus_setter_fast_reauth(DBusMessageIter *iter, + DBusError *error, + void *user_data); + dbus_bool_t wpas_dbus_getter_bss_expire_age(DBusMessageIter *iter, DBusError *error, void *user_data);