OSDN Git Service
Lukasz Rymanowski [Thu, 29 May 2014 13:49:36 +0000 (15:49 +0200)]
android/gatt: Fix handling signed write command from remote
As per spec (BT spec 4.1 Vol[3], Part F, chapter 3.4.5.4) message which
should be taken to generate signature is opcode, handle and parameters
Lukasz Rymanowski [Thu, 29 May 2014 13:49:35 +0000 (15:49 +0200)]
android/gatt: Verify signature counter from remote
We will receive signature counter as a part of signature in att packet.
We shall verify if signature counter has value as expected otherwise
drop the message.
Szymon Janc [Fri, 30 May 2014 10:02:57 +0000 (12:02 +0200)]
android/pics: Fix GATT PICS settings
Luiz Augusto von Dentz [Wed, 28 May 2014 11:23:33 +0000 (14:23 +0300)]
input: Do not send UHID_DESTROY
Accourding to uHID documentation when diconnecting the kernel will take
care of cleaning up any device created:
"If you close() the fd, the device is automatically unregistered and
destroyed internally."
Luiz Augusto von Dentz [Wed, 28 May 2014 11:18:18 +0000 (14:18 +0300)]
android/hidhost: Rework uHID code to use bt_uhid
Jakub Tyszkowski [Thu, 29 May 2014 13:05:04 +0000 (15:05 +0200)]
android/pts: Update GATT results
Jakub Tyszkowski [Thu, 29 May 2014 13:05:03 +0000 (15:05 +0200)]
android/gatt: Support exec write request test command
'u2' parameter is used to pass exec write flag.
Jakub Tyszkowski [Thu, 29 May 2014 13:05:02 +0000 (15:05 +0200)]
android/gatt: Support prepare write request test command
'u2' parameter is used for handle value, 'u3' for offset and
'u4' holds the value.
Jakub Tyszkowski [Thu, 29 May 2014 13:05:01 +0000 (15:05 +0200)]
android/gatt: Support write command test command
'u2' parameter is used to pass handle value.
Jakub Tyszkowski [Thu, 29 May 2014 13:05:00 +0000 (15:05 +0200)]
android/gatt: Support write request test command
'u2' parameter is used to pass handle value.
Jakub Tyszkowski [Thu, 29 May 2014 13:04:59 +0000 (15:04 +0200)]
android/gatt: Initial support for write test command
This is handled mostly the same way as read so we can use the same
function for sending att requests.
As test command parameters are of type uint16_t, we cannot write longer
values. We can figure out the ways to overcome this limitation if it
turns out that it's really needed (i.e. some PTS test cases cannot be
passed).
Eva Kolanska [Thu, 29 May 2014 13:34:15 +0000 (15:34 +0200)]
android/pts: Update GATT test results
Jakub Tyszkowski [Thu, 29 May 2014 10:34:08 +0000 (12:34 +0200)]
android/pts: Update GATT PTS status
Jakub Tyszkowski [Thu, 29 May 2014 10:34:07 +0000 (12:34 +0200)]
android/gatt: Support read by group in test commands
'u2' command parameter is used as start handle, 'u3' as end handle and
uuid as group type.
Jakub Tyszkowski [Thu, 29 May 2014 10:34:06 +0000 (12:34 +0200)]
android/gatt: Support read blob request in test command
'u2' command paremeter is used as handle and 'u3' as offset value.
Jakub Tyszkowski [Thu, 29 May 2014 10:34:05 +0000 (12:34 +0200)]
android/gatt: Suport read by type request in test command
'u2' parameter is used as start handle, 'u3' as end handle and uuid as
attribute type.
Jakub Tyszkowski [Thu, 29 May 2014 10:34:04 +0000 (12:34 +0200)]
android/gatt: Support read request in test command
'u2' command parameter is used to pass attribute handle.
Jakub Tyszkowski [Thu, 29 May 2014 10:34:03 +0000 (12:34 +0200)]
android/gatt: Add read test command stub
This adds read support to test command handler. Particular read types will be
handled basing on the 'u1' command parameter.
Szymon Janc [Thu, 29 May 2014 08:01:07 +0000 (10:01 +0200)]
android/pts: Update PTS GAP tests results
Szymon Janc [Thu, 29 May 2014 08:01:06 +0000 (10:01 +0200)]
android/pics: Update PICS for GAP
Enable peripheral mode and tweak some other settings.
Szymon Janc [Thu, 29 May 2014 10:48:20 +0000 (12:48 +0200)]
android/pts: Update PTS GATT tests selection
Szymon Janc [Thu, 29 May 2014 10:37:31 +0000 (12:37 +0200)]
android/pics: Update PICS for GATT
Eva Kolanska [Wed, 28 May 2014 14:24:48 +0000 (16:24 +0200)]
android/pts: Update GATT Server test results
Jakub Tyszkowski [Thu, 29 May 2014 05:59:11 +0000 (07:59 +0200)]
android/gatt: Fix doing database reads on write
Wrong function was called resulting in read responses being send along
with write response. As it is now 'process_dev_pending_requests' is
processing only read requests.
Szymon Janc [Mon, 26 May 2014 21:53:28 +0000 (23:53 +0200)]
android/gatt: Implement disconnect test command
Szymon Janc [Mon, 26 May 2014 21:53:27 +0000 (23:53 +0200)]
android/gatt: Implement connect test command
Szymon Janc [Mon, 26 May 2014 21:53:26 +0000 (23:53 +0200)]
android/gatt: Implement enable test command
This command is used to enable and disable test interface.
Szymon Janc [Mon, 26 May 2014 21:53:25 +0000 (23:53 +0200)]
android/gatt: Factor out unregistering client into helper function
This will be also used by test interface.
Szymon Janc [Mon, 26 May 2014 21:53:24 +0000 (23:53 +0200)]
android/gatt: Add initial implementation of client test command
This command is used to performe some tasks not available from
standard API and usable only for PTS testing.
Andrzej Kaczmarek [Wed, 28 May 2014 08:50:02 +0000 (10:50 +0200)]
tools/hcidump: Decode MPEG-1,2 Audio codec capabilities
Jakub Tyszkowski [Wed, 28 May 2014 07:48:49 +0000 (09:48 +0200)]
android/gatt: Initialize crypto first
This fixes the missleading error on crypto setup failure:
02-17 20:19:44.639 I/bluetoothd( 1705): bluetoothd[1706]: gatt: Failed
to allocate memory for queues
Jakub Tyszkowski [Wed, 28 May 2014 09:34:15 +0000 (11:34 +0200)]
android/pts: Update GATT PTS results
Lukasz Rymanowski [Wed, 28 May 2014 09:30:06 +0000 (11:30 +0200)]
android/pts: Update SM PTS test results
Rerun TC_JW_* test cases
Jakub Tyszkowski [Wed, 28 May 2014 09:17:59 +0000 (11:17 +0200)]
android/gatt: Fix not checking for read errors in read by type
Jakub Tyszkowski [Wed, 28 May 2014 09:19:06 +0000 (11:19 +0200)]
android/client: Allow zero length responses
Eva Kolanska [Wed, 28 May 2014 08:53:21 +0000 (10:53 +0200)]
android/pts: Update GATT test results
Jakub Tyszkowski [Tue, 27 May 2014 10:15:32 +0000 (12:15 +0200)]
shared/gatt-db: Fix cropping permissions value
Jakub Tyszkowski [Tue, 27 May 2014 10:15:31 +0000 (12:15 +0200)]
android/gatt: Use proper variable to store response length
This fixes confirmations being not send.
Jakub Tyszkowski [Tue, 27 May 2014 10:15:30 +0000 (12:15 +0200)]
gatt: Fix not freeing GError on failure
Jakub Tyszkowski [Tue, 27 May 2014 10:15:29 +0000 (12:15 +0200)]
attrib: Fix minor whitespace issue
Replace spaces with tabs.
Jakub Tyszkowski [Tue, 27 May 2014 11:52:47 +0000 (13:52 +0200)]
android/gatt: Fix not sending write request responses
Responses were pushed to pending response queue but send was never
triggered.
Eva Kolanska [Tue, 27 May 2014 14:22:39 +0000 (16:22 +0200)]
android/pts: Update GATT PTS tests results
Johan Hedberg [Tue, 27 May 2014 17:58:28 +0000 (20:58 +0300)]
tools/btmgmt: Fix address type in user confirm replies
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:47 +0000 (15:16 +0200)]
android: Add avinfo to makefile
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:46 +0000 (15:16 +0200)]
tools/avinfo: Decode aptX codec capabilities
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:45 +0000 (15:16 +0200)]
tools/avinfo: Decode MPEG-2,4 AAC codec capabilities
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:44 +0000 (15:16 +0200)]
tools/hcidump: Decode aptX codec capabilities
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:43 +0000 (15:16 +0200)]
tools/hcidump: Decode MPEG-2,4 AAC codec capabilities
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:41 +0000 (15:16 +0200)]
audio: Add definitions for aptX
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:40 +0000 (15:16 +0200)]
audio: Add macros to access MPEG-2,4 AAC codec info
This patch provides helper macros to get, set and init-in-struct both
frequency and bitrate fields in codec info structs for MPEG-2,4 AAC.
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:39 +0000 (15:16 +0200)]
audio: Add definitions for MPEG-2,4 AAC codec
frequency and bitrate bit-fields are splitted into separate bytes since
they span across byte-boundary and cannot be set easily on LE arch
anyway.
Andrzej Kaczmarek [Mon, 26 May 2014 13:16:38 +0000 (15:16 +0200)]
audio: Fix a2dp_vendor_codec_t declaration
As per A2DP spec, both Vendor ID (4.7.2.1) and Codec ID (4.7.2.2) are
defined as 32-bit and 16-bit values respectively rather that array of
bytes. Also changing to uint types will make using these values in code
much easier.
Andrei Emeltchenko [Thu, 22 May 2014 12:06:05 +0000 (15:06 +0300)]
android/hal-sco: Fix memory leak
Release resampler on exit.
Johan Hedberg [Tue, 27 May 2014 09:15:11 +0000 (12:15 +0300)]
shared/crypto: Fix fd leaks in bt_crypto_sign_att()
Eva Kolanska [Tue, 27 May 2014 08:40:39 +0000 (10:40 +0200)]
android/pts: Update GATT PTS tests results
Marcin Kraglak [Mon, 26 May 2014 14:06:23 +0000 (16:06 +0200)]
android/gatt: Check permissions before write execution
Check attribute's permissions and return error if device is not allowed
to read.
Marcin Kraglak [Mon, 26 May 2014 14:06:22 +0000 (16:06 +0200)]
android/gatt: Fix possible memory leak in write request
If write cannot be executed, remove data from queue and free
allocated memory.
Eva Kolanska [Mon, 26 May 2014 15:03:46 +0000 (17:03 +0200)]
android/pts: Update GATT tests results
Szymon Janc [Mon, 26 May 2014 15:03:45 +0000 (17:03 +0200)]
android/README: Update required kernel options
CRYPTO support is required by gatt.
Szymon Janc [Mon, 26 May 2014 15:03:44 +0000 (17:03 +0200)]
android/hal-gatt: Fix missing check if interface is ready
Andrei Emeltchenko [Thu, 22 May 2014 13:07:02 +0000 (16:07 +0300)]
android/hal-audio: Fix invalid memory access when downmixing to mono
While iterating over input buffer frame's size was not correctly taken
into account. Input buffer is always PCM 16bit stereo (4 bytes per
frame).
Marcin Kraglak [Mon, 26 May 2014 09:10:29 +0000 (11:10 +0200)]
android/gatt: Check permissions before read execution
Check device security level and attribute permissions before read
execution.
Marcin Kraglak [Mon, 26 May 2014 09:10:28 +0000 (11:10 +0200)]
android/gatt: Add proper permissions to built-in services
Set permissions to built in services.
Marcin Kraglak [Mon, 26 May 2014 09:10:27 +0000 (11:10 +0200)]
android/gatt: Store proper attributes permissions in database
Convert Android HAL permissions to GATT server permissions and store
them in database.
Marcin Kraglak [Mon, 26 May 2014 09:10:26 +0000 (11:10 +0200)]
android/hal-gatt: Define attribute permissions values
These values are defined in Android and should be used on daemon
side.
Marcin Kraglak [Mon, 26 May 2014 09:10:25 +0000 (11:10 +0200)]
shared/gatt: Add helper for getting attribute's permissions
It will return attribute's permissions or 0 if attribute was not found.
Marcin Kraglak [Mon, 26 May 2014 09:10:24 +0000 (11:10 +0200)]
shared/gatt: Define atribute permissions as uint32_t
Szymon Janc [Thu, 22 May 2014 09:41:14 +0000 (11:41 +0200)]
android/pts: Update MPS tests results
Szymon Janc [Fri, 23 May 2014 11:30:21 +0000 (13:30 +0200)]
android/pics: Enable NAP and PBAP in MPS settings
Szymon Janc [Thu, 22 May 2014 09:39:47 +0000 (11:39 +0200)]
android/bluetooth: Register SDP record for MPS
This was affecting TC_AG_SRC_HFAV_ACT_SD_BV_01_I and
TC_SDP_CTH_SD_BV_01_I PTS qualification tests.
Szymon Janc [Thu, 22 May 2014 08:57:05 +0000 (10:57 +0200)]
lib/sdp: Add attributes and service class for MPS
Jakub Tyszkowski [Mon, 26 May 2014 07:13:16 +0000 (09:13 +0200)]
android/gatt: Use default mtu on mtu exchange response
We should be setting new mtu after sending response using old mtu. This
also moves sending the response from att_handler to mtu_att_handle.
Jakub Tyszkowski [Mon, 26 May 2014 07:13:15 +0000 (09:13 +0200)]
android/gatt: Make att_handler use g_attrib buffer
This makes use of g_attrib buffer for output and removes some unused
read_by_group_type function parameters.
Jakub Tyszkowski [Mon, 26 May 2014 07:13:14 +0000 (09:13 +0200)]
android/gatt: Use g_attrib buffer where possible for att
This replaces fixed size pdu usage with g_attrib buffer when possible.
When only received packets are decoded we use dynamic allocation with
current mtu.
Jakub Tyszkowski [Mon, 26 May 2014 07:32:43 +0000 (09:32 +0200)]
android: Fix sending uninitialised data
This fixes the following:
==25759== Syscall param socketcall.sendmsg(msg.msg_iov[i]) points to
uninitialised byte(s)
==25759== at 0x521C570: __sendmsg_nocancel (syscall-template.S:82)
==25759== by 0x41688F: ipc_send (ipc.c:366)
==25759== by 0x40ECF8: send_ssp_request (bluetooth.c:1028)
==25759== by 0x4110A6: user_confirm_request_callback
(bluetooth.c:1055)
==25759== by 0x4094FE: queue_foreach (queue.c:186)
==25759== by 0x409FCF: can_read_data (mgmt.c:287)
==25759== by 0x408E4C: read_callback (io-glib.c:168)
==25759== by 0x4E79D12: g_main_context_dispatch (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4)
==25759== by 0x4E7A05F: ??? (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4)
==25759== by 0x4E7A459: g_main_loop_run (in
/lib/x86_64-linux-gnu/libglib-2.0.so.0.3200.4)
==25759== by 0x40454D: main (main.c:538)
==25759== Address 0x7ff00085d is on thread 1's stack
==25759== Uninitialised value was created by a stack allocation
==25759== at 0x40EC77: send_ssp_request (bluetooth.c:1018)
Jakub Tyszkowski [Mon, 26 May 2014 07:32:42 +0000 (09:32 +0200)]
android/gatt: Fix possible memory leak
Lukasz Rymanowski [Thu, 22 May 2014 19:06:26 +0000 (21:06 +0200)]
android/gatt: Add handling signed write from remote device
Lukasz Rymanowski [Thu, 22 May 2014 19:06:25 +0000 (21:06 +0200)]
android/gatt: Add support for signed write command
Lukasz Rymanowski [Thu, 22 May 2014 19:06:24 +0000 (21:06 +0200)]
android/gatt: Add crypto needed for sign write
Lukasz Rymanowski [Thu, 22 May 2014 19:06:23 +0000 (21:06 +0200)]
android/bluetooth: Store sign counter needed for aes-cmac sign
If CSRK is valid between sessions we should remember sign counter.
Therefor store it.
Lukasz Rymanowski [Thu, 22 May 2014 19:06:22 +0000 (21:06 +0200)]
android/bluetooth: Read CSRK from the storage on startup
Lukasz Rymanowski [Thu, 22 May 2014 19:06:21 +0000 (21:06 +0200)]
android/bluetooth: Store CSRK
CSRK is generated while paring and should be used for sign att packets
when LE devices uses write signed command.
Lukasz Rymanowski [Thu, 22 May 2014 19:06:20 +0000 (21:06 +0200)]
android/bluetooth: Add support to read CSRK from the kernel
Lukasz Rymanowski [Thu, 22 May 2014 19:06:19 +0000 (21:06 +0200)]
android/bluetooth: Expose API to update sign counter
This is needed so GATT can notify GAP that write sign has been done and
sign counter shall be increased as per spec.
Lukasz Rymanowski [Thu, 22 May 2014 19:06:18 +0000 (21:06 +0200)]
android/bluetooth: Expose API to get CSRK for device
GATT will take CSRK key and sign counter each time it needs it to sign
att package or to verify att package
Lukasz Rymanowski [Thu, 22 May 2014 19:06:17 +0000 (21:06 +0200)]
attrib: Add wrapper to send signed write command
Lukasz Rymanowski [Thu, 22 May 2014 19:06:16 +0000 (21:06 +0200)]
attrib: Add helpers to enc and dec signed write command
Lukasz Rymanowski [Thu, 22 May 2014 19:06:15 +0000 (21:06 +0200)]
shared/crypto: Extend bt_crypto_sign_att with sign counter
Sign counter is use in two places during att signing:
1) Shall be concatenated with message to be sign as specified in BT spec
4.1, Vol[3], Part H, chapter 2.4.5
2) Shall be a part of signature send in the att packet as specified in
BT spec 4.1 Vol[3], Part C, chapter 10.4.1
With this patch, bt_crypto_sign_att returns signature as specified in 2)
This patch also updates unit tests so now it uses sign counter 0. Note
that test vectors no longer match that one from NIST Special
Publication 800-38B
Szymon Janc [Sat, 24 May 2014 18:53:58 +0000 (20:53 +0200)]
shared/uhid: Use uhid_copy.h instead of system header
Szymon Janc [Sat, 24 May 2014 18:53:57 +0000 (20:53 +0200)]
input: Update uhid_copy.h to version from Linux 3.14
Marcel Holtmann [Sat, 24 May 2014 16:59:20 +0000 (09:59 -0700)]
doc: Update test numbers for mgmt-tester
Marcel Holtmann [Fri, 23 May 2014 18:19:49 +0000 (11:19 -0700)]
build: Add test-uhid binary to .gitignore list
Marcel Holtmann [Fri, 23 May 2014 18:18:50 +0000 (11:18 -0700)]
doc: Add test-uhid test numbers to our coverage list
Eva Kolanska [Fri, 23 May 2014 14:23:39 +0000 (16:23 +0200)]
android/pts: Update GATT tests results
Lukasz Rymanowski [Fri, 23 May 2014 13:49:06 +0000 (15:49 +0200)]
android/gatt: Add debug logs useful for PTS testing
Luiz Augusto von Dentz [Fri, 23 May 2014 12:07:55 +0000 (15:07 +0300)]
input/hog: Rework uHID code to use bt_uhid
Luiz Augusto von Dentz [Fri, 23 May 2014 11:22:58 +0000 (14:22 +0300)]
input/device: Fix warnings when disconnecting
Since the introdution of btd_profile there is a dedicated callback for
disconnecting profiles which should never be mixed with
device_add_disconnect_watch since they serve the same purpose.
Luiz Augusto von Dentz [Thu, 22 May 2014 14:07:05 +0000 (17:07 +0300)]
input/device: Rework uHID code to use bt_uhid
Luiz Augusto von Dentz [Wed, 21 May 2014 14:46:11 +0000 (17:46 +0300)]
unit/test-uhid: Add /uhid/event/feature test
Luiz Augusto von Dentz [Wed, 21 May 2014 14:42:33 +0000 (17:42 +0300)]
unit/test-uhid: Add /uhid/event/output test