Commit Graph

2883 Commits (77637682a0d275100ac014f4ef41ddcef184901b)

Author SHA1 Message Date
Donatien Garnier 472d3de849 Give GenericGap access to the Security Manager's PAL 2018-05-14 13:36:02 +01:00
Donatien Garnier a3d9d6cebd Business logic for handling non-resolvable private addresses 2018-05-14 13:26:39 +01:00
Bartek Szatkowski 38df9306d7 Update wsf_types.h to support updated CMSIS 2018-05-14 12:18:21 +01:00
Yossi Levy 789eb04617 Changed trng loop condition 2018-05-14 14:07:57 +03:00
Yossi Levy 73d1c8df93 Fix of error macros 2018-05-14 13:52:20 +03:00
Qinghao Shi d48d3aff2b fix a bug in greentea-client
reset "LastChar" after "tok_close" received
fix the bug where greentea-client require a character input between K-V pairs
2018-05-14 11:41:14 +01:00
Hasnain Virk d270105fa8 LoRaWAN: Wrong type of message check
In the reception data path, we needed to check the MCPS CONFIRMATION type
not the MCPS INDICATION type. Indication message type is for downlink message type
which can be UNCONFIRMED even if we have sent a CONFIRMED one, e.g., an ACK.
2018-05-14 13:36:38 +03:00
Ron Eldor adbfdc1149 Remove SW fallback for CCM
Remove SW fallback for CCM mode, and return
`MBEDTLS_ERR_AES_FEATURE_UNAVAILABLE` when trying to set a key
which is not 128 bit size.
2018-05-14 13:15:57 +03:00
Ron Eldor ccaef16f6a Remove AES HW acceleration
Remove AES HW acceleration, as it is targeted future version
2018-05-14 13:15:57 +03:00
Ron Eldor 09d0d49efd Remove extra `mbedtls_zeroize` call
REmove additional unneded call to `mbedtls_zeroize()` which was added after rebase
2018-05-14 13:15:57 +03:00
Ron Eldor 069c5964ae Fix typo in Readme
Fix typo `DEBICE_CRYPTOCELL ` - > `DEVICE_CRYPTOCELL`
2018-05-14 13:15:57 +03:00
Ron Eldor 8f44cdff5d Resolve issues raised after rebasing
Remove `cc_rand.h` and duplicate check in `mbedtls_ecdsa_sign()`,
that were inserted after rebasing.
2018-05-14 13:15:57 +03:00
Ron Eldor 2b2aa0f94d Rephrase meaning of `MBEDTLS_CONFIG_HW_SUPPORT`
Rephrase the label, to make it more clearer.
2018-05-14 13:15:57 +03:00
Amanda Butler e68815e02b Copy edit changes to Readme.md
Copy edit changes, mostly for active voice and consistent tense.
2018-05-14 13:15:57 +03:00
Ron Eldor f07ff36f47 Rephrase explanation on `cc_platform_setup()`
Rephrase the explanation on `cc_platform_setup()`, since previous
explanation wasn't coherent.
2018-05-14 13:15:57 +03:00
Ron Eldor 55e7690593 Refactor Readme after comment from Tech Writer
Rephrase usage guideline on `objects.h` and explain usage of every label
in `targets.json`
2018-05-14 13:15:57 +03:00
Amanda Butler de2e4875fd Copy edit Readme.md
Copy edit file, mostly for minor grammar nits.
2018-05-14 13:15:57 +03:00
Ron Eldor 7cdfd91bf8 Add guidelines for porting CC310 on Mbed OS
Add guidelines for porting CC310 on a new platform
2018-05-14 13:15:57 +03:00
Ron Eldor 245977f3c4 Rename libraries to pass CI library name check
Rename the CC libraries, with additional prefix "lib*".
Fixes CI failure
2018-05-14 13:15:57 +03:00
Ron Eldor ca844fd47a port CC to IAR
1. Add the compiled CC libraries for IAR toolchain
2. modify `ssi_pal_compiler.h` to support IAR
2018-05-14 13:15:57 +03:00
Ron Eldor 56df468a54 Alternative ECDSA and ECDH support
Add support for Alternative ECDSA and ECDH, on the higher level,
over CC310. Note that CC generates ECC keys according to FIPS 186,
while mbed TLS generates according to RFC 6979 and RFC 4754,
which causes test vectors for curve p521 to fail
2018-05-14 13:15:57 +03:00
Ron Eldor 19e2adf98d HW Accelerated SHA1 and SHA256
Add Poritng for Sha1 and SHA256 over Cryptocell
2018-05-14 13:15:57 +03:00
Ron Eldor fdf5587e29 Add CCM alternative implementation
Add CCM HW accelerated alternative implementation
2018-05-14 13:15:57 +03:00
Ron Eldor b31aa03be9 Add the platfrom setup \ terminate support
Add support for Platfrom setup and termination for Cryptocell on Nrf52840
2018-05-14 13:15:57 +03:00
Ron Eldor 75087469f7 Add the Cryptocell library
Add the latest cryptocell library, and add support for CC310 lirary
on latest Mbed OS code
2018-05-14 13:15:27 +03:00
paul-szczepanek-arm 579cb5e222 avoid setting flags twice 2018-05-14 10:26:44 +01:00
paul-szczepanek-arm f4f3a3c697 store ltk and csrk but not irk sent status
and missing asserts
2018-05-14 09:52:49 +01:00
Ari Parkkila 287a1a86d0 Cellular: AT handler review fixes 2018-05-14 10:25:00 +03:00
Ari Parkkila 3bdb6d1737 Cellular: Fixed ATHandler write poll timeout 2018-05-14 10:25:00 +03:00
Ari Parkkila 9b896a16bb Cellular: ATHandler yield to wait review fixes 2018-05-14 10:25:00 +03:00
Ari Parkkila 559abd3009 Cellular: AT requests are to be processed within time period 2018-05-14 10:24:59 +03:00
Ari Parkkila 98ef516061 Cellular: Changed ATHandler yield to wait 2018-05-14 10:23:06 +03:00
paul-szczepanek-arm a7f8d54761 more doxygen 2018-05-13 23:54:44 +01:00
paul-szczepanek-arm d3524e2407 doxygen 2018-05-13 23:49:44 +01:00
paul-szczepanek-arm 8f90875cd6 reset entry now remove old keys 2018-05-13 23:49:27 +01:00
paul-szczepanek-arm 23c6a69d66 key dist flags only in db now and not in control block of sec manager 2018-05-13 23:26:34 +01:00
Donatien Garnier 69e35c49c8 Handle resolution policy for peripheral in GenericGap 2018-05-13 23:25:52 +01:00
paul-szczepanek-arm ab117737fa write back counter, sync entry by hand;e 2018-05-13 22:55:47 +01:00
Donatien Garnier 21471bb3c9 and make sure it compiles and that policy is only applied if privacy is enabled :) 2018-05-13 22:42:11 +01:00
Donatien Garnier 926efa4018 Filter out advertising reports for unresolved addresses if required 2018-05-13 22:37:59 +01:00
Donatien Garnier 6a2ffaeac0 Update own address type generation in GenericGap 2018-05-13 22:16:08 +01:00
Donatien Garnier 620ebc3f9a Some fixes in GenericGap 2018-05-13 20:38:29 +01:00
Donatien Garnier 2509a88d58 Revert set_privacy() in Cordio GAP PAL impl 2018-05-13 20:37:14 +01:00
Donatien Garnier 1a623e6670 Added method to enable/disable privacy in GAP Pal with Cordio impl 2018-05-13 19:15:20 +01:00
Donatien Garnier 4c5e2a8094 Added method to update resolution settings in GenericGap 2018-05-13 19:14:56 +01:00
Donatien Garnier cf03d40909 Doc fix in PalGap.h 2018-05-13 18:54:11 +01:00
Donatien Garnier 5734fca195 Added set_address_resolution method in GAP Pal with Cordio implementation 2018-05-13 18:53:23 +01:00
Donatien Garnier 7b4a813aca Added stubs in GenericGap for privacy configuration methods 2018-05-13 18:52:54 +01:00
Donatien Garnier e9ad148db0 Added privacy-related methods overrides in GenericGap 2018-05-13 17:57:27 +01:00
Donatien Garnier 33c46f5658 Remove LL resolving 'shorcut' when adding a device to resolving list - this should be controlled by the GAP layer 2018-05-13 17:49:00 +01:00
Cruz Monrreal 2104d8ab5b
Merge pull request #6711 from marcuschangarm/cleanup-nrf5x
Cleanup TARGET_NRF5 and TARGET_NRF5x
2018-05-11 19:15:05 -05:00
paul-szczepanek-arm 3af4d0b50f get identity list function argument needs to have its own memory allocated 2018-05-11 19:52:12 +01:00
paul-szczepanek-arm a63f38e767 moved logic to security db and left storage in memory and file dbs
db created at init now
2018-05-11 19:41:33 +01:00
Donatien Garnier 40b6813dcf Fix wrong use of DmLlPrivEnabled() 2018-05-11 18:52:27 +01:00
Donatien Garnier 71bd30daf3 More inline doc 2018-05-11 18:37:02 +01:00
Donatien Garnier bcfbeb7f1a Some doc adjustments 2018-05-11 18:23:37 +01:00
Donatien Garnier 3ca3c2db2c Initial implementation of the Security Manager's Privacy feature for Cordio 2018-05-11 18:20:39 +01:00
Antti Yli-Tokola 511df14eb0 Update mbed-coap to version 4.4.3
Fixes error: IOTCLT-2506 [GitHub] Cannot set registration time if server does not use max age option
Improvements; Extend blockwise message transfer status to have states for sending as well.

