You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2026/08/04 02:36:17 UTC
(nuttx-apps) 04/12: dropbear: rename libtomcrypt symbols to avoid NuttX collisions
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch releases/13.0
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit 3f1073b7bd64dbf9171027ddc93cca3fd0584265
Author: Abhishek Mishra <mi...@gmail.com>
AuthorDate: Sat Jul 18 15:04:05 2026 +0000
dropbear: rename libtomcrypt symbols to avoid NuttX collisions
Rename base64_encode, base64_decode, and ecc_make_key in bundled
libtomcrypt to avoid duplicate symbol link errors when dropbear is built
alongside netutils/codecs and NuttX crypto (e.g. sim:dropbear).
Signed-off-by: Abhishek Mishra <mi...@gmail.com>
---
netutils/dropbear/CMakeLists.txt | 9 +++++++--
netutils/dropbear/Makefile | 7 +++++++
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/netutils/dropbear/CMakeLists.txt b/netutils/dropbear/CMakeLists.txt
index 8ca691be0..eb31d0012 100644
--- a/netutils/dropbear/CMakeLists.txt
+++ b/netutils/dropbear/CMakeLists.txt
@@ -192,8 +192,13 @@ if(CONFIG_NETUTILS_DROPBEAR)
endif()
target_compile_definitions(
- ${PROGNAME} PRIVATE LOCALOPTIONS_H_EXISTS=1 DROPBEAR_NUTTX=1
- DROPBEAR_NUTTX_PASSWD=1)
+ ${PROGNAME}
+ PRIVATE LOCALOPTIONS_H_EXISTS=1
+ DROPBEAR_NUTTX=1
+ DROPBEAR_NUTTX_PASSWD=1
+ base64_encode=dropbear_ltc_base64_encode
+ base64_decode=dropbear_ltc_base64_decode
+ ecc_make_key=dropbear_ltc_ecc_make_key)
if(CONFIG_NETUTILS_DROPBEAR_SCP)
target_compile_definitions(
diff --git a/netutils/dropbear/Makefile b/netutils/dropbear/Makefile
index 53b1f2f72..17e5ec8db 100644
--- a/netutils/dropbear/Makefile
+++ b/netutils/dropbear/Makefile
@@ -130,6 +130,13 @@ endif
# Match the ESP-IDF port behavior: LTC_SOURCE is only for libtomcrypt sources.
$(foreach src,$(TOMCRYPT_SRCS),$(eval $(src)_CFLAGS += ${DEFINE_PREFIX}LTC_SOURCE=1))
+# Avoid duplicate symbols when NuttX/apps also provide these APIs.
+# Apply to all dropbear sources so libtomcrypt definitions and dropbear
+# callers (e.g. signkey.c) use the same renamed symbols.
+CFLAGS += ${DEFINE_PREFIX}base64_encode=dropbear_ltc_base64_encode
+CFLAGS += ${DEFINE_PREFIX}base64_decode=dropbear_ltc_base64_decode
+CFLAGS += ${DEFINE_PREFIX}ecc_make_key=dropbear_ltc_ecc_make_key
+
MAINSRC = dropbear_main.c
ifneq ($(CONFIG_NETUTILS_DROPBEAR_SCP),)