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 8c4caff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
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
2 changes: 2 additions & 0 deletions wolftpm/tpm2_socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#if !defined(WOLFTPM2_NO_WOLFCRYPT) && !defined(WOLFCRYPT_ONLY)
#include <wolfssl/wolfio.h>
/* always include netdb.h for socket examples */
#include <netdb.h>
#endif

#ifndef USE_WOLFSSL_IO
Expand Down

0 comments on commit 8c4caff

Please sign in to comment.