NOTE! These are internal changes required for cloud client. This has no direct relevance to any mbed-os functionality.
2018-05-11 17:14:09 +03:00
Kevin Bracey ec2db62fe5 lwIP: Enable TCP out-of-order processing
Our config file for lwIP had TCP_QUEUE_OOSEQ disabled - this can
cause significant performance problems, as observed during testing.

One lost packet can lock an input stream into a mode where the
transmitter keeps thinking packets are being lost, so keeps slowing
down. This caused test failures - a transfer that would normally
take 10s hit a 60s timeout.

Turning this on increases code size, but doesn't significantly increase
static memory use. The memory used for out-of-order packets comes from
the same pbuf pool as for outgoing TCP segments, so there is contention
when running bidirectionally.

Out-of-order processing is on by default for lwIP - this seems to be
another example of us excessively paring it back.
2018-05-11 17:12:00 +03:00
paul-szczepanek-arm 678d494c5a init _db pointer 2018-05-11 10:20:04 +01:00
paul-szczepanek-arm afa4bdcf1a pull common logic into secure db 2018-05-11 10:19:48 +01:00
Juhani Puurula 7c38f19745 Merge commit 'd6732a1b96814a2ea635b3d517f498127843a097'
* commit 'd6732a1b96814a2ea635b3d517f498127843a097':
  Squashed 'features/frameworks/nanostack-libservice/' changes from 09056ed..ddd45db
2018-05-11 09:59:29 +03:00
Juhani Puurula 690a4c7f09 Merge commit '7a58eaec9d5f2aad89caf3cdb47346d2ff648492'
* commit '7a58eaec9d5f2aad89caf3cdb47346d2ff648492':
  Squashed 'features/frameworks/mbed-trace/' changes from 6d3590f..6df2572
2018-05-11 09:55:48 +03:00
Juhani Puurula f7fd0af47e Merge commit '4cb7e03c7b39f446cfddc46385b00600e0e702f9'
* commit '4cb7e03c7b39f446cfddc46385b00600e0e702f9':
  Squashed 'features/nanostack/coap-service/' changes from f40072f..36d36ce
2018-05-11 09:52:34 +03:00
Juhani Puurula 2f0bd6b6f6 Merge commit '8e546a301f0b93dab28e7b4454df97e5f9e83843'
* commit '8e546a301f0b93dab28e7b4454df97e5f9e83843':
  Squashed 'features/nanostack/sal-stack-nanostack/' changes from 43c7ec2..82bbdcc
2018-05-11 09:52:10 +03:00
Kimmo Vaisanen 9915478645 Lora: Fix battery_level callback
Application can give battery_level callback method what Lora stack
uses to query battery level for DevStatusReq MAC command response.
The problem was that this callback was never called.

