Re: [PATCH v2] Add support of secure pin code in mgmt code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Waldek,

On Thu, May 26, 2011, Waldemar Rymarkiewicz wrote:
> -	err = btd_event_request_pin(&dev->bdaddr, dba);
> +	err = btd_event_request_pin(&dev->bdaddr, dba, 0);

Even though the mgmt protocol uses uint8_t from there upwards you should
use gboolean, i.e. use FALSE instead of 0 here.

>  static int pincode_request_new(struct agent_request *req, const char *device_path,
> -				dbus_bool_t numeric)
> +				uint8_t secure)

Since in the long run secure will map to a D-Bus message parameter, use
dbus_bool_t for it here (just like numeric).

>  
>  	if (agent->request)
>  		return -EBUSY;
>  
> +	secure = device_get_secure_pin(device);

The agent_request_pincode function should get the secure parameter
passed to it directly. It shouldn't need to poll device.c about it.

> diff --git a/src/device.c b/src/device.c
> index 4ffc124..f4fb5c7 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -133,6 +133,8 @@ struct btd_device {
>  	gboolean	paired;
>  	gboolean	blocked;
>  
> +	uint8_t		secure_pin;
> +
>  	gboolean	authorizing;
>  	gint		ref;
>  };

struct authentictation_req (device->authr) is the right place to store
this value since it's bound is to the lifetime of the authentication
request, whereas struct btd_device isn't. Also, as previously mentioned
the type should be gboolean and not uint8_t.

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux