From 07e0a6fa8e5ff1660107136555d2c6683bbd34db Mon Sep 17 00:00:00 2001 From: Lealem Amedie Date: Mon, 6 Jun 2022 11:33:26 -0700 Subject: [PATCH] Removing ghost functions and fixing overflow warning in ssl.c --- src/ssl.c | 2 +- wolfssl/openssl/buffer.h | 6 ++---- wolfssl/wolfcrypt/types.h | 1 + 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index f628aefef..e428d828a 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -26895,7 +26895,7 @@ int EncryptDerKey(byte *der, int *derSz, const EVP_CIPHER* cipher, #endif return WOLFSSL_FAILURE; } - XSTRNCPY((char*)*cipherInfo, info->name, cipherInfoSz); + XSTRCPY((char*)*cipherInfo, info->name); XSTRNCAT((char*)*cipherInfo, ",", 2); idx = (word32)XSTRLEN((char*)*cipherInfo); diff --git a/wolfssl/openssl/buffer.h b/wolfssl/openssl/buffer.h index 864b5de34..9efdb02f3 100644 --- a/wolfssl/openssl/buffer.h +++ b/wolfssl/openssl/buffer.h @@ -37,8 +37,6 @@ WOLFSSL_API int wolfSSL_BUF_MEM_grow_ex(WOLFSSL_BUF_MEM* buf, size_t len, char zeroFill); WOLFSSL_API int wolfSSL_BUF_MEM_resize(WOLFSSL_BUF_MEM* buf, size_t len); WOLFSSL_API void wolfSSL_BUF_MEM_free(WOLFSSL_BUF_MEM* buf); -WOLFSSL_API size_t wolfSSL_strlcpy(char *dst, const char *src, size_t dstSize); -WOLFSSL_API size_t wolfSSL_strlcat(char *dst, const char *src, size_t dstSize); #define BUF_MEM_new wolfSSL_BUF_MEM_new @@ -46,8 +44,8 @@ WOLFSSL_API size_t wolfSSL_strlcat(char *dst, const char *src, size_t dstSize); #define BUF_MEM_free wolfSSL_BUF_MEM_free #define BUF_strdup strdup -#define BUF_strlcpy wolfSSL_strlcpy -#define BUF_strlcat wolfSSL_strlcat +#define BUF_strlcpy wc_strlcpy +#define BUF_strlcat wc_strlcat #ifdef __cplusplus } /* extern "C" */ diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index 1fe38ae63..9016d61a5 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -616,6 +616,7 @@ decouple library dependencies with standard string, memory and so on. #define XSTRLEN(s1) strlen((s1)) #define XSTRNCPY(s1,s2,n) strncpy((s1),(s2),(n)) + #define XSTRCPY(s1,s2) strcpy((s1),(s2)) /* strstr, strncmp, strcmp, and strncat only used by wolfSSL proper, * not required for wolfCrypt only */ #define XSTRSTR(s1,s2) strstr((s1),(s2))