This commit fixes this problem and if application does not set
battery_level callback at all, value 255 (= The end-device was not able to
measure the battery level.) will be returned to lora gateway.
2018-05-11 09:50:24 +03:00
Krzysztof Stachowiak 4f9c6ba300 Update the version in the importing makefile 2018-05-10 17:49:33 +02:00
Vincent Coubard 40a403e99b Merge branch 'security-manager-dev' of https://github.com/paul-szczepanek-arm/mbed-os into fix-encryption-rejection 2018-05-10 12:05:36 +01:00
paul-szczepanek-arm 473482d204 move securitydb into generic 2018-05-10 11:08:31 +01:00
Cruz Monrreal c97a8fb216
Merge pull request #6817 from pan-/fix-crypto_toolbox_f4-parameter-types
GenericSecurityManager: Fix crypto_toolbox_f4 signature.
2018-05-09 11:33:27 -05:00
Cruz Monrreal e33fb60c3d
Merge pull request #6849 from scartmell-arm/bug-critical-section-nordic
Add missing semicolon to NRF51 critical_section implementation
2018-05-09 11:33:10 -05:00
Krzysztof Stachowiak 5317e872db Update Mbed TLS to version 2.9.0 2018-05-09 18:09:13 +02:00
Martin Kojtal b5a8ace79a
Merge pull request #6808 from hasnainvirk/state_machine_work
LoRa: State machine work
2018-05-09 16:02:53 +01:00
paul-szczepanek-arm b95da8d8c4 remove crypto when missing ECDH 2018-05-09 12:27:43 +01:00
Paul Szczepanek fee986750d
fix case 2018-05-09 12:19:35 +01:00
Paul Szczepanek b4d7bb6020
fix case 2018-05-09 12:19:27 +01:00
Paul Szczepanek 37b11d8ac5
fix case 2018-05-09 12:18:55 +01:00
Paul Szczepanek 367fe345ba
fix case 2018-05-09 12:18:42 +01:00
Paul Szczepanek 79b3bc4fce
fix case 2018-05-09 12:18:26 +01:00
paul-szczepanek-arm b98ffa48da fix uppercase X in nrf5x 2018-05-09 12:16:26 +01:00
paul-szczepanek-arm 6a26a8a6c8 Merge branch 'security-manager-dev' of https://github.com/paul-szczepanek-arm/mbed-os into security-manager-dev 2018-05-09 11:37:41 +01:00
paul-szczepanek-arm c02b318436 fixed case in filename 2018-05-09 11:37:33 +01:00
Paul Szczepanek 2b02148ab6
Merge branch 'master' into security-manager-dev 2018-05-09 11:23:28 +01:00
paul-szczepanek-arm b8fe37a00e disable ECDH if the platform doesn't support it
otherwise you get linker errors
2018-05-09 11:01:10 +01:00
Steven Cartmell 1dfea4168f Add missing semicolon to NRF51 critical_section implementation 2018-05-09 10:54:26 +01:00
Yossi Levy 9df32d1f00 Fix README.md grammar mistakes 2018-05-09 11:22:15 +03:00
Marcus Chang 1aebdcbee5 Reorganize TARGET_MCU_NRF51822_UNIFIED directories
The unified NRF51 target and feature BLE directories have been
reorganized to follow the naming and directory structure of the
NRF52 implementation.

This reorganization does not include TARGET_MCU_NRF51822 and
derived targets.
2018-05-08 10:10:01 -07:00
Paul Szczepanek 9a0a0865a6
Merge branch 'security-manager-dev' into sm-privacy-nordic 2018-05-08 18:01:41 +01:00
Paul Szczepanek 214656a9ee
fix case in #include 2018-05-08 17:56:38 +01:00
Paul Szczepanek 1a35f3e217
fixed case in name 2018-05-08 17:49:22 +01:00
Cruz Monrreal adcd7ec002
Merge pull request #6742 from pan-/ble-update-cordio-porting-guide
BLE: Update cordio porting guide
2018-05-08 10:42:19 -05:00
Cruz Monrreal 5b5c8ddb4e
Merge pull request #6743 from pan-/ble-cordio-h4-conditionnal-to-fc
BLE: Conditional compilation of H4 driver
2018-05-08 10:41:58 -05:00
Cruz Monrreal a5326ca047
Merge pull request #6814 from pan-/fix-discovery-termination
GenericGattClient: Fix discovery termination.
2018-05-08 10:41:34 -05:00
Yossi Levy 98e83c2262 Implementing KDF in Counter Mode for key derivation function. Moving device key to features 2018-05-08 16:59:05 +03:00
Hasnain Virk be04a57ecf Removing abort from rx in case of FL discrepency
If the frame length is not what we are expecting, it is
found to be a good practise to actually continue with what we
have received rather than aborting. As we have already demodulated
the packet and RX slots are used up, ther is not so much benefit in
dropping that packet.
2018-05-08 16:45:27 +03:00
Hasnain Virk ac6fb71c90 Datarate bug fix in rx windows configs
While configuring RX parameters for the radio, we need to feed in
rx windows 1 and 2 parameters which are computed when we do the transmission.
We are actually setting the physical value of the data rate rather than
data rate table index and the expectation was to set the data rate index.
2018-05-08 16:45:26 +03:00
Hasnain Virk cc09e44cfb Moving msg flags to lorawan_types.h
Message flags are used in the application so the logical place for
them is in lorawan_types.h and not in lorawan_data_structures.h
2018-05-08 16:45:26 +03:00
Hasnain Virk 1a0d90555e Doc fix
Structure naming in the docs was wrong.
2018-05-08 16:45:25 +03:00
Hasnain Virk f63ed86cfc Adding custom channel plan support in AS923
The asia pacific region supports custom channel planning and
downlink channel request. By virtue of a mistake, this information
was missing and hence a custom channel support was not working.
Fixes issue #6783.
2018-05-08 16:45:25 +03:00
Hasnain Virk 9f36baab1b State Machine rework
There had been essentially two state machines running in our stack
which was too cumbersome and was not alligned in any symmetry.

In this work we make sure that:
 * There are no callbacks from the MAC layer to Stack controller layer.
 * Primitives are made local to the mac layer and are presented as
   read-only to the stack controller layer.
 * Interrupt handling and processing is moved to the stack controller layer.
 * Reception is divided into smaller units, seperating handling of Join Accept
   and normal data frames. MIC gets its own unit.
 * Extraction of data and MAC commands from the payload is also being done now in
   its own method.
 * To ensure integrity of the stack, and sanctity of the radio payload, we copy the
   radio payload buffer immediately in the rx interrupt and hoist a flag that prevents
   another interrupt from happening for a short while when we are processing the previous
   packet.
 * If an automatic uplink is on going, we do not send a TX_DONE event to application
   anymore as that is logically incorrect.
 * state_controller() is the central engine for the state machine. To save code space and
   memory, we are not handling each and every state in the state_controller(). Some of the states
   which have no processing to be done, are explicitely set.
 * For all the states who need special processing, seperate methods are added.
 * Class A always run to completion to IDLE and CLass C always runs to completion as RECEIVING.
