Commit Graph

19145 Commits

Author SHA1 Message Date
Andrzej Kaczmarek
c93915c343 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.
2014-05-27 17:56:36 +03:00
Andrzej Kaczmarek
73f5534028 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.
2014-05-27 17:56:36 +03:00
Andrei Emeltchenko
3c5413c3dd android/hal-sco: Fix memory leak
Release resampler on exit.
2014-05-27 16:38:48 +03:00
Johan Hedberg
cc3dd149f8 shared/crypto: Fix fd leaks in bt_crypto_sign_att() 2014-05-27 12:15:11 +03:00
Eva Kolanska
cad7c666c1 android/pts: Update GATT PTS tests results 2014-05-27 11:06:52 +02:00
Marcin Kraglak
881c2be854 android/gatt: Check permissions before write execution
Check attribute's permissions and return error if device is not allowed
to read.
2014-05-27 00:13:06 +02:00
Marcin Kraglak
bf44e53bf4 android/gatt: Fix possible memory leak in write request
If write cannot be executed, remove data from queue and free
allocated memory.
2014-05-27 00:13:05 +02:00
Eva Kolanska
4953238ca6 android/pts: Update GATT tests results 2014-05-27 00:07:20 +02:00
Szymon Janc
4b75bb8e7b android/README: Update required kernel options
CRYPTO support is required by gatt.
2014-05-27 00:05:58 +02:00
Szymon Janc
9dce79972e android/hal-gatt: Fix missing check if interface is ready 2014-05-27 00:05:58 +02:00
Andrei Emeltchenko
510aae0f8e 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).
2014-05-26 14:36:25 +02:00
Marcin Kraglak
56a9685d81 android/gatt: Check permissions before read execution
Check device security level and attribute permissions before read
execution.
2014-05-26 14:13:59 +02:00
Marcin Kraglak
f72f19c757 android/gatt: Add proper permissions to built-in services
Set permissions to built in services.
2014-05-26 14:13:59 +02:00
Marcin Kraglak
94a00ef006 android/gatt: Store proper attributes permissions in database
Convert Android HAL permissions to GATT server permissions and store
them in database.
2014-05-26 14:13:58 +02:00
Marcin Kraglak
ce42888b9b android/hal-gatt: Define attribute permissions values
These values are defined in Android and should be used on daemon
side.
2014-05-26 14:13:58 +02:00
Marcin Kraglak
57954cb066 shared/gatt: Add helper for getting attribute's permissions
It will return attribute's permissions or 0 if attribute was not found.
2014-05-26 14:13:58 +02:00
Marcin Kraglak
8061d4ca5c shared/gatt: Define atribute permissions as uint32_t 2014-05-26 14:13:58 +02:00
Szymon Janc
7c275ee0d3 android/pts: Update MPS tests results 2014-05-26 11:07:28 +02:00
Szymon Janc
793d84ed78 android/pics: Enable NAP and PBAP in MPS settings 2014-05-26 11:07:28 +02:00
Szymon Janc
f3ad56bdf5 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.
2014-05-26 11:07:28 +02:00
Szymon Janc
0b01caab7b lib/sdp: Add attributes and service class for MPS 2014-05-26 11:07:28 +02:00
Jakub Tyszkowski
0fc577d841 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.
2014-05-26 10:52:55 +02:00
Jakub Tyszkowski
8197cf3da2 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.
2014-05-26 10:52:55 +02:00
Jakub Tyszkowski
8989a684f7 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.
2014-05-26 10:52:55 +02:00
Jakub Tyszkowski
f43d74eb83 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)
2014-05-26 10:45:56 +02:00
Jakub Tyszkowski
8b2a8c9257 android/gatt: Fix possible memory leak 2014-05-26 10:45:56 +02:00
Lukasz Rymanowski
6988399496 android/gatt: Add handling signed write from remote device 2014-05-26 10:28:16 +02:00
Lukasz Rymanowski
537e5de5d2 android/gatt: Add support for signed write command 2014-05-26 10:28:16 +02:00
Lukasz Rymanowski
3785fca57c android/gatt: Add crypto needed for sign write 2014-05-26 10:28:16 +02:00
Lukasz Rymanowski
067c255878 android/bluetooth: Store sign counter needed for aes-cmac sign
If CSRK is valid between sessions we should remember sign counter.
Therefor store it.
2014-05-26 10:28:16 +02:00
Lukasz Rymanowski
4c1d913ddc android/bluetooth: Read CSRK from the storage on startup 2014-05-26 10:28:16 +02:00
Lukasz Rymanowski
bfcc673c98 android/bluetooth: Store CSRK
CSRK is generated while paring and should be used for sign att packets
when LE devices uses write signed command.
2014-05-26 10:28:16 +02:00
Lukasz Rymanowski
f976567382 android/bluetooth: Add support to read CSRK from the kernel 2014-05-26 10:28:16 +02:00
Lukasz Rymanowski
55fa5f1e94 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.
2014-05-26 10:28:16 +02:00
Lukasz Rymanowski
2003db3897 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
2014-05-26 10:28:16 +02:00
Lukasz Rymanowski
84bbaa3971 attrib: Add wrapper to send signed write command 2014-05-26 10:28:12 +02:00
Lukasz Rymanowski
d4026bb36e attrib: Add helpers to enc and dec signed write command 2014-05-26 10:27:21 +02:00
Lukasz Rymanowski
87f79a9c7d 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
2014-05-26 10:27:21 +02:00
Szymon Janc
567d19e472 shared/uhid: Use uhid_copy.h instead of system header 2014-05-25 12:59:01 +03:00
Szymon Janc
af2a377075 input: Update uhid_copy.h to version from Linux 3.14 2014-05-25 12:58:52 +03:00
Marcel Holtmann
9e624240fe doc: Update test numbers for mgmt-tester 2014-05-24 09:59:20 -07:00
Marcel Holtmann
3103f22cd6 build: Add test-uhid binary to .gitignore list 2014-05-23 11:19:49 -07:00
Marcel Holtmann
8bfe0af390 doc: Add test-uhid test numbers to our coverage list 2014-05-23 11:18:50 -07:00
Eva Kolanska
0096a78818 android/pts: Update GATT tests results 2014-05-23 16:57:34 +02:00
Lukasz Rymanowski
e71b3028a2 android/gatt: Add debug logs useful for PTS testing 2014-05-23 15:58:35 +02:00
Luiz Augusto von Dentz
330a3ab42d input/hog: Rework uHID code to use bt_uhid 2014-05-23 16:40:29 +03:00
Luiz Augusto von Dentz
1925241046 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.
2014-05-23 16:40:29 +03:00
Luiz Augusto von Dentz
e93eeb6cff input/device: Rework uHID code to use bt_uhid 2014-05-23 16:40:29 +03:00
Luiz Augusto von Dentz
00d4b9d89f unit/test-uhid: Add /uhid/event/feature test 2014-05-23 16:40:29 +03:00
Luiz Augusto von Dentz
8f18444f6f unit/test-uhid: Add /uhid/event/output test 2014-05-23 16:40:29 +03:00