When re-pairing was successful (indicated by enabling encryption with
STK) old keys are no longer needed as those will be replaced by keys
distributed in new pairing.
Change-Id: If2a81e8e94f35eb04ce9a7e4d782094632cbd77a
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
The -i (interface) option was not described in usage.
Change-Id: I50d01f0e639d3258234c5573abd8836a7144584e
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Add note about possible firewall issue in host.
Make sure you run echo-server as a root user.
Change-Id: I9ebe06db799eef8664d7d7ccb38827280e338f9d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
So return 0 if all the tests run ok, and !=0 if some failed.
Change-Id: Ib66d84dbcc6cc29e5e46609b1e2b1b1748ce6fcc
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The test application name was printed incorrectly.
Change-Id: I1686dd886c26cd94dbf2482fe904bd61e66d4a78
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Use the nano_fifo_get_wait() API when waiting network packets.
This function will block until there is data in the socket.
The timeout version called nano_fiber_fifo_get_wait_timeout()
is not working at the moment.
Change-Id: I42bddf8921cae0ed3caec8226b6086833534ae65
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Print information who allocated or freed mac net buffer.
Change-Id: I106e1703b7f5c3e5363d53d63c599a12b65577cb
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Use more generic stack analyze functions that are now
found in net_buf.h
Change-Id: I473665bbad8aa1a6749a4c5dc1d6952bdb56da5d
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Generalize the stack analyze functions so that they
can be used by other fibers.
Change-Id: If1fae51db45010b75f6ac58cd8d874b31ca336e2
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Make sure we are not trying to release a NULL net_buf.
Change-Id: Ie4d2e7cdbd4f85c5543874471cc7c7ce3bc0b9df
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
The macro was incorrectly set and caused in certain case
wrong expansion.
Change-Id: I5198906a5066882d178c0fcff8c6816a5461f37a
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
If the net_buf allocation fails, then return and do not
try to access it.
Change-Id: Ib4c4a0b3a6669f6e6030357f3f2dd9af4dc638c8
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Use the new NET_BUF_IP() and NET_BUF_UDP() macros to access
IP and UDP data in the received network buffer.
Change-Id: Ic35ddf6fa8641aa6334b1207a8c2f1f19a39866f
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Fail if we have keys that are stronger than keys that will be
distributed in new pairing. This is to avoid replacing authenticated
keys with unauthenticated ones.
Change-Id: If81b158f68a818d7a6e5d2854b482f34516b4737
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Keys from same pairing have are of similar key type and
this can be stored in single place.
Change-Id: I38426c282604769424098af6ee26e0cf9cb5f358
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
There is no need for separate lists of each key type as this
lookup optimization is of little benefit. Removing those results in
much simpler and smaller code. Using array over list also improves
data locality and thus cache utilization.
This patch results in following code size reduction:
keys.o from 14208 to 10028 bytes
microkernel.elf from 599417 to 597091 bytes
Change-Id: Ia8fe21ca3d79f668d8550c4376fa403e8778861e
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
default_conn is assigned only on connected event so there was
no way to cancel pending outgoing connection.
Change-Id: Iba5018e887c5b3f87513fc5c8f4585fb6ec40c8d
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
There is no need to use strncmp for string type arguments terminaded
by NUL character.
Change-Id: Ib90517f4657de8da64f145afd0ac28aefa697026
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
To avoid multiple prints with cmd help one label will be used.
Change-Id: Ieaaffd8b4321fdb2ad2f95894d293ec1d6eb8d10
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
Ensure smp->remote_dist tracks unreceived PDUs both for slave and
master role, and use the same logic in all PDU handlers for
remote_dist and allowed_cmds.
Change-Id: If4769d0be0118e8e764d7483f0d93ef8b61fa398
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Other function name was used "bt_gatt_attr_read_included" by include
than the implementation "bt_gatt_attr_read_include" has.
Function naming mismatch caused linker error if used included service
define.
Change-Id: Ib4b4d07050d634cb1578c8a8948322acad85a307
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
Due to bug in test case configuration file tester application
was not build by 'Build Automation'. This application has all
Bluetooth debugs enabled so it is essential for build verification
process.
Change-Id: I51115d17a28614b7746c6d207d4362a94bc0f591
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This patch separate character to hex character convertion part and
moves related code to helper.
Change-Id: I5c754669583228566e80a9b20a9db0e639641677
Signed-off-by: Grzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>
This fix following build error:
CC net/bluetooth/hci_core.o
In file included from net/bluetooth/hci_core.c:43:0:
net/bluetooth/hci_core.c: In function 'update_conn_params':
net/bluetooth/hci_core.c:751:49: error: 'evt' undeclared
(first use in this function)
BT_DBG("status %u, handle %u,features 0x%x\n", evt->status, handle,
Change-Id: Ic3c15d17c73b26d44913327df577495afc80f356
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Adds host bits to initiate LL LE Exchange Feature procedure if
supported. Both the master and slave can initate it for controllers
newer than 4.0. For 4.0 controllers only master can do that.
Inform upper stack layers of the slave about the connection is ready
to use only when LE Exchange Feature isn't supported. Otherwise
upper layers shall be notified about new connection when Connection
Parameters Update procedure is finished.
Change-Id: Ief29744e498873f79fc6f62f98c083fecaeae24e
Signed-off-by: Arkadiusz Lichwa <arkadiusz.lichwa@tieto.com>
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Since then bt_conn_connected as well as bt_l2cap_disconnected callback
can be called from bt_conn_set_state directly.
Also connected cb could be called from there, however
eg. introduction of some additional state is required TBD.
Change-Id: Ida6906272e1468ef5b41ba8dba2a936db049d308
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
Makes bt_l2cap_update_conn_param to return an error if command was not
sent.
Change-Id: Ie7351040bd371bb161afc2f2a2c10e015bcdc8e4
Signed-off-by: Mariusz Skamra <mariusz.skamra@tieto.com>
There is no need to have sparate bool in context structure while
flags field is available.
Change-Id: Ib1bcf9794c32268897b0a873787566a620f3097b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
If ref is zero other struct bt_conn fields should be considered
garbage. Using ref count instead of address is also faster.
Change-Id: Ic3b30c0fdbce8f93f81095d3671be0e54eac1455
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This allows to select more authentication options and reply
to all requests.
Change-Id: I220d945763b9381818c5caad52bf0f5e8b01ab54
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
If slave is requesting MITM protection verify if LTK is authenticated
before enabling encryption.
Change-Id: I6642f88945b0ca0310880935edbcfa2a6764c8d8
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
If authenticated key was used for encryption resulting security
level is high. If resulting security level is lower then
requested level link is disconnected.
Change-Id: Ib66f722e6bb52e943d2b5cefb58f018707ce725b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
If high security is required but keys are unauthenticated start
pairing instead of encrypting with too weak keys.
Change-Id: I35e5f0c1ab86660479288908152d61823ffb102e
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
There is no point in initializing security if required security level
is not reachable due to local IO capabilities.
Change-Id: I00d3cc552fcce4d1aac9498c90dcd826735dcb2b
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This allows to store information if key was generated during
authenticated or unauthenticated pairing.
Change-Id: Idd398749c869e6278bf10909cfb768ba09565d54
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This monitor_15_4 tool is run in the host side. It will connect
to Zephyr via UART using pipes. Test app1 in qemu send data
through the uart and pipe, this tool read data from pipe1
and writes it to pipe2 where test app2 running in qemu2
will read data from it and vice-versa. In between tool store
data in pcap format for further wireshark packet analyzation.
Change-Id: If5c998591edf4253fbd5e249c6c9e48fa1792715
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
Cache input type and validate TLV according to it. Check
uart_send return values.
Change-Id: Ib1f784a776176763773fead2d464330a4325ba19
Signed-off-by: Ravi kumar Veeramally <ravikumar.veeramally@linux.intel.com>
If JustWorks pairing is used for pairing don't report failure.
Change-Id: I23cee54a74dd021c1f273d987ca67066452d7801
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
Flags for indicating if stored TK is valid and if confirm sending
was delayed are required for properly handling passkey entry input.
This is to avoid using incorrent TK or sending SMP commands in invalid
order.
Change-Id: I11e162331e93311f292f0723fc9f860c753d7d96
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This allows to request passkey being entered by user.
Change-Id: I6a56c65ca689473659a13c19f8578058476d2685
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This allows to track which pairing method was used and is
a preparation for storing information if resulting keys
are authenticated.
Change-Id: Ib9fc762d19bd4add6f0b431745eeb9e2780016d4
Signed-off-by: Szymon Janc <ext.szymon.janc@tieto.com>
This makes the code more consistent by always trying to name bt_buf
variables as buf.
Change-Id: I10d54260c5cf2f6aea5300668d5eb68f3da2a8ba
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
The dtls-client app will run in Zephyr and will send network
packets to host process (dtls-server) via SLIP.
Change-Id: I51e3424193e6a7169d9921ba56466bb0c0c0d4d1
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This dtls-server app is run in the host side. It will
connect to Zephyr via UART using SLIP. The app will
listen DTLS data in socket 4242 and will reverse the returned
bytes and send them back to the sender. The application
supports both IPv4 and IPv6 protocols.
Change-Id: I8d37b0d3318bf6a3a5365e7d2c64eae83a1f3285
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
- Handle the new error callback type, a ROR interrupt is irrecoverable.
- Removing the fifo pre-fill: this should never be done that way. It's
up to the controller to request via an interrupt to get its fifo
filled-in. (TFS bit on SSSR register is the one requesting such
filling)
- Disabling the controller once completed (following transfer will
re-enable it)
- Removing useless debugging info
Change-Id: I466a8efb65a41f3315a6a36e10ea519d0c4b01e9
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Such type will be used in case of unrecoverable error on driver side
while transceiving.
Taking the opportunity to fix spi_transceive declaration as it should be
static.
Change-Id: I7392f93b34cf6d74900c844607cf03e741837876
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>