2018-05-08 16:45:18 +03:00
Hasnain Virk a75af9799e Adding thread safety
Making our LoRaWAN stack thread safe. If RTOS is not present, locks
don't do anything. ScopedLock is used to automate the lock release on
context expiry.
2018-05-08 16:24:34 +03:00
Hasnain Virk a331c4b59a Immutable payload pointer in LoRaPHY 2018-05-08 16:24:34 +03:00
Hasnain Virk 73e433e4e5 Immutable payload pointer to LoRaMacCommand class 2018-05-08 16:24:34 +03:00
Hasnain Virk 0be41f0e69 Remove useless extraction
Channel plan datastructure already contains channel parameters.
Extraction is not needed.
2018-05-08 16:24:34 +03:00
Hasnain Virk bec61cea27 Initializing band for default channels
We went through an exercise of adding band information to
any new channel being added. Default channels were looked over.
This commits duly adds missing band information to default channels.
2018-05-08 16:24:34 +03:00
Hasnain Virk e5e8e79a7a Immutable Payload from radio
Received data buffer from radio driver should be immutable.
2018-05-08 16:24:34 +03:00
David Saada c3e39996b1 Implement FlashSimBlockDevice - flash simulated block device adaptor 2018-05-08 16:15:25 +03:00
Kimmo Vaisanen d200600fc0 Lora: fix AU915 build
There was a typo in the code making it fail to compile.
2018-05-08 14:09:03 +03:00
Cruz Monrreal 11901f115b
Merge pull request #6800 from kivaisan/fix_loracrypto_asserts
Lora: Fix LoRaMacCrypto asserts
2018-05-07 19:34:56 -05:00
Cruz Monrreal 5038135c7d
Merge pull request #6577 from SeppoTakalo/remove_features
Get rid of FEATURE_COMMON_PAL and FEATURE_NANOSTACK
2018-05-07 10:44:50 -05:00
Cruz Monrreal 7a1ab1890b
Merge pull request #6792 from jarvte/cellular_dynamic_alloc_and_destr
Cellular: Add dynamic alloc and destruction to easycellular
2018-05-07 10:28:43 -05:00
Vincent Coubard 565921608e Cordio: Improve cordio H4 driver.
Ommit H4 driver definition if serial flow control is not supported.
2018-05-04 16:36:05 +01:00
Vincent Coubard 34c9206054 BLE: update cordio porting guide.
Improve description of the requirements of the H4 driver.
2018-05-04 16:35:57 +01:00
Vincent Coubard 3f9186faa2 GenericSecurityManager: Fix crypto_toolbox_f4 signature.
The type exposed in the header file were not aligned to the one used in
the implementation: ble::public_key_t instead of ble::public_key_coord_t.
2018-05-04 12:11:34 +01:00
Vincent Coubard fd5903c22d GenericGattClient: Fix discovery termination.
The procedure should be terminated whenever the server returns an error not equal
to ATTRIBUTE_NOT_FOUND. The block was effectivelly terminated but the
procedure was not. As a result the discovery was operating on already
freed memory.
2018-05-04 11:30:58 +01:00
Martin Kojtal f09ab67af2
Merge pull request #6740 from kivaisan/fix_max_tx_power
Lora: Fix max tx power check
2018-05-03 16:28:55 +01:00
Martin Kojtal 1a5a2f0134
Merge pull request #6774 from geky/littlefs-fix-trailing-dots
littlefs: Fix issue with trailing dots in file paths
2018-05-03 16:26:47 +01:00
Martin Kojtal 2729c7aa23
Merge pull request #6780 from bmcdonnell-ionx/fix-lwip-compiler-warning
resolve LWIP compiler warning
2018-05-03 16:24:31 +01:00
Kimmo Vaisanen 5384cd6b63 Lora: Fix LoRaMacCrypto asserts
If Lora stack is built with incorrect mbedtls settings, crypto methods
should assert and return error value. This fixes MBED_ASSERTs to
work correctly.
2018-05-03 13:04:03 +03:00
Teppo Järvelin b22a16fe4a Cellular: Added dynamic alloc and destruction to easycellular.
Now application can call connect and disconnect multiple times and resources are freed and constructed properly.
Also whole easycellular can be deleted and constructed again.
2018-05-03 12:47:47 +03:00
Vincent Coubard b5e8d4eacb Merge branch 'security-manager-dev' of https://github.com/paul-szczepanek-arm/mbed-os into fix-encryption-rejection 2018-05-03 09:26:36 +01:00
Martin Kojtal 16ab71864e
Merge pull request #6765 from mirelachirica/at_handler_read_fix
Cellular: Fix AT Handler compile warning
2018-05-03 07:41:23 +01:00
Vincent Coubard 0a59e00b23 Nordic BLE: Update GATT server security management
This patch refines permission applied to characteristic and descriptors; instead of a single level of permission , each characteristic receives a permission for the read operation, one for the write operation and another one for the update operation.

As a consequence, updates are not sent if the link does not cover the update permission requirement.

Descriptors also benefits individually from read and write permission.
2018-05-02 19:15:24 +01:00
Vincent Coubard 4f1e574eff Cordio GattServer: Fix uses of designated initializer.
These are not legal in C++ code.
2018-05-02 18:14:54 +01:00
Vincent Coubard 7e043ead96 Nordic BLE: Add stub implementation of remove_peer_csrk in security manager. 2018-05-02 17:52:39 +01:00
Vincent Coubard 4e5639f5ca BLE: Support encryption with secure connection key. 2018-05-02 17:51:48 +01:00
Donatien Garnier ba0f18c9ab Fix casing in MemorySecurityDb.h 2018-05-02 17:39:10 +01:00
Brendan McDonnell 33a2116042 reduce variable scope 2018-05-02 11:17:25 -04:00
Brendan McDonnell ba29bd9315 use separate variable to resolve compiler warning 2018-05-02 09:33:24 -04:00
Vincent Coubard f79eeb0173 Cordio: Update stack and pal to support LE security mode 2 level 2. 2018-05-02 14:32:38 +01:00
Vincent Coubard 01e3a004a6 Cordio: register server authorization callback. 2018-05-01 12:29:03 +01:00
Vincent Coubard 549a513dfb Cordio: Enable client and server signing 2018-05-01 12:28:37 +01:00
Vincent Coubard d0c4d7a8a3 Cordio: Forward server related events to CordioGattServer 2018-05-01 12:27:49 +01:00
Vincent Coubard 0f64b1c988 CordioGattServer: Global refactoring
The registration process has been breaked down into several functions that register the service attribute, characteristic declaration attributes, characteristic value attributes and characteristic descriptors.

