dpp: add timeout for auth/config protocols
James Prestwood
PATCH v2 1/6 dpp: add timeout for auth/config protocols
This also allows the card to re-issue ROC if it ends in the middle of authenticating or configuring as well as add a maximum timeout for auth/config protocols.
IO errors were also handled as these sometimes can happen with certain drivers but are not fatal.
--- src/dpp.c | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-)
v2:
* Moved timeout cleanup into this patch
src/dpp.c +38 -10
@@ -98,6 +98,9 @@ struct dpp_sm {struct l_ecc_point *i_proto_public;uint8_t diag_token; + +/* Timeout of either auth/config protocol */ +struct l_timeout *timeout; };static void dpp_free_auth_data (struct dpp_sm *dpp)
@@ -135,6 +138,11 @@ static void dpp_reset(struct dpp_sm *dpp) dpp->offchannel_id =0 ; } +if (dpp->timeout) { +l_timeout_remove (dpp->timeout); + dpp->timeout =NULL ; + } + dpp->state =DPP_STATE_NOTHING ;dpp_free_auth_data (dpp);
@@ -239,6 +247,24 @@ static size_t dpp_build_config_header(const uint8_t *src, const uint8_t *dest,return ptr - buf; } +static void dpp_protocol_timeout (struct l_timeout *timeout,void *user_data) +{ +struct dpp_sm *dpp = user_data; + +l_debug ("DPP timed out" ); + +dpp_reset (dpp); +} + +static void dpp_reset_protocol_timer (struct dpp_sm *dpp) +{ +if (dpp->timeout) +l_timeout_modify (dpp->timeout,10 ); +else + dpp->timeout =l_timeout_create (10 , dpp_protocol_timeout, + dpp,NULL ); +} +/* * The configuration protocols use of AD components is somewhat confusing * since the request/response frames are of a different format than the rest.
@@ -733,6 +759,7 @@ static void authenticate_confirm(struct dpp_sm *dpp, const uint8_t *from,l_debug ("Authentication successful" ); +dpp_reset_protocol_timer (dpp);dpp_configuration_start (dpp, from);return ;
@@ -941,6 +968,7 @@ static void authenticate_request(struct dpp_sm *dpp, const uint8_t *from,memcpy (dpp->auth_addr, from,6 ); dpp->state =DPP_STATE_AUTHENTICATING ; +dpp_reset_protocol_timer (dpp);send_authenticate_response (dpp, r_auth);
@@ -1013,6 +1041,12 @@ static void dpp_roc_started(void *user_data) {struct dpp_sm *dpp = user_data; +/* +* If not in presence procedure, just stay on channel. +*/ +if (dpp->state !=DPP_STATE_PRESENCE ) +return ; +dpp_presence_announce (dpp); }
@@ -1082,6 +1116,8 @@ static void dpp_presence_timeout(int error, void *user_data)*/ if (error == -ECANCELED )return ; +else if (error == -EIO ) + goto next_roc;else if (error <0 ) goto protocol_failed;
@@ -1093,16 +1129,7 @@ static void dpp_presence_timeout(int error, void *user_data)return ;case DPP_STATE_AUTHENTICATING :case DPP_STATE_CONFIGURING : -/* -* TODO: If either the auth or config protocol is running we -* need to stay on channel until the specified timeouts. -* Unfortunately the kernel makes this very inconvenient since -* there is no way to stay on channel indefinitely or any way -* of knowing what duration the kernel/card actually chooses. -* -* For now just treat this as a failure. -*/ - goto protocol_failed; + goto next_roc; } dpp->freqs_idx++;
@@ -1117,6 +1144,7 @@ static void dpp_presence_timeout(int error, void *user_data)l_debug ("Presence timeout, moving to next frequency %u, duration %u" , dpp->current_freq, dpp->dwell); +next_roc: dpp->offchannel_id =offchannel_start (netdev_get_wdev_id (dpp->netdev), dpp->current_freq, dpp->dwell, dpp_roc_started, dpp, dpp_presence_timeout);
Signature · 1 line
2.31.1
James Prestwood
PATCH v2 2/6 dpp: add role definitions
Added both enrollee and configurator roles, as well as the needed logic inside the authentication protocol to verify role compatibility. The dpp_sm's role will now be used when setting capability bits making the auth protocol agnostic to enrollees or configurators.
--- src/dpp.c | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-)
src/dpp.c +32 -9
@@ -58,9 +58,15 @@ enum dpp_state { DPP_STATE_CONFIGURING, }; +enum dpp_capability { +DPP_CAPABILITY_ENROLLEE =0x01 , +DPP_CAPABILITY_CONFIGURATOR =0x02 , +}; +struct dpp_sm {struct netdev *netdev;char *uri; +uint8_t role;uint64_t wdev_id;
@@ -588,7 +594,6 @@ static void send_authenticate_response(struct dpp_sm *dpp, void *r_auth)uint8_t status =DPP_STATUS_OK ;uint64_t r_proto_key[L_ECC_MAX_DIGITS *2 ];uint8_t version =2 ; -uint8_t r_capabilities =0x01 ;struct iovec iov[3 ];uint8_t wrapped2_plaintext[dpp->key_len +4 ];uint8_t wrapped2[dpp->key_len +16 +8 ];
@@ -628,7 +633,7 @@ static void send_authenticate_response(struct dpp_sm *dpp, void *r_auth) ptr,sizeof (attrs), dpp->k2, dpp->key_len,4 ,DPP_ATTR_RESPONDER_NONCE , dpp->nonce_len, dpp->r_nonce,DPP_ATTR_INITIATOR_NONCE , dpp->nonce_len, dpp->i_nonce, -DPP_ATTR_RESPONDER_CAPABILITIES ,1 , &r_capabilities, +DPP_ATTR_RESPONDER_CAPABILITIES ,1 , &dpp->role, DPP_ATTR_WRAPPED_DATA, wrapped2_len, wrapped2); iov[1 ].iov_base = attrs;
@@ -760,7 +765,9 @@ static void authenticate_confirm(struct dpp_sm *dpp, const uint8_t *from,l_debug ("Authentication successful" );dpp_reset_protocol_timer (dpp); -dpp_configuration_start (dpp, from); + +if (dpp->role ==DPP_CAPABILITY_ENROLLEE ) +dpp_configuration_start (dpp, from);return ;
@@ -777,7 +784,6 @@ static void dpp_auth_request_failed(struct dpp_sm *dpp,uint8_t attrs[128 ];uint8_t *ptr = attrs;uint8_t version =2 ; -uint8_t r_capabilities =0x01 ;uint8_t s = status;struct iovec iov[2 ];
@@ -795,7 +801,7 @@ static void dpp_auth_request_failed(struct dpp_sm *dpp, ptr +=dpp_append_wrapped_data (hdr +26 ,6 , attrs, ptr - attrs, ptr,sizeof (attrs) - (ptr - attrs), k1, dpp->key_len,2 ,DPP_ATTR_INITIATOR_NONCE , dpp->nonce_len, dpp->i_nonce, -DPP_ATTR_RESPONDER_CAPABILITIES ,1 , &r_capabilities); +DPP_ATTR_RESPONDER_CAPABILITIES ,1 , &dpp->role); iov[1 ].iov_base = attrs; iov[1 ].iov_len = ptr - attrs;
@@ -804,6 +810,18 @@ static void dpp_auth_request_failed(struct dpp_sm *dpp, dpp->current_freq); } +static bool dpp_check_roles (struct dpp_sm *dpp,uint8_t peer_capa) +{ +if (dpp->role ==DPP_CAPABILITY_ENROLLEE && + !(peer_capa &DPP_CAPABILITY_CONFIGURATOR )) +return false; +else if (dpp->role ==DPP_CAPABILITY_CONFIGURATOR && + !(peer_capa &DPP_CAPABILITY_ENROLLEE )) +return false; + +return true; +} +static void authenticate_request (struct dpp_sm *dpp,const uint8_t *from,const uint8_t *body,size_t body_len) {
@@ -816,6 +834,7 @@ static void authenticate_request(struct dpp_sm *dpp, const uint8_t *from,const uint8_t *i_proto =NULL ;const void *wrapped =NULL ;const uint8_t *i_nonce =NULL ; +uint8_t i_capa =0 ;size_t r_boot_len =0 , i_proto_len =0 , wrapped_len =0 ;size_t i_nonce_len =0 ; _auto_(l_free) uint8_t *unwrapped = NULL;
@@ -925,9 +944,10 @@ static void authenticate_request(struct dpp_sm *dpp, const uint8_t *from,* failure by adding the DPP Status field set to * STATUS_NOT_COMPATIBLE" */ -if (!(l_get_u8 (data) &0x2 )) { -l_debug ("Initiator is not configurator" ); + i_capa =l_get_u8 (data); +if (!dpp_check_roles (dpp, i_capa)) { +l_debug ("Peer does not support required role" );dpp_auth_request_failed (dpp,DPP_STATUS_NOT_COMPATIBLE , k1); goto auth_request_failed;
@@ -1042,9 +1062,11 @@ static void dpp_roc_started(void *user_data)struct dpp_sm *dpp = user_data;/* -* If not in presence procedure, just stay on channel. +* If not in presence procedure or in a configurator role, just stay +* on channel. */ -if (dpp->state !=DPP_STATE_PRESENCE ) +if (dpp->state !=DPP_STATE_PRESENCE || + dpp->role ==DPP_CAPABILITY_CONFIGURATOR )return ;dpp_presence_announce (dpp);
@@ -1235,6 +1257,7 @@ static struct l_dbus_message *dpp_dbus_start_enrollee(struct l_dbus *dbus, 1, NULL, NULL); dpp->state =DPP_STATE_PRESENCE ; + dpp->role =DPP_CAPABILITY_ENROLLEE ;l_debug ("DPP Start Enrollee: %s" , dpp->uri);
Signature · 1 line
2.31.1
James Prestwood
PATCH v2 3/6 dpp: implement configurator role
In reply to James PrestwoodThis implements a configurator in the responder role. Currently configuring an enrollee is limited to only the connected network. This is to avoid the need to go offchannel for any reason. But because of this a roam, channel switch, or disconnect will cause the configuration to fail as none of the frames are being sent offchannel.
--- src/dpp.c | 335 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 333 insertions(+), 2 deletions(-)
v2:
* Fail if extra DPP attributes are included
src/dpp.c +333 -2
@@ -45,7 +45,12 @@#include "src/mpdu.h" #include "ell/useful.h" #include "src/common.h" +#include "src/json.h" #include "src/storage.h" +#include "src/station.h" +#include "src/scan.h" +#include "src/network.h" +#include "src/handshake.h" static uint32_t netdev_watch;static struct l_genl_family *nl80211;
@@ -107,6 +112,8 @@ struct dpp_sm {/* Timeout of either auth/config protocol */ struct l_timeout *timeout; + +struct dpp_configuration *config; };static void dpp_free_auth_data (struct dpp_sm *dpp)
@@ -149,6 +156,11 @@ static void dpp_reset(struct dpp_sm *dpp) dpp->timeout =NULL ; } +if (dpp->config) { +dpp_configuration_free (dpp->config); + dpp->config =NULL ; + } + dpp->state =DPP_STATE_NOTHING ;dpp_free_auth_data (dpp);
@@ -561,6 +573,260 @@ static void dpp_handle_config_response_frame(const struct mmpdu_header *frame,send_config_result (dpp, dpp->auth_addr); } +static void dpp_send_config_response (struct dpp_sm *dpp) +{ + _auto_(l_free) char *json; +struct iovec iov[3 ]; +uint8_t hdr[41 ]; +uint8_t attrs[512 ]; +size_t json_len; +uint8_t zero =0 ; +uint8_t *ptr = hdr +24 ; + +l_put_le16 (0x00d0 , hdr); +memcpy (hdr +4 , dpp->auth_addr,6 ); +memcpy (hdr +10 ,netdev_get_address (dpp->netdev),6 ); +memcpy (hdr +16 , broadcast,6 ); + + *ptr++ =0x04 ; + *ptr++ =0x0b ; + *ptr++ = dpp->diag_token; +l_put_le16 (0 , ptr);/* status */ + ptr +=2 ; +l_put_le16 (0 , ptr);/* fragmented (no) */ + ptr +=2 ; + *ptr++ =IE_TYPE_ADVERTISEMENT_PROTOCOL ; + *ptr++ =0x08 ; + *ptr++ =0x7f ; + *ptr++ =IE_TYPE_VENDOR_SPECIFIC ; + *ptr++ =5 ; +memcpy (ptr, wifi_alliance_oui,sizeof (wifi_alliance_oui)); + ptr +=sizeof (wifi_alliance_oui); + *ptr++ =0x1a ; + *ptr++ =1 ; + + json =dpp_configuration_to_json (dpp->config); + json_len =strlen (json); + + iov[0 ].iov_base = hdr; + iov[0 ].iov_len = ptr - hdr; + + ptr = attrs; + + ptr +=2 ;/* length */ + + ptr +=dpp_append_attr (ptr,DPP_ATTR_STATUS , &zero,1 ); + + ptr +=dpp_append_wrapped_data (attrs +2 , ptr - attrs -2 ,NULL ,0 , ptr, +sizeof (attrs), dpp->ke, dpp->key_len,2 , +DPP_ATTR_ENROLLEE_NONCE , dpp->nonce_len, dpp->e_nonce, +DPP_ATTR_CONFIGURATION_OBJECT , json_len, json); + +l_put_le16 (ptr - attrs -2 , attrs); + + iov[1 ].iov_base = attrs; + iov[1 ].iov_len = ptr - attrs; + +dpp_send_frame (dpp->wdev_id, iov,2 , dpp->current_freq); +} + +static void dpp_handle_config_request_frame (const struct mmpdu_header *frame, +const void *body,size_t body_len, +int rssi,void *user_data) +{ +struct dpp_sm *dpp = user_data; +const uint8_t *ptr = body; +struct dpp_attr_iter iter; +enum dpp_attribute_type type; +size_t len; +const uint8_t *data; +const char *json =NULL ; +size_t json_len =0 ; +struct json_contents *c; +const uint8_t *wrapped =NULL ; +const uint8_t *e_nonce =NULL ; +size_t wrapped_len =0 ; + _auto_(l_free) uint8_t *unwrapped = NULL; +uint8_t hdr_check[] = {IE_TYPE_ADVERTISEMENT_PROTOCOL ,0x08 ,0x7f , +IE_TYPE_VENDOR_SPECIFIC ,5 }; + +if (dpp->state !=DPP_STATE_AUTHENTICATING ) { +l_debug ("Configuration request in wrong state" ); +return ; + } + +if (memcmp (dpp->auth_addr, frame->address_2,6 )) { +l_debug ("Configuration request not from authenticated peer" ); +return ; + } + +if (body_len <15 ) { +l_debug ("Configuration request data not long enough" ); +return ; + } + + ptr +=2 ; + + dpp->diag_token = *ptr++; + +if (memcmp (ptr, hdr_check,sizeof (hdr_check))) +return ; + + ptr +=sizeof (hdr_check); + +if (memcmp (ptr, wifi_alliance_oui,sizeof (wifi_alliance_oui))) +return ; + + ptr +=sizeof (wifi_alliance_oui); + +if (*ptr !=0x1a && *(ptr +1 ) !=1 ) +return ; + + ptr +=2 ; + + len =l_get_le16 (ptr); + ptr +=2 ; + +if (len > body_len -15 ) +return ; + +dpp_attr_iter_init (&iter, ptr, len); + +while (dpp_attr_iter_next (&iter, &type, &len, &data)) { +switch (type) { +case DPP_ATTR_WRAPPED_DATA : + wrapped = data; + wrapped_len = len; +break ; +default : +/* Wrapped data should be only attribute */ +return ; + } + } + +if (!wrapped) { +l_debug ("Wrapped data missing" ); +return ; + } + + unwrapped =dpp_unwrap_attr (NULL ,0 ,NULL ,0 , dpp->ke, + dpp->key_len, wrapped, wrapped_len, + &wrapped_len); +if (!unwrapped) { +l_debug ("Failed to unwrap" ); +return ; + } + +dpp_attr_iter_init (&iter, unwrapped, wrapped_len); + +while (dpp_attr_iter_next (&iter, &type, &len, &data)) { +switch (type) { +case DPP_ATTR_ENROLLEE_NONCE : +if (len != dpp->nonce_len) +break ; + + e_nonce = data; +break ; +case DPP_ATTR_CONFIGURATION_REQUEST : + json = (const char *)data; + json_len = len; +break ; +default : +break ; + } + } + +if (!json || !e_nonce) { +l_debug ("No configuration object in response" ); +return ; + } + +/* +* TODO: Full JSON type support (arrays/numbers) is not yet implemented. +* Just verify the JSON is valid for now. There really isn't much need +* to parse this anyhow since IWD only supports configuring stations. +* If this request is for anything else it will fail regardless. +*/ + c =json_contents_new (json, json_len); +if (!c) { +json_contents_free (c); +return ; + } + +json_contents_free (c); + +memcpy (dpp->e_nonce, e_nonce, dpp->nonce_len); + + dpp->state =DPP_STATE_CONFIGURING ; + +dpp_send_config_response (dpp); +} + +static void dpp_handle_config_result_frame (struct dpp_sm *dpp, +const uint8_t *from,const void *body, +size_t body_len) +{ +struct dpp_attr_iter iter; +enum dpp_attribute_type type; +size_t len; +const uint8_t *data; +int status =-1 ; +const void *e_nonce =NULL ; +const void *wrapped =NULL ; +size_t wrapped_len; + _auto_(l_free) void *unwrapped; + +if (dpp->state !=DPP_STATE_CONFIGURING ) +return ; + +dpp_attr_iter_init (&iter, body +8 , body_len -8 ); + +while (dpp_attr_iter_next (&iter, &type, &len, &data)) { +switch (type) { +case DPP_ATTR_WRAPPED_DATA : + wrapped = data; + wrapped_len = len; +break ; +default : +/* Wrapped data should be only attribute */ +return ; + } + } + +if (!wrapped) +return ; + + unwrapped =dpp_unwrap_attr (body +2 , wrapped - body -6 , wrapped,0 , + dpp->ke, dpp->key_len, wrapped, + wrapped_len, &wrapped_len); +if (!unwrapped) { +l_debug ("Failed to unwrap DPP configuration result" ); +return ; + } + +dpp_attr_iter_init (&iter, unwrapped, wrapped_len); + +while (dpp_attr_iter_next (&iter, &type, &len, &data)) { +switch (type) { +case DPP_ATTR_STATUS : + status =l_get_u8 (data); +break ; +case DPP_ATTR_ENROLLEE_NONCE : + e_nonce = data; +break ; +default : +break ; + } + } + +if (status !=DPP_STATUS_OK || !e_nonce) +l_debug ("Enrollee signaled a failed configuration" ); +else +l_debug ("Configuration success" ); + +dpp_reset (dpp); +} +/* * The Authentication protocol has a consistent use of AD components, and this * use is defined in 6.3.1.4:
@@ -999,7 +1265,7 @@ auth_request_failed:dpp_free_auth_data (dpp); } -static void dpp_handle_auth_frame (const struct mmpdu_header *frame, +static void dpp_handle_frame (const struct mmpdu_header *frame,const void *body,size_t body_len,int rssi,void *user_data) {
@@ -1023,6 +1289,10 @@ static void dpp_handle_auth_frame(const struct mmpdu_header *frame,case DPP_FRAME_AUTHENTICATION_CONFIRM :authenticate_confirm (dpp, frame->address_2, body, body_len);break ; +case DPP_FRAME_CONFIGURATION_RESULT : +dpp_handle_config_result_frame (dpp, frame->address_2, + body, body_len); +break ;default :l_debug ("Unhandled DPP frame %u" , *ptr);break ;
@@ -1078,6 +1348,7 @@ static void dpp_create(struct netdev *netdev) struct dpp_sm *dpp = l_new(struct dpp_sm, 1);uint8_t dpp_prefix[] = {0x04 ,0x09 ,0x50 ,0x6f ,0x9a ,0x1a ,0x01 };uint8_t dpp_conf_response_prefix[] = {0x04 ,0x0b }; +uint8_t dpp_conf_request_prefix[] = {0x04 ,0x0a }; dpp->netdev = netdev; dpp->state =DPP_STATE_NOTHING ;
@@ -1098,12 +1369,16 @@ static void dpp_create(struct netdev *netdev) IWD_DPP_INTERFACE, dpp);frame_watch_add (netdev_get_wdev_id (netdev),0 ,0x00d0 , dpp_prefix, -sizeof (dpp_prefix), dpp_handle_auth_frame, +sizeof (dpp_prefix), dpp_handle_frame, dpp,NULL );frame_watch_add (netdev_get_wdev_id (netdev),0 ,0x00d0 , dpp_conf_response_prefix,sizeof (dpp_conf_response_prefix), dpp_handle_config_response_frame, dpp,NULL ); +frame_watch_add (netdev_get_wdev_id (netdev),0 ,0x00d0 , + dpp_conf_request_prefix, +sizeof (dpp_conf_request_prefix), + dpp_handle_config_request_frame, dpp,NULL ); } static void dpp_netdev_watch(struct netdev *netdev,
@@ -1275,6 +1550,60 @@ static struct l_dbus_message *dpp_dbus_start_enrollee(struct l_dbus *dbus,return reply; } +static struct l_dbus_message *dpp_dbus_start_configurator (struct l_dbus *dbus, +struct l_dbus_message *message, +void *user_data) +{ +struct dpp_sm *dpp = user_data; +struct l_dbus_message *reply; +struct station *station =station_find (netdev_get_ifindex (dpp->netdev)); +struct scan_bss *bss; +struct network *network; +struct l_settings *settings; +struct handshake_state *hs =netdev_get_handshake (dpp->netdev); + +/* +* For now limit the configurator to only configuring enrollees to the +* currently connected network. +*/ +if (!station) +return dbus_error_not_available (message); + + bss =station_get_connected_bss (station); + network =station_get_connected_network (station); +if (!bss || !network) +return dbus_error_not_connected (message); + + settings =network_get_settings (network); +if (!settings) +return dbus_error_not_configured (message); + +if (network_get_security (network) !=SECURITY_PSK ) +return dbus_error_not_supported (message); + +if (dpp->state !=DPP_STATE_NOTHING ) +return dbus_error_busy (message); + + dpp->uri =dpp_generate_uri (dpp->pub_asn1, dpp->pub_asn1_len,2 , +netdev_get_address (dpp->netdev), + &bss->frequency,1 ,NULL ,NULL ); + + dpp->state =DPP_STATE_PRESENCE ; + dpp->role =DPP_CAPABILITY_CONFIGURATOR ; + dpp->current_freq = bss->frequency; + dpp->config =dpp_configuration_new (settings, +network_get_ssid (network), + hs->akm_suite); + +l_debug ("DPP Start Configurator: %s" , dpp->uri); + + reply =l_dbus_message_new_method_return (message); + +l_dbus_message_set_arguments (reply,"s" , dpp->uri); + +return reply; +} +static struct l_dbus_message *dpp_dbus_stop (struct l_dbus *dbus,struct l_dbus_message *message,void *user_data)
@@ -1290,6 +1619,8 @@ static void dpp_setup_interface(struct l_dbus_interface *interface) {l_dbus_interface_method (interface,"StartEnrollee" ,0 , dpp_dbus_start_enrollee,"s" ,"" ,"uri" ); +l_dbus_interface_method (interface,"StartConfigurator" ,0 , + dpp_dbus_start_configurator,"s" ,"" ,"uri" );l_dbus_interface_method (interface,"Stop" ,0 , dpp_dbus_stop,"" ,"" ); }
Signature · 1 line
2.31.1
James Prestwood
PATCH v2 4/6 doc: document StartConfigurator
In reply to James Prestwood--- doc/device-provisioning.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
doc/device-provisioning.txt +14 -0
@@ -23,3 +23,17 @@ Methods string StartEnrollee() Possible errors: net.connman.iwd.Busy net.connman.iwd.Failed net.connman.iwd.InvalidArguments + + string StartConfigurator() + + Start a DPP configurator. Currently only connected + station devices are supported, and will only configure + the enrollee to the currently connected network. + + Returns the configurator URI + + Possible errors: net.connman.iwd.NotAvailable + net.connman.iwd.NotConnected + net.connman.iwd.NotConfigured + net.connman.iwd.NotSupported + net.connman.iwd.Busy
Signature · 1 line
2.31.1
James Prestwood
PATCH v2 5/6 client: add DPP interface
In reply to James Prestwood--- client/dbus-proxy.h | 1 + 1 file changed, 1 insertion(+)
client/dbus-proxy.h +1 -0
@@ -36,6 +36,7 @@ struct proxy_interface;#define IWD_STATION_DIAGNOSTIC_INTERFACE "net.connman.iwd.StationDiagnostic"#define IWD_AP_DIAGNOSTIC_INTERFACE "net.connman.iwd.AccessPointDiagnostic"#define IWD_DAEMON_INTERFACE "net.connman.iwd.Daemon" +#define IWD_DPP_INTERFACE "net.connman.iwd.DeviceProvisioning"typedef bool (*proxy_property_match_func_t ) (const void *a,const void *b);
Signature · 1 line
2.31.1
James Prestwood
PATCH v2 6/6 client: add DPP client commands
In reply to James PrestwoodTwo commands were added:
dpp <iface> start-enrollee
dpp <iface> start-configurator
dpp <iface> stop
In addition there is support for using the qrencode utility for displaying the QR code after DPP is started (enrollee or configurator. If qrencode is found on the system the QR code will be displayed. Otherwise only the URI will be printed to the console.
--- Makefile.am | 3 +- client/dpp.c | 233 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 235 insertions(+), 1 deletion(-) create mode 100644 client/dpp.c
Makefile.am +2 -1
@@ -299,7 +299,8 @@ client_iwctl_SOURCES = client/main.c \ client/properties.h client/properties.c \ client/wsc.c client/station.c \ client/diagnostic.c client/diagnostic.h \ - client/daemon.c client/daemon.h + client/daemon.c client/daemon.h \ + client/dpp.c client_iwctl_LDADD = $(ell_ldadd) $(READLINE_LIBS)
client/dpp.c new file +233 -0
233 lines not on this page · raw message
Signature · 1 line
2.31.1
Denis Kenzior
Hi James,
Quoted 4 lines · James Prestwood
This also allows the card to re-issue ROC if it ends in the middle of authenticating or configuring as well as add a maximum timeout for auth/config protocols.
Quoted 9 lines
IO errors were also handled as these sometimes can happen with certain drivers but are not fatal.
--- src/dpp.c | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-)v2:
* Moved timeout cleanup into this patch
All applied, thanks.
Regards,
-Denis