diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2022-03-05 11:41:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-05 11:41:37 +0100 |
commit | a173d3e98f78a09db6df503ed853212319d29d45 (patch) | |
tree | 0c7377a14bc58488dec2e5ade383ad27309594e7 /src/lib/protocols | |
parent | 95a3d4fffe699823b1cc9730dd0e4e2827b94845 (diff) |
configure: fix usage of libgpg-error with `--with-local-libgcrypt` (#1472)
Right now, using external libgcrypt, nDPI is not linked to libgpg-error
because configure script never checks for it.
```
ivan@ivan-Latitude-E6540:~/svnrepos/nDPI(dev)$ CC=gcc-11 CXX=g++-11 CFLAGS="-O3 -g -Werror" ./autogen.sh --enable-debug-messages --with-pcre --with-local-libgcrypt && make -s -j
[...]
checking for numa_available in -lnuma... yes
checking for pcap_open_live in -lpcap... yes
checking for pthread_setaffinity_np in -lpthread... yes
checking for gcry_cipher_checktag in -lgcrypt... yes <------- missing check for libgpg-error
checking for pcre_compile in -lpcre... yes
checking that generated files are newer than configure... done
[...]
ivan@ivan-Latitude-E6540:~/svnrepos/nDPI(dev)$ grep HAVE_LIBGPG_ERROR src/include/ndpi_config.h
/* #undef HAVE_LIBGPG_ERROR */
```
Make both libgcrypt and libgpg-error mandatory if
`--with-local-libgcrypt` is used.
Technically speaking, libgpg-error might be optional, because it is used
only for debug messages. However having both libraries mandatory
slightly simplified the logic.
In most environments, libgpg-error is a dependency of libgcrypt anyway,
so having both libraries should be the standard case.
Diffstat (limited to 'src/lib/protocols')
-rw-r--r-- | src/lib/protocols/quic.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/lib/protocols/quic.c b/src/lib/protocols/quic.c index 39fc968f5..f107f87fb 100644 --- a/src/lib/protocols/quic.c +++ b/src/lib/protocols/quic.c @@ -246,16 +246,11 @@ static uint16_t gquic_get_u16(const uint8_t *buf, uint32_t version) #ifdef DEBUG_CRYPT char *__gcry_err(gpg_error_t err, char *buf, size_t buflen) { -#if defined(HAVE_LIBGPG_ERROR) || !defined(USE_HOST_LIBGCRYPT) gpg_strerror_r(err, buf, buflen); /* I am not sure if the string will be always null-terminated... Better safe than sorry */ if(buflen > 0) buf[buflen - 1] = '\0'; -#else - if(buflen > 0) - buf[0] = '\0'; -#endif return buf; } #endif /* DEBUG_CRYPT */ |