Service registration now consider all characteristics permissions: read, write and update. Permissions are also considered when updates needs to be propagated to peers.

Handling of user authorization is also a change introduced by this refactoring.
2018-05-01 12:26:24 +01:00
Vincent Coubard 55eb7033b2 Generic Security Manager: Set csrk to stored when the peer csrk has been received. 2018-05-01 11:54:25 +01:00
Vincent Coubard 41a3442474 Generic Security Manager: Set ltk to stored when the peer ltk has been recveived. 2018-05-01 11:54:03 +01:00
Vincent Coubard f90eacfd27 Generic Security Manager: remove peer csrk at disconnection 2018-05-01 11:53:18 +01:00
Vincent Coubard 1ac95e105b ble - Generic Security Manager: set signing unconditionnal to role reversal.
A peripheral can act as a GATT client whether it is in the peripheral role or the central role therefore it doesn't make sense to enable signing only if roles will be reversed latter.
2018-05-01 11:50:59 +01:00
Vincent Coubard 9880db7543 Generic Security Manager: Improve formating 2018-05-01 11:48:22 +01:00
Vincent Coubard 2e3c7e8ab7 Generic Security Manager: Set LinkKey to false unconditionally.
This key distribution flags is for dual mode devices; mbed does not support BR/EDR.
2018-05-01 11:45:24 +01:00
Vincent Coubard e39bb4b92c BLE - GenericGattClient: Exploit ENCRYPTED_WITH_SC_AND_MITM encryption.
IF link is encrypted, authenticated or authenticated with lesc then signed write must be transformed into regular write commands.
2018-05-01 11:38:30 +01:00
Vincent Coubard 2da6fa3947 Cordio PAL security manager: Copy locally own CSRK
The stack does not copy csrk when DmSecSetLocalCsrk is invoked; it just retains a pointer to it. Therefore a copy is kept inside the pal.
2018-05-01 11:35:16 +01:00
Vincent Coubard e4813f4fe9 Cordio PAL Security Manager: Copy locally own IRK.
The IRK needs to be stored somewhere as it is not copied inside the stack, the stack just keeps a reference to it.
2018-05-01 11:33:36 +01:00
Vincent Coubard 2924bb4c86 Cordio PAL ATT Client: initialize the local sign counter to 0. 2018-05-01 11:29:45 +01:00
Vincent Coubard 74bc214961 BLE - Security Manager PAL: Add a function to remove the peer csrk.
If the the upper layer has registered a peer csrk on the pal security manager then it must remove it once the connection is closed.

This API allows the upper layer to remove the peer csrk registered earlier.
2018-05-01 11:27:38 +01:00
Vincent Coubard 1e277bad50 BLE: Lookup for non identity addresses when a secure entry is opened.
A peer may not share a valid IRK and identity address during pairing (in that case the identity address received is all zeros). When this happens, the entry must be retrieved by looking at the address used by the peer during the connection.
2018-05-01 11:24:44 +01:00
Vincent Coubard c4b78ada0e BLE: Set default mac address to 00:00:00:00:00:00
Both mac addresses are invalid but the bluetooth specification prefers to use all 0 addresses to represent an invalid address.
2018-05-01 11:17:47 +01:00
Vincent Coubard 80941af0f6 BLE: Add : LESC authenticated encryption to the list of possible link encryption. 2018-05-01 11:16:41 +01:00
Cruz Monrreal 4e66f218fd
Merge pull request #6700 from geky/mbr-add-partition-asserts
mbr: Added assertions for overlapping partitions
2018-04-30 11:59:44 -05:00
Cruz Monrreal 46379d8438
Merge pull request #6741 from kivaisan/refactor_maccommand
Lora: Split add_mac_command() into separate methods
2018-04-30 11:58:33 -05:00
Cruz Monrreal 4ca512d755
Merge pull request #6750 from hasnainvirk/mem_corruption_fix
LoRaWAN: Memory corruption due to band mishandling
2018-04-30 11:43:39 -05:00
Mirela Chirica d4d339129a Cellular: Refactor hex reading to prevent illegal cast 2018-04-30 13:25:15 +03:00
Christopher Haster b56bdf18cd littlefs: Fixed issue with trailing dots in file paths
Paths such as the following were causing issues:
/tea/hottea/.
/tea/hottea/..

Unfortunately the existing structure for path lookup didn't make it very
easy to introduce proper handling in this case without duplicating the
entire skip logic for paths. So the lfs_dir_find function had to be
restructured a bit.

One odd side-effect of this is that now lfs_dir_find includes the
initial fetch operation. This kinda breaks the fetch -> op pattern of
the dir functions, but does come with a nice code size reduction.
2018-04-30 03:42:53 -05:00
Seppo Takalo f69531e82f Move EFR32 RF driver to TARGET_Silicon_Labs/TARGET_SL_RAIL
This folder structure is identical to where the target code
is found from targets directory.
2018-04-27 14:38:44 +03:00
Seppo Takalo f0bf771502 Get rid of FEATURE_NANOSTACK
Allow FEATURE_NANOSTACK still to be defined in the build so
that we don't break any builds.
2018-04-27 14:38:44 +03:00
Seppo Takalo d1c6bc0913 Get rid of FEATURE_COMMON_PAL
Nanostack related files moved under 'feature/nanostack'
Common libraries moved to 'features/frameworks'

