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 <mishra.abhishek2808@gmail.com>
This commit is contained in:
Abhishek Mishra 2026-07-18 15:04:05 +00:00
parent 09682dad05
commit c8be1e644a
2 changed files with 14 additions and 2 deletions

View file

@ -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(

View file

@ -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),)