ssl.c:EncryptDerKey(): use XSTRLCPY() and XSTRLCAT() to build up cipherInfo, and remove XSTRCPY() macro from wolfssl/wolfcrypt/types.h (clang-tidy hates on it, albeit frivolously).

pull/5219/head
Daniel Pouzzner 2022-06-07 08:22:48 -05:00
parent fbb6faaa2f
commit 088d378ba4
2 changed files with 2 additions and 3 deletions

View File

@ -26895,8 +26895,8 @@ int EncryptDerKey(byte *der, int *derSz, const EVP_CIPHER* cipher,
#endif
return WOLFSSL_FAILURE;
}
XSTRCPY((char*)*cipherInfo, info->name);
XSTRNCAT((char*)*cipherInfo, ",", 2);
XSTRLCPY((char*)*cipherInfo, info->name, cipherInfoSz);
XSTRLCAT((char*)*cipherInfo, ",", cipherInfoSz);
idx = (word32)XSTRLEN((char*)*cipherInfo);
cipherInfoSz -= idx;

View File

@ -616,7 +616,6 @@ 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))