Allow FEATURE_COMMON_PAL still to be defined in the build so
that we don't break any builds.
2018-04-27 14:38:43 +03:00
Mirela Chirica a0cc22ebba Cellular: Fix AT Handler compile warning 2018-04-27 14:38:14 +03:00
Cruz Monrreal 380973aa9a
Merge pull request #6691 from mirelachirica/cellular_fixes
Cellular fixes
2018-04-26 20:19:58 -05:00
Cruz Monrreal a19a528b65
Merge pull request #6745 from SeppoTakalo/mesh_docs
Clarify mesh configuration values.
2018-04-26 20:16:40 -05:00
Vincent Coubard db565d38b3 BLE: remove useless flags in GattCharacteristic. 2018-04-26 19:00:43 +01:00
Vincent Coubard 486a3e020c BLE: Add fine grained security to GattCharacteristic.
This patch adds independent management of security requirement for read, write and update operatiosn of a GattCharacteristic.

Requirements are defined after ble::att_security_requirement_t that maps LE security mode 1 and LE security mode 2.

The functions requireSecurity and getRequiredSecurity are deprecated as SecurityManager::ScurityMode_t does not map well with LE security modes.
2018-04-26 18:55:42 +01:00
Vincent Coubard 1c18351885 BLE: Remove unwanted documentation block of GattCharacteristic. 2018-04-26 17:29:29 +01:00
Vincent Coubard 9258b9ddb6 BLE: Add security requement support into GattAttribute. 2018-04-26 17:26:15 +01:00
Vincent Coubard 7afd01d84d BLE: Add type describing ATT security requirements. 2018-04-26 17:22:21 +01:00
Vincent Coubard 27d36ba820 BLE: Add missing relational operator to SafeEnum. 2018-04-26 17:07:54 +01:00
Hasnain Virk a6a1cee988 LoRaWAN: Memory corruption due to band mishandling
band_t structure in phy parameters was not being filled in properly
and we were spilling over the array boundary for bands.
In addition to that two utility functions are added to perform safety
checking taking in the frequency and filling out band information plus
boundry value checks.
2018-04-26 13:23:47 +03:00
Seppo Takalo b60454fac5 Clarify mesh configuration values.
Most of the help fields were correct. Just add field specifying
acceptable ranges.
2018-04-25 15:33:40 +03:00
Martin Kojtal 5ee2658dae
Merge pull request #6701 from SiliconLabs/feature/update-rail
Update to EFR32 15.4 driver
2018-04-25 13:17:33 +01:00
Vincent Coubard 2c8b9ab3dc BLE: Remove example section from cordio porting guide.
This section is not applicable in the public version of mbed-os.
2018-04-25 12:15:28 +01:00
Mirela Chirica c0629c8d11 Cellular: Remove unnecessary NULL assignment 2018-04-25 14:09:20 +03:00
Mirela Chirica 042586938d Cellular: Common routine for string and hexstring reading 2018-04-25 14:09:20 +03:00
Mirela Chirica b48238997d Cellular: BC95 update max packet size 2018-04-25 14:09:19 +03:00
Mirela Chirica 1998173ede Cellular: Added read hex string support to AT handler 2018-04-25 14:09:19 +03:00
Mirela Chirica 928082b64b Cellular: Fix greentea sendto test to clear socket event flags 2018-04-25 14:09:19 +03:00
Mirela Chirica 7e684cd789 Cellular: Destructor added for CellularList 2018-04-25 14:09:19 +03:00
Mirela Chirica 658358cbf1 Cellular: BG96 remove IPv6 stack support 2018-04-25 14:09:19 +03:00
Vincent Coubard 6bb80317f8 BLE: Update cordio porting guide
Remove the section "Include prebuilt libraries" as it is not applicable
anymore.
2018-04-25 11:48:23 +01:00
Kimmo Vaisanen e9eb32b3ab Lora: Fix max tx power check
In LoRa TX power value 0 means the maximum allowed TX power and values >0
are limiting the allowed TX power to lower.

