Esp-idf defines the BIT macro that is also defined in Zephyr's
misc/util.h. Fix the issue by including the esp-idf headers first, so
that a check in util.h won't redefine the macro if it's already
defined.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
The `z` vector was not initialized in the call to
uECC_vli_nativeToBytes(), resulting in undefined behavior. Use the
properly initialized `exp_z` array instead.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
Zeroing out 2*NUM_ECC_WORDS bytes starting from the `p2` pointer would
not only write 16 bytes to an 8-byte array allocated on the stack, but
also not clear out important arrays such as `_private` and `tmp`.
Moreover, no memory was cleared out before returning from the function,
and there are two exit points.
Properly memset() all private data and use an empty assembly block
referencing the memory region to avoid the memset() calls to be elided
by the compiler.
Ideally, in the future, all stack-allocated variables that contains
sensitive information should be marked with __attribute__((cleanup)), a
GCC extension that calls a function when the variable exits the scope.
This will not only reduce code size, but for other functions with
multiple exit points, also ensure that sensitive data is always
cleared.
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
POSIX requires struct sockaddr's field to be named "sa_family"
(not just "family"):
http://pubs.opengroup.org/onlinepubs/009696699/basedefs/sys/socket.h.html
This change allows to port POSIX apps easier (including writing
portable apps using BSD Sockets compatible API).
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
POSIX doesn't guarantee that "legacy" struct sockaddr is large enough
for all usages, e.g. IPv6 addresses, and instead requires use of
struct sockaddr_storage:
http://pubs.opengroup.org/onlinepubs/009696699/basedefs/sys/socket.h.html
... shall define the sockaddr_storage structure. This structure
shall be:
Large enough to accommodate all supported protocol-specific
address structures
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Simplify top-level table of contents and create the user guide which
includes the application development primer and other guides and
refereces instead of having them at the top-level.
Also move glossary section away from top-level TOC and remove broken
search link.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This patch adds the capability to include yaml files in other yaml
files that reside in dts/common/yaml.
Fixes#1149
Signed-off-by: Andy Gross <andy.gross@linaro.org>
Fix controller assert due to a bug introduced in commit
07270e52ba ("Bluetooth: controller: Coding style and
refactoring").
This reverts implementation to original way it was and the
calculation of the ticker expiry will now not overflow the
range of the RTC peripheral, which is a 24 bit counter.
Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
net_pkt_get_reserve_data ignores the timeout parameter when in isr,
using K_NO_WAIT instead, which can lead to invalid fragment.
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
While we're working on doc publishing that separates
kernel docs that are release-specific from project docs
that aren't, (temporarily) put the security documents
here so they'll be published with the 1.9 release.
Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
Normalizing variables names and make sure tag handling behavior, which
might be different among backends, does not make the test failing.
Also, improving debug logs in case of error.
Change-Id: Ic317948aab459bfa75c9a72ac48cb2d12a0d0706
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This exposes the CCM operations through generic Crypto API.
Change-Id: I09346e77bf8821c208305a7aa2805cf49cb42d71
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
If the encryption/decryption failed there is no need to procceed
further.
Change-Id: If450e40ed6fd601b698b74c56ae21fc7f903d087
Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
'pad' parameter controls whether crc16() should add padding at the end
of input bytes or not. This allows to compute CRC16 for data stored in
non-contiguous buffers where CRC value is calculated using subsequent
calls to crc16() with padding added only for last chunk.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
This patch fixes the size and address cells yaml generation. Due to
the leading #, the yaml generation incorrectly parses the property
name. Adding quotes around the property name fixes this.
Signed-off-by: Andy Gross <andy.gross@linaro.org>
Per LwM2M specification 5.3.1 Register, report "ct=11543" when JSON is
supported. Also, report the resource type as rt="oma.lwm2m" when "ct="
presents.
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
Per LwM2M specification 5.3.1 Register. When object instances are
available, object ID can be ignored in registration message
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
According to LwM2M specification 5.2.7.3 Bootstrap DISOCVER,
security object is only reported to the bootstrap server.
Correct the behavior to (1) report server object to the server
(2) do not report security object at registration time
Signed-off-by: Robert Chou <robert.ch.chou@acer.com>
Fix checks for BT_HCI_RAW and move default range after the other range
options, required by Kconfig to avoid overwriting other options.
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
This is how it's called in the main docs, so use this same phrase in
Kconfig and samples too.
Also, added some articles to docs.
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
data_addr is not guaranteed to be word-aligned so we need to read it in
a safe way, otherwise this can trigger hardfault on nRF51.
Signed-off-by: Andrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>
This reverts commit e1382cc7d6.
Due to restrictive simplelink host driver source licensing.
This also reverts commits based on the simplelink wifi host
driver:
Revert "ext: simplelink: host driver: depend on multithreading"
commit: 4d912b004b
Revert "ext: simplelink: Enable SimpleLink to use Zephyr __errno"
commit: 4e022f7b28
Revert "ext: simplelink: Add SimpleLink DPL porting layer to Zephyr"
commit: 4bc51e67d4
Revert "ext: simplelink: Enable build of the SimpleLink host driver."
commit: 2d2615a49a
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
The values returned by the controller are Identity Roots and not
Identity Resolving Key. To avoid confusion, and since IRK is commonly
associated with the latter, use "ir" instead.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
In order to allow for the controller to report the RSSI of a received
Scan Request, include the field inside the Scan Request Received
Vendor-Specific Event.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The RSSI value is an 8-bit signed integer. Since the Link Layer works
only with positive unsigned integers, translate into a negative number
at the HCI layer.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
The Vendor-Specific header file defines the commands and events used to
communicate with a Zephyr Vendor-Specific capable controller from a
Host. Translate the existing specification fully into the header file.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
Default BT_RX_BUF_COUNT value is not enough when transfering a large
amount of data (e.g. heavy network traffic over BT 6LoWPAN). Increase
BT_RX_BUF_COUNT from default value 3 to 10.
Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
Be sure to check for NULL pkt in receive callback, which means TCP
EOF. The fix ported from echo_server sample.
Jira: ZEP-2423
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
* apply STACK_GUARD_SIZE, no extra space will be added if
MPU_STACK_GUARD is disabled
* When ARC_STACK_CHECKING is enabled, MPU_STACK_GUARD will be
disabled
* add two new api: arc_core_mpu_default and arc_core_mpu_region
to configure mpu regions
* improve arc_core_mpu_enable and arc_core_mpu_disable
Signed-off-by: Wayne Ren <wei.ren@synopsys.com>