Add a deinit function that will be called and check inside
whether context is initialized. This function is called for
freeing the CC context, instead of every time check that it's
initizliaed and free it.
Initiate the CC context in the starts function and in the reset.
In the reset function, free aes context before.
Free the context in the finish function and reset function.
* Adjust definition to make the default constructor `constexpr`.
This permits use in classes that want lazy initialization and their
own `constexpr` constructor, such as `mstd::mutex`.
* Add `get_no_init()` method to allow an explicit optimisation for
paths that know they won be the first call (such as
`mstd::mutex::unlock`).
* Add `destroy()` method to permit destruction of the contained object.
(`SingletonPtr`'s destructor does not call its destructor - a cheat
to omit destructors of static objects). Needed if using in a class
that needs proper destruction.
- Add the no confidentiality & no replay protection flags
- Add actual size parameter in PS/ITS get APIs
- Change a few size parameters from uint32_t to size_t
Have the alternative aes undefined by default,
in order not to break backwards compatability.
`MBEDTLS_CTR_DRBG_USE_128_BIT_KEY` remains defined for better usability.
Fix minor style fixes and typos:
1. Change file name to correct one.
2. Change copyright year.
3. Insert whitespaces before and after paranthesis.
4. Put `*` next to pointer name.
Add support for CC310 CMAC driver returning
`MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED` for key size other than 128 bits,
and for crypto algorithms other than AES( e.g. DES).
Port the cc310 SHA512 driver, even though it is sw implementation.
Because the linker could not remove the cc310 sha512 implementation,
there was duplicate implementation of SHA512, without enabling
the sha512 alternative implementation.
Add support for CC310 AES driver,
returning `MBEDTLS_ERR_PLATFORM_FEATURE_UNSUPPORTED` for key size
other than 128 bits, and for AES modes not supported by the driver.
Use `MBEDTLS_CTR_DRBG_USE_128_BIT_KEY`.
If "lwip.tcp-enabled" is set to false, ARMC6 compilation fails to error
Error: L6218E: Undefined symbol netconn_recv_tcp_pbuf
LWIP::socket_recv() is TCP socket specific method so implementation can be
enabled only when LWIP_TCP flag is set.
ARMC5 failed to compile the code with debug-profile (!!) as va_list
is getting into std:: namespace when one includes <cstdarg>. Other
compilers seem to be more relaxed, and so is ARMC5 if compiled
with other profiles.
Add the explicit std:: to references of va_list.
While here, remove one extra copy of "#include "PlatformMutex.h""
and a "#include <stdarg.h>" which is kind of duplicate of
"#include <cstdarg>".
Error being fixed:
--8<--8<--8<--
Compile [ 81.8%]: ATHandler.cpp
[Error] ATHandler.h@552,0: #20: identifier "va_list" is undefined
[Error] ATHandler.cpp@1226,0: #147: declaration is incompatible with "void mbed::ATHandler::handle_args(const char *, <error-type>)" (declared at line 552 of "./mbed-os/features/cellular/framework/AT/ATHandler.h")
[ERROR] "./mbed-os/features/cellular/framework/AT/ATHandler.h", line 552: Error: #20: identifier "va_list" is undefined
"./mbed-os/features/cellular/framework/AT/ATHandler.cpp", line 1226: Error: #147: declaration is incompatible with "void mbed::ATHandler::handle_args(const char *, <error-type>)" (declared at line 552 of "./mbed-os/features/cellular/framework/AT/ATHandler.h")
./mbed-os/features/cellular/framework/AT/ATHandler.cpp: 0 warnings, 2 errors
In Mbed OS, there are configuration options with Mbed TLS that we
are more comfortable allowing than we do with Mbed TLS on its own.
Add a check-config adjusting script to enable removing or changing
options in check_config.h
IPV6 and IPV6V4 support is also network dependent not only modem.
Having these properties enabled for a modem requires a fallback
mechanism during PDP context activation. This mechanism is missing
at the moment and that can result in imposibility to establish
succesfull connection when network only supports IPV4 contexts.
Fixes#9744
Appears to be a lwIP porting bug. Comments in our porting layer say:
This function should support recursive calls from the same task or interrupt. In other words, sys_arch_protect() could be called while already protected.
In AU/CN/US PHY, RX1 slot frequency is calculated in rx_config().
Since the caller is printing it to log, modify the frequency in
parameter structure so that the correct value will be printed.
Prevent compilation issues when someone has included <stdint.h> before
a header file that needs to include <ns_list.h>.
Some toolchains like ARM C 5 will not provide UINT_FAST8_MAX in C++
unless __STDC_LIMIT_MACROS is defined, and if this was not defined the
first time <stdint.h> was included, it's too late.
We can get the maximum value for our unsigned list offset by casting -1
to it, thanks to modulo arithmetic.
Slight RAM+speed efficiency improvement - read the TCP implementation's
native pbufs, rather than forcing netconn_recv to generate netbuf
wrappers for us. Saves one small lwIP heap allocation per TCP packet
received.
When using Mbed Crypto's PSA Entropy Injection feature on Mbed OS, it is
not required to opt out of having entropy sources added to your entropy
contexts by default (via MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES).
As integrated in Mbed OS, MBEDTLS_PSA_INJECT_ENTROPY is compatible with
actual entropy sources. PSA entropy injection is implemented using the
standard Mbed TLS NV Seed feature, and is as compatible with other
entropy sources as the standard Mbed TLS NV Seed feature which does
support entropy mixing.
Minor tweaks to fix ARM C 5 compatibility.
Pushing "ns_list.h" include to first makes sure "ns_types.h" is included
first, meaning it gets to define `__STDC_LIMIT_MACROS` before the first
include of <stdint.h>, which ensures that UINT8_MAX etc are defined.
Previously, extended advertising parameters failed to be set
during BLE initialisation when the stack was not ready.
To work around this, we delay it to the first use of
useVersionTwoAPI.
Fix LWIP warning issues found by Coverity scan
lwip_dns.c in function: dns_add_interface_server
CID 1399051 (#1 of 1): Buffer not null terminated (BUFFER_SIZE_WARNING)10. buffer_size_warning: Calling strncpy with a maximum size argument of 6 bytes on destination array new_interface_server->interface_name of size 6 bytes might leave the destination string unterminated.
line 434 strncpy(new_interface_server->interface_name, interface_name, INTERFACE_NAME_MAX_SIZE);
lwip_ip4_frag.c in function: ip_reass_free_complete_datagram
CID 1373164 (#1 of 1): Dereference after null check (FORWARD_NULL)7. var_deref_model: Passing null pointer prev to ip_reass_dequeue_datagram, which dereferences it. [show details]
line 209 ip_reass_dequeue_datagram(ipr, prev);
lwip_ip4_frag.c in function: ip_reass
CID 1373163 (#1-2 of 2): Dereference after null check (FORWARD_NULL)38. var_deref_model: Passing null pointer ipr_prev to ip_reass_dequeue_datagram, which dereferences it. [show details]
line 663 ip_reass_dequeue_datagram(ipr, ipr_prev);
lwip_api_msg.c in function: lwip_netconn_do_connected
CID 1373162 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)10. var_deref_model: Passing null pointer op_completed_sem to sys_sem_signal, which dereferences it. [show details]
line 1336 sys_sem_signal(op_completed_sem);
Automatically enable entropy injection when the NV Seed feature is
requested on PSA targets. Add a warning note describing the state of the
current implementation of the entropy injection API.
Fixes#10720
Deprecate wait() in favour of acquire(), try_acquire(),
try_acquire_for() and try_acquire_until().
Brings Semaphore more into line with CMSIS-RTOS 2 (which uses "acquire"),
itself (as it has "release"), and other classes having "try", "try for"
and "try until".
Also steps away from vague "wait" term - the primary operation here is
to acquire the semaphore, and this will of course sleep.
The USB Device must change the address within 2 ms after completing
SET ADDRESS status stage.
Wait 2 ms before issuing GET DESCRIPTOR under the new address. In my
case, this completely resolves the timeout issues.
On STM32F746G Discovery boards, the USB OTG HS port does not have a
dedicated GPIO for controlling the USB VBUS.
This change fixes HardFault (NULL pointer dereference) that triggered
when such USB host port was used.
The deprecation notice suggests getConnectionCount() which
did not land in the final API. The proper replacement is keeping
your own record and updating during connection and disconnection
callbacks.
When importing development releases of Mbed TLS into Mbed OS, it is
useful to be able to know a the particular git commit hash that was
imported. This change avoids ever creating a VERSION.txt for Mbed TLS
containing only "development", which is fairly useless since one doesn't
know where the development branch was at the time of import.
As per official specification, temperature measurement requires
the GATT characteristic "INDICATE" instead of "NOTIFY".
Full credits to Jean-Marc Jobin (@jmjobin on GitHub) for
identifying the issue and proposing this fix.
This modem is a special case. It uses a given socket ID value rather
than providing one. A naive solution here would be to directly map the
index of a CellularSocket object in the CellularSocket container. But
considering the case where there are multiple sockets being opened (some
sockets being already created at the modem and some yet not created), direct mapping
to indices will not work. As it can happen that the CellularSocket
object is allocated but the socket id is not assigned yet as it is not
actually created on the modem.
In such a case, we check the container and assign the socket id from the
pool if an empty slot was found.
Local modem ip stacks vary in their implementations and the way of
working. Some of the modems may not open a socket until an IP context is
assigned. That's why we came up with a container that stores addresses of
any CellularSocket instances created on-demand by the application. When
the application requests opening a socket we store allocate and store the
premitive in the container however actual socket creation at the modem
may happen at a later stage, e.g., a call to send_to() may result in
actual opening of a socket.
That's why we must not assign socket ids in the CellularSocket object
during construction. It must happen when actual socket is opened and is
alive.
Another implication of the previous model is that we may have multiple
sockets created in our container but the actual socket ids are not
assigned yet, so we cannot directly map the socket id to the container
indices which has been happening previously.
To solve this issue we have promoted the AT_CellularStac::find_socket_index(...) method
to be a protected method rather than being private so that the children
can use the method to determine if the given index in the container
corrsponds to the assigned socket id or not.
We have given up on the socket->created flag and the whole decision
making to actually open a socket on the modem happens on the basis of a
valid socket being assigned or not.
- Adjust memory for SoftDevice
- Enable PRIO=5 for interrupt priority check
- Change NRF_SD_BLE_API_VERSION to 6
- Add handle and buffer for advertising and scanning
- Remove guard for phy update
- Change scatter files and mbed_lib.json for PR #8607
Musca-A1 is a Cortex-M33 based target with security extension enabled.
- ARM_MUSCA_A1 is the non-secure target running mbed-os.
- ARM_MUSCA_A1_S is the secure target running TF-M.
- TF-M sources were imported and patched in previous commits.
- TF-M secure bootloader (McuBoot) for MUSCA_A1 is submitted by a pre-built binary.
- A post-build hook concatenates The secure and non-secure binaries,
signs it and then concatenates the bootloader with the signed binary.
Update BatterService and HealthThermometerService to use
up-to-date BLE APIs.
Note: HealthThermometerService::updateTemperature() will
not check GAP connection which should be taken care of by
the caller.