tx_config was incorrectly checking the power level and causing the maximum
TX power to be always used. Lora gateway can request node to use lower TX
power with LinkAdrReq MAC command.
2018-04-25 11:59:19 +03:00
Martin Kojtal d768b6f468
Merge pull request #6677 from jarvte/cellular_fsm_crash_bug
Cellular: fixed null pointer bug in cellular fsm
2018-04-25 08:24:49 +01:00
Kimmo Vaisanen e7f01e3ccc Lora: Split add_mac_command() into separate methods
In order to have smaller and better testable methods, instead of having a big
switch-case -style add_mac_command(), each MAC command is now separated to an
own method.
2018-04-25 08:42:02 +03:00
Cruz Monrreal 4c973e3aa0
Merge pull request #6702 from AriParkkila/single-stack
Cellular: Fix to prefer IPv6 single stack with fallback to IPv4
2018-04-24 12:16:34 -05:00
Cruz Monrreal 0e86fa2529
Merge pull request #6692 from kivaisan/remove_singleton
Lora: Remove singleton pattern
2018-04-24 12:14:05 -05:00
Cruz Monrreal 35bd8b9de1
Merge pull request #6682 from jarvte/fix_cellular_unittests
Fixed cellular unittests
2018-04-23 10:57:50 -05:00
Ari Parkkila b37532addf Cellular: Fix to prefer IPv6 single stack with fallback to IPv4 2018-04-23 09:57:23 +03:00
Steven Cooreman c0ee42a6e7 Update to EFR32 15.4 driver
* Updates driver library to v2.3.1 (2018q1) for bugfixes and convenience functions
* Provides library in correct format (2-byte wchar_t flag) for compiling with ARMCC (#6695 uncovered by #6577)
* Reverts to using a statically-allocated packet buffer since malloc is not thread-safe (and the asserts have been turned on)
2018-04-22 23:23:02 -05:00
Christopher Haster a97a47978a mbr: Added assertions for overlapping partitions 2018-04-22 08:28:06 -05:00
Vincent Coubard b0d5ba33bb BLE: return an error when application tries to turn down encryption. 2018-04-20 15:49:14 +01:00
Vincent Coubard 6a90232b6b BLE: Update cordio stack binaries.
The new build contains a fix related to permission verification of
characteristic that requires signed write.
2018-04-20 14:57:14 +01:00
Kimmo Vaisanen 2b2ce300ea Lora: Remove singleton construction of LoRaWANStack
After changing LoRaMacCrypto as C++ class, we no longer have static variables
in LoRa implementation. Therefore singleton pattern can be removed.
2018-04-20 16:01:55 +03:00
Kimmo Vaisanen b933cc6aeb Lora: Change LoRaCrypto to a C++ class
In order to get rid of static variables, LoRaCrypto functionality is now
in a C++ class.
2018-04-20 16:01:49 +03:00
Vincent Coubard cbb33ea938 BLE: Add comments to GenericSecurityManager::on_identity_list_retrieved. 2018-04-20 10:22:56 +01:00
Vincent Coubard 0b92397840 BLE: Fix flag IRK stored in Memory security DB. 2018-04-20 10:22:13 +01:00
paul-szczepanek-arm d1f3e4fd27 don't require master sends keys for signing key 2018-04-20 09:33:54 +01:00
Donatien Garnier f9b371fc0f Handle required BLE5 softdevice commands 2018-04-19 09:40:41 -07:00
Donatien Garnier aeab2ecbbf Fix potential race condition in nRF5xn.cpp 2018-04-19 09:40:41 -07:00
Marcus Chang 97426d63e9 NRF52 BLE: Fix GCC C++11 include error
Change <memory> include to <new>

From: d001fb1c66
2018-04-19 09:40:41 -07:00
Donatien Garnier 64baf717e8 Upgrade NRF52 BLE API to version 5
* Add NRF_SD_BLE_API_VERSION=5 macro to MCU_NRF52832 target
* Added initial Softdevice v5 API support for nRF5XPalGattClient.cpp
* Added initial Softdevice v5 API support for nRF5xGap.h
* Added initial Softdevice v5 API support for nRF5xGattServer.cpp
* Make sure the ah() hash function used by the security manager is declared with C linkage
* Removed 'ARM porting pending' checks in Nordic SDK
* Added BLE configuration to mbed_lib.json for NRF52x targets
* Migrated APIs and events model for Nordic SDK14.2 & SD API v5 in btle.cpp; adopted polling dispatch model
* Migrated APIs and events model for Nordic SDK14.2 & SD API v5 in nRF5xn.cpp
* Migrated APIs and events model for Nordic SDK14.2 & SD API v5 in nRF5xGap.cpp
* Added const qualifier to hwCallbacks's p_ble_evt parameter in nRF5xGattServer
* Add workaround to enable Radio Notification module from Nordic SDK
  * Disabled SWI1 interrupt manually from SWI driver module
    * Added missing include directive for "nrf_nvic.h" in ble_radio_notification.c
* Set correct number of custom UUIDs
* Adjust Softdevice RAM requirements for NRF52832/S132
  * RAM settings for the application were adjusted as follow:
    * Start: 0x20003800
    * Size: 0xC800
* Adjust Softdevice RAM requirements for NRF52840/S140
  * RAM settings for the application were adjusted as follow:
    * Start: 0x20003700 (was 0x20003000)
    * Size: 0xC900
* Added 3dBm as a permitted TX Power value for NRF52832
* Fix address type recovery in GAP
* Return min non-connectable adv interval compatible with infrastrcture's expectations
* Moved BLE driver from TARGET_SDK_14_2/FEATURE_BLE to TARGET_SDK_14_2/TARGET_SOFTDEVICE_COMMON/ble
2018-04-19 09:40:41 -07:00
Martin Kojtal 951e70f36f
Merge pull request #6604 from geky/lfs-fix-lookahead-trust
littlefs: Fix some issues with lookahead trust
2018-04-19 17:27:19 +02:00
Martin Kojtal 13913c7301
Merge pull request #6628 from kivaisan/mlme_indication_and_auto_uplink_config
Lora: Make automatic uplink message configurable
2018-04-19 17:25:33 +02:00
Martin Kojtal 7f98f5b796
Merge pull request #6652 from jarvte/update_doxygen_for_deprecated_apis
Cellular: Updated doxygen for deprecated API's.
2018-04-19 17:23:53 +02:00
Martin Kojtal a37ba4b3ab
Merge pull request #6614 from pauluap/compiler_warning_macro_expression
Macro expansion leads to a bare expression
2018-04-19 17:22:52 +02:00
Teppo Järvelin 6a2eefba9c Cellular: fixed null pointer bug.
Null pointer could have been called after stop() in cellular state machine.
2018-04-19 14:30:33 +03:00
Martin Kojtal cbb10335b4
Merge pull request #6663 from kjbracey-arm/nshal-static-removal
Use SingletonPtr in Nanostack HAL
2018-04-19 12:43:08 +02:00
Teppo Järvelin 025e0dfc49 Cellular: moved one function in cellularnetwork to public as it was accidently set as protected. 2018-04-19 13:40:33 +03:00
Teppo Järvelin 5ebdb439af Cellular: fixed cellular unit tests and one bug which was found while fixing. 2018-04-19 13:35:53 +03:00
Martin Kojtal 9cc4302c51
Merge pull request #6629 from jarvte/add_select_plmn_to_cellularfsm
Cellular: add plmn for CellularConnectionFSM
2018-04-19 12:07:20 +02:00
Martin Kojtal 15cac12f7e
Merge pull request #6660 from marcuschangarm/fix-greentea
Enable flow control in Greentea
2018-04-19 09:25:31 +02:00
Martin Kojtal c0f0a8e61f
Merge pull request #6653 from kjbracey-arm/lwip-ticks
Stop lwIP using us_ticker
2018-04-18 14:17:54 +02:00
Paul Szczepanek a99a4b8593
Merge pull request #33 from pan-/fix-cordio-addresses-type
BLE: Handle new addresses type in GenericGap.
2018-04-18 11:34:13 +01:00
Teppo Järvelin 55f4360680 Cellular: review fixes to cellularfsm and cellularnetwork. 2018-04-18 12:35:38 +03:00
Kevin Bracey 123c182033 Use SingletonPtr in Nanostack HAL
Avoid static data/code overhead when Nanostack HAL isn't in use.
Preparation for removal of FEATURE_COMMON_PAL.
2018-04-18 10:40:56 +03:00
Kimmo Vaisanen d336ceeee8 Lora: Make automatic uplink message configurable
Currently lora stack will automatically send an empty uplink message to lora gateway in case of:
- Node received message with pending bit set.
- Node received MAC command which requires instant response (sticky MAC command)
- Node received confirmed message in class C mode

This commit makes this configurable via config item

        "automatic-uplink-message": {
            "help": "In case of pending bit, class c confirmed message or sticky MAC command, stack will automatically send empty uplink message",
            "value": true
        }

Default value is true. If sending an empty message fails, stack will send event AUTOMATIC_UPLINK_ERROR application.

If automatic uplink sending is disabled, stack will send application UPLINK_REQUIRED -event to indicate
application should issue a new uplink to gateway as soon as possible.
2018-04-18 09:29:20 +03:00
Marcus Chang 595a98b313 Enable flow control in Greentea
Flow control is enabled in Greentea for targets that has
console-uart-flow-control set.
2018-04-17 14:16:31 -07:00
Amanda Butler a83745bcdd
Copy edit UARTCellularInterface.h
Copy edit file for grammar.
2018-04-17 11:51:24 -05:00
Amanda Butler 8389bbfc61
Copy edit PPPCellularInterface.h
Copy edit file for grammar.
2018-04-17 11:49:20 -05:00
Amanda Butler 0f8a2c75e7
Copy edit OnboardCellularInterface.h
Copy edit file for grammar.
2018-04-17 11:44:28 -05:00
Amanda Butler 5835d83efa
Copy edit CellularInterface.h
Copy edit for grammar.
2018-04-17 11:41:59 -05:00
Vincent Coubard 169e579de7 BLE: Handle new addresses type in GenericGap. 2018-04-17 17:05:41 +01:00
Cruz Monrreal 853384a5ca
Merge pull request #6627 from TeroJaasko/nanostack_hal_timer_shortcut
Nanostack hal timer shortcut
2018-04-17 10:55:26 -05:00
Cruz Monrreal 4522405d06
Merge pull request #6588 from hasnainvirk/base_structs
[IOTCELL-741] Separating public data structures
2018-04-17 10:54:45 -05:00
Cruz Monrreal 259f9fd877
Merge pull request #6570 from jarvte/add_cellular_detach
Cellular: add detach from the network
2018-04-17 10:54:09 -05:00
paul-szczepanek-arm f56f57bf15 reorder enum to add new values at the end 2018-04-17 16:25:35 +01:00
Vincent Coubard 951a6be4c8 BLE: retrieve and fill resolving list at GenericSecurityManager startup. 2018-04-17 15:58:21 +01:00
Vincent Coubard ede3d43743 BLE: Add function to querry the list of identity addresses present in the SecureDB. 2018-04-17 15:57:30 +01:00
Vincent Coubard 77b1903634 BLE: Add bonded device to resolving list at the end of bonding. 2018-04-17 14:16:35 +01:00
Vincent Coubard ae8d5b4de1 BLE: Implement identity retrieval in secure DB. 2018-04-17 14:15:28 +01:00
Vincent Coubard f905d2a4d4 BLE: Improve DB entry lookup.
The DB entry lookup now looks at the identity address and/or connection address to find a DB entry associated to an address.

If the entry has not been found in the DB and a new entry is returned then the connection address is not stored for private addresses.
2018-04-17 14:14:53 +01:00
Vincent Coubard a3bb18d724 BLE: store identity address type in DB. 2018-04-17 14:11:05 +01:00
Vincent Coubard 06e0aa3440 BLE: flag that irk has been stored in the security entry. 2018-04-17 14:10:19 +01:00
Vincent Coubard 6fc74fbc44 BLE: Fix MemorySecurityDB constructor warning. 2018-04-17 14:09:00 +01:00
Vincent Coubard 15fa3bfd37 BLE: Add a function to retrieve a device identity. 2018-04-17 14:08:01 +01:00
Vincent Coubard e8041510a6 BLE: Add a flag that indicate if the identity address is public or not. 2018-04-17 14:07:19 +01:00
Vincent Coubard ab6821aab8 BLE: Add a flag indicating if irk is stored in the distribution flags. 2018-04-17 14:06:47 +01:00
Vincent Coubard 9643b57159 BLE: Remove flag SecurityDistributionFlags_t::local_address_is_public
This flag was not used and not useful.
2018-04-17 14:06:00 +01:00
Vincent Coubard dfbf383614 BLE: Fix const correctness of ::Gap::getRandomAddressType 2018-04-17 14:03:57 +01:00
Vincent Coubard 51e1c76b4a BLE: Set default mac address to all 00. 2018-04-17 14:03:20 +01:00
Kevin Bracey e7206cdc8e Stop lwIP using us_ticker
lwIP was using us_ticker unnecessarily, complicating the code and
potentially causing grief with power saving, and possible glitches
on timer wrap. Switch it to use the RTOS tick count.
2018-04-17 12:40:04 +03:00
Teppo Järvelin 3b1c8c0a94 Cellular: Updated doxygen for deprecated API's. 2018-04-17 12:30:16 +03:00
Teppo Järvelin 1990f63382 Cellular: fixed state machine after rebase. 2018-04-17 10:24:19 +03:00
Teppo Järvelin e78e1d28db Cellular: check plmn against network to verify correct network and don't try to register again if we are are already in correct nw. 2018-04-17 10:16:32 +03:00
Teppo Järvelin e4c37f2275 Cellular: plmn used when registering can be given for CellularConnectionFSM. 2018-04-17 10:16:32 +03:00
Vincent Coubard b3c871c960 BLE: Implement privacy on Nordic targets. 2018-04-16 18:18:05 +01:00
Vincent Coubard 2a9d80c5f0 BLE: Change nRF5xSecurityManager::resolve_address signature
Return the resolving list entry instead of accepting in parameters.
2018-04-16 18:18:04 +01:00
Vincent Coubard a18283d897 BLE: change nRF5xSecurityManager::get_resolving_list return
It now returns a resolving list entry.
2018-04-16 18:18:04 +01:00
Vincent Coubard fb680db621 BLE: Implement resolving list in Nordic PAL security manager 2018-04-16 18:18:04 +01:00
Vincent Coubard 365f3d2527 BLE: Add ah in Nordic CryptoToolbox. 2018-04-16 18:18:04 +01:00
Vincent Coubard a7f2384e10 BLE: Add default privacy configuration 2018-04-16 18:18:04 +01:00
Cruz Monrreal e2567e5dad
Merge pull request #6599 from jeromecoutant/PR_WARNING
STM32 compilation warning issues
2018-04-16 10:41:36 -05:00
Cruz Monrreal c867934178
Merge pull request #6613 from pauluap/compiler_warning_macro_expansion_constant_boolean
Macro expansion results in a constant boolean expression
2018-04-16 10:35:27 -05:00
Cruz Monrreal 7188c8a4b8
Merge pull request #6620 from jarvte/cellular_fixing_at_unit_tests
Cellular: fixed athandler unit tests.
2018-04-16 10:34:58 -05:00