The current distclean implementation has two issues:
1. Application.mk does not remove .kconfig on distclean, so stale
config fragments from earlier builds can pollute subsequent ones.
2. Several external-library Makefiles (lame, libshvc, libulut) run
"make -C <subdir> distclean" without checking whether the
subdirectory exists. When the library was never downloaded (common
in CI partial-build environments), distclean fails with "No such
file or directory".
Fix:
- Application.mk: add $(call DELFILE, .kconfig) to the distclean
target so that .kconfig is cleaned along with .built, .depend, etc.
- audioutils/lame/Makefile: guard the distclean recipe with
"if [ -d $(DST_PATH) ]; then ...; fi" and use $(MAKE) instead
of bare make.
- netutils/libshvc/Makefile, netutils/libulut/Makefile: same
directory-existence guard for their distclean recipes.
- crypto/wolfssl/Makefile: change "distclean:" to "distclean::"
(double-colon) so it does not override the distclean:: rule
inherited from Application.mk.
Signed-off-by: hanzhijian <hanzhijian@zepp.com>
Add the missing module metadata for the executable ELF helpers used by the package fixture flow so the generated artifacts describe their target and type consistently.
Also fix the existing embedlog spelling issue that is picked up by the current apps check, keeping this branch clean under CI.
Signed-off-by: aviralgarg05 <gargaviral99@gmail.com>
- crypto/mbedtls: Add -Wno-cpp flag to suppress warnings
- interpreters/quickjs: Add flags to suppress warnings
- lte/alt1250: Fix spelling issues in comments
- system/dd: Add missing includes for modern compilers
- system/zlib: Add -Wno-cpp flag
- testing/cxx: Include missing algorithm header
Signed-off-by: Bartosz <bartol2205@gmail.com>
To replace the large lock with smaller ones and reduce the large locks related to the TCB,
in many scenarios, we only need to ensure that the TCB won't be released
instead of locking, thus reducing the possibility of lock recursion.
Signed-off-by: hujun5 <hujun5@xiaomi.com>
Remove the extra rngctx parameter from SSL_CTX_new() to match
the standard OpenSSL API signature:
SSL_CTX *SSL_CTX_new(const SSL_METHOD *method)
This improves compatibility with code written for OpenSSL.
Signed-off-by: makejian <makejian@xiaomi.com>
Map mbedtls error codes to OpenSSL standard return codes in
SSL_connect/SSL_do_handshake:
- Return 1 on success
- Return 0 on controlled shutdown
- Return -1 on fatal error (was returning mbedtls error codes)
This aligns the return values with OpenSSL specification where
SSL_get_error() should be called to get the actual error reason.
Signed-off-by: makejian <makejian@xiaomi.com>
Export SSL_CTX_load_verify_file() and SSL_CTX_load_verify_dir()
interfaces to allow loading CA certificates from file or directory.
Signed-off-by: makejian <makejian@xiaomi.com>
Add UNIX platform flag to tinycrypto build configuration to enable access to /dev/random for secure random number generation.
Signed-off-by: makejian <makejian@xiaomi.com>
mbedtls interfaces overwritten by nuttx crypto driver, change return value of mbedtls interfaces from return value of nuttx crypto driver into starndard return value of mbedtls
Signed-off-by: makejian <makejian@xiaomi.com>
remove empty strings from FetchContent to eliminate cmake build warnings like this:
CMake Warning (dev) at /usr/share/cmake/Modules/FetchContent.cmake:1564 (cmake_parse_arguments):
The BUILD_COMMAND keyword was followed by an empty string or no value at
all. Policy CMP0174 is not set, so cmake_parse_arguments() will unset the
ARG_BUILD_COMMAND variable rather than setting it to an empty string.
Signed-off-by: raiden00pl <raiden00@railab.me>
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This is to patch upstream MbedTLS issue:
https://github.com/Mbed-TLS/mbedtls/issues/9425
that triggers a -Werror=undef when MBEDTLS_SSL_PROTO_DTLS
is undefined. There is no other way to silence that warning
and it breaks builds in systems with -Werror. Once the
upstream issue is resolved, this can be reverted.
Signed-off-by: George Poulios <gpoulios@census-labs.com>
Even though one could in theory simply set CONFIG_MBEDTLS_VERSION="3.6.2",
this commit is needed for 2 reasons:
1. The patches need to be updated: 0001 works almost as-is (with fuzz 2)
but 0002 hunk #4 fails and needed adjustment. Otherwise, the patches
are identical.
2. mbedtls_config.h needs to be updated: Following the same approach
for the Kconfig this commit updates both Kconfig and mbedtls_config.h
according to the changes:
mbedtls$ git diff v3.4.0...v3.6.2 -- include/mbedtls/mbedtls_config.h
Minor edits also to crypto/controlse to comply with v3.6.2.
Signed-off-by: George Poulios <gpoulios@census-labs.com>
* \def MBEDTLS_CONFIG_FILE
*
* If defined, this is a header which will be included instead of
* `"mbedtls/mbedtls_config.h"`.
no need to specify MBEDTLS_CONFIG_FILE
Signed-off-by: makejian <makejian@xiaomi.com>
CC: vfs/fs_lseek.c /home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c: In function ‘HMAC_CTX_new’:
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:57:31: warning: implicit declaration of function ‘malloc’ [-Wimplicit-function-declaration]
57 | (mbedtls_md_context_t *)malloc(sizeof(mbedtls_md_context_t));
| ^~~~~~
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:28:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’
27 | #include <mbedtls/hmac_drbg.h>
+++ |+#include <stdlib.h>
28 | #include <mbedtls/md.h>
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:57:31: warning: incompatible implicit declaration of built-in function ‘malloc’ [-Wbuiltin-declaration-mismatch]
57 | (mbedtls_md_context_t *)malloc(sizeof(mbedtls_md_context_t));
| ^~~~~~
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:57:31: note: include ‘<stdlib.h>’ or provide a declaration of ‘malloc’
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c: In function ‘HMAC_CTX_free’:
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:126:3: warning: implicit declaration of function ‘free’ [-Wimplicit-function-declaration]
126 | free(ctx);
| ^~~~
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:126:3: note: include ‘<stdlib.h>’ or provide a declaration of ‘free’
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:126:3: warning: incompatible implicit declaration of built-in function ‘free’ [-Wbuiltin-declaration-mismatch]
/home/cuiziwei/vela/happy/apps/crypto/openssl_mbedtls_wrapper/mbedtls/hmac.c:126:3: note: include ‘<stdlib.h>’ or provide a declaration of ‘free’
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>
(1)aes-xts sets the key length to only 256 and 512 bits
(2)when the key length of aes-xts is 512 bits, MAX_KEY_SIZE needs to be expanded to 64 bytes.
(3)check invalid input length and mode
Signed-off-by: makejian <makejian@xiaomi.com>
if !defined(unix) && !defined(__unix) && !defined(__unix__) && \
!defined(__APPLE__) && !defined(_WIN32) && !defined(__QNXNTO__) && \
!defined(__HAIKU__) && !defined(__midipix__)
error
"Platform entropy sources only work on Unix and Windows, see MBEDTLS_NO_PLATFORM_ENTROPY in mbedtls_config.h"
nuttx/libs/libxx/libcxx/include/__config
nuttx/libs/libxx/libcxx/include/limits.h:40,
apps/crypto/mbedtls/mbedtls/include/mbedtls/check_config.h:31,
apps/crypto/mbedtls/mbedtls/include/mbedtls/build_info.h:151,
apps/crypto/mbedtls/mbedtls/library/common.h:26,
apps/crypto/mbedtls/mbedtls/library/entropy_poll.c:25
if defined(__NuttX__)
undef __linux__
undef __APPLE__
undef __FreeBSD__
undef __GLIBC__
undef __NetBSD__
undef _WIN32
undef __sun__
undef _AIX
/ For the current use of the __unix__ macro in this library,
/ NuttX is not __unix__.
/ This might need to be revisited in future.
undef __unix__
endif
Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
mbedtls/library/alignment.h:98:5: warning: writing 4 bytes into a region of size 0 [-Wstringop-overflow=]
98 | memcpy(p, &x, sizeof(x));
| ^~~~~~~~~~~~~~~~~~~~~~~~
mbedtls/library/cmac.c: In function 'mbedtls_cipher_cmac_finish':
mbedtls/library/cmac.c:288:19: note: at offset 20 into destination object 'M_last' of size 16
288 | unsigned char M_last[MBEDTLS_CIPHER_BLKSIZE_MAX];
| ^~~~~~
Signed-off-by: cuiziwei <cuiziwei@xiaomi.com>