Skip to content

Commit

Permalink
Addressing PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Andras Fekete committed Jul 26, 2024
1 parent 750abdc commit bbeb246
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/ssl_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -5131,8 +5131,8 @@ int wolfSSL_CTX_set_default_verify_paths(WOLFSSL_CTX* ctx)
WOLFSSL_ENTER("wolfSSL_CTX_set_default_verify_paths");

#ifdef XGETENV
certDir = wc_strdup(XGETENV("SSL_CERT_DIR"), DYNAMIC_TYPE_TMP_BUFFER);
certFile = wc_strdup(XGETENV("SSL_CERT_FILE"), DYNAMIC_TYPE_TMP_BUFFER);
certDir = wc_strdup_ex(XGETENV("SSL_CERT_DIR"), DYNAMIC_TYPE_TMP_BUFFER);
certFile = wc_strdup_ex(XGETENV("SSL_CERT_FILE"), DYNAMIC_TYPE_TMP_BUFFER);
flags = WOLFSSL_LOAD_FLAG_PEM_CA_ONLY;

if ((certDir != NULL) || (certFile != NULL)) {
Expand Down
4 changes: 3 additions & 1 deletion wolfcrypt/src/wc_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,8 @@ int wc_strncasecmp(const char *s1, const char *s2, size_t n)
}
#endif /* USE_WOLF_STRNCASECMP */

char* wc_strdup(const char *src, int memType) {
#ifdef USE_WOLF_STRDUP
char* wc_strdup_ex(const char *src, int memType) {
char *ret = NULL;
int len = 0;

Expand All @@ -1191,6 +1192,7 @@ char* wc_strdup(const char *src, int memType) {

return ret;
}
#endif

#ifdef WOLFSSL_ATOMIC_OPS

Expand Down
9 changes: 8 additions & 1 deletion wolfssl/wolfcrypt/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,14 @@ typedef struct w64wrapper {
WOLFSSL_API int wc_strncasecmp(const char *s1, const char *s2, size_t n);
#endif

WOLFSSL_API char* wc_strdup(const char *src, int memType);
#if !defined(XSTRDUP) && !defined(USE_WOLF_STRDUP)
#define USE_WOLF_STRDUP
#endif
#ifdef USE_WOLF_STRDUP
WOLFSSL_LOCAL char* wc_strdup_ex(const char *src, int memType);
#define wc_strdup(src) wc_strdup_ex(src, DYNAMIC_TYPE_TMP_BUFFER)
#endif

#if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM)
#ifndef XGETENV
#ifdef NO_GETENV
Expand Down

0 comments on commit bbeb246

Please sign in to comment.