Skip to content

Commit

Permalink
For the TLS examples and SWTPM interface that use POSIX sockets make …
Browse files Browse the repository at this point in the history
…sure `netdb.h` is included. Previously wolfSSL always included netdb.h, but now it requires `HAVE_NETDB_H`.
  • Loading branch information
dgarske committed Feb 29, 2024
1 parent 35bf0b9 commit 7b5dcaf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ target_compile_definitions(wolftpm PRIVATE
"BUILDING_WOLFTPM"
)

include(CheckIncludeFile)
check_include_file("netdb.h" HAVE_NETDB_H)

# TODO
# * wrapper
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ AC_CHECK_SIZEOF([long long], 8)
AC_CHECK_SIZEOF([long], 4)

# Check headers/libs
AC_CHECK_HEADERS([netdb.h])
AC_CHECK_FUNCS([gethostbyname getaddrinfo gettimeofday inet_ntoa memset socket])
AC_CHECK_LIB([network],[socket])

Expand Down
4 changes: 3 additions & 1 deletion wolftpm/tpm2_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#else
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>

#define SOCKET_T int
#endif
Expand Down Expand Up @@ -86,4 +85,7 @@

#endif /* !USE_WOLFSSL_IO */

/* always include netdb.h for socket examples */
#include <netdb.h>

#endif /* _TPM2_SOCKET_H_ */

0 comments on commit 7b5dcaf

Please sign in to comment.