Errors with compiling CryptopANT binaries:
> gcc scramble_ips.c -o scramble_ips
produces
scramble_ips.c: In function ‘main’:
scramble_ips.c:354:16: error: ‘regex4’ undeclared (first use in this function); did you mean ‘regexec’?
memset(regex4, 0, sizeof(regex4));
^~~~~~
regexec
scramble_ips.c:354:16: note: each undeclared identifier is reported only once for each function it appears in
scramble_ips.c:355:16: error: ‘regex6’ undeclared (first use in this function); did you mean ‘regexec’?
memset(regex6, 0, sizeof(regex6));
^~~~~~
regexec
scramble_ips.c:356:13: error: ‘opt_ipprefix’ undeclared (first use in this function)
if (opt_ipprefix != NULL) {
^~~~~~~~~~~~
scramble_ips.c:360:25: error: ‘REGEX4’ undeclared (first use in this function); did you mean ‘REG_EEND’?
strncat(regex4, REGEX4, sizeof(regex4)-1);
^~~~~~
REG_EEND
scramble_ips.c:361:25: error: ‘REGEX6’ undeclared (first use in this function); did you mean ‘REG_EEND’?
strncat(regex6, REGEX6, sizeof(regex6)-1);
^~~~~~
REG_EEND
scramble_ips.c:362:13: error: ‘opt_ipsuffix’ undeclared (first use in this function)
if (opt_ipsuffix != NULL) {
^~~~~~~~~~~~
I need a way to reversibly anonymize IPv4, IPv6, and MACs, and so I found CryptopANT: https://ant.isi.edu/software/cryptopANT/index.html
Haven't done a lot of C in years and so I need a troubleshooting refresh. Am I missing any steps? Is there something more versatile than CryptopANT out there by now?
To install and use the scramble_ips binary on Debian 10, I did this:
- Downloaded the tarball
- Unzipped to /usr/local/src
- ./configure, make, and make install
So far so good. Output from the above is included below. Now I gotta actually compile the binary, right? I do the gcc and get the "undeclared" issue. Ok so I've got some issue with regex4, probably a version thing since the last CryptopANT release was almost 3 years ago. Thing is I've got no clear idea where to start. Did I miss a configure or make step? Was there another step? Is it dependencies? Where should these have been declared?
Let me know if I need to include anything else.
Output for
$sudo ./configure && make && make install:
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking whether byte ordering is bigendian... no
checking openssl/blowfish.h usability... yes
checking openssl/blowfish.h presence... yes
checking for openssl/blowfish.h... yes
checking openssl/sha.h usability... yes
checking openssl/sha.h presence... yes
checking for openssl/sha.h... yes
checking regex.h usability... yes
checking regex.h presence... yes
checking for regex.h... yes
checking for regcomp... yes
checking for regexec... yes
checking for BF_ecb_encrypt in -lcrypto... yes
checking for struct in6_addr.s6_addr32... yes
checking for strlcpy... no
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking for uint32_t... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating cryptopANT.spec
config.status: executing depfiles commands
config.status: executing libtool commands
depbase=`echo src/cryptopANT.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool --tag=CC --mode=compile gcc -DPACKAGE_NAME=\"cryptopANT\" -DPACKAGE_TARNAME=\"cryptopANT\" -DPACKAGE_VERSION=\"1.2.2\" -DPACKAGE_STRING=\"cryptopANT\ 1.2.2\" -DPACKAGE_BUGREPORT=\"ant@isi.edu\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_OPENSSL_BLOWFISH_H=1 -DHAVE_OPENSSL_SHA_H=1 -DHAVE_REGEX_H=1 -DHAVE_REGCOMP=1 -DHAVE_REGEXEC=1 -DHAVE_LIBCRYPTO=1 -DHAVE_S6_ADDR32=1 -DPACKAGE=\"cryptopANT\" -DVERSION=\"1.2.2\" -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -g -O2 -MT src/cryptopANT.lo -MD -MP -MF $depbase.Tpo -c -o src/cryptopANT.lo src/cryptopANT.c &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile: gcc -DPACKAGE_NAME=\"cryptopANT\" -DPACKAGE_TARNAME=\"cryptopANT\" -DPACKAGE_VERSION=\"1.2.2\" "-DPACKAGE_STRING=\"cryptopANT 1.2.2\"" -DPACKAGE_BUGREPORT=\"ant@isi.edu\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_OPENSSL_BLOWFISH_H=1 -DHAVE_OPENSSL_SHA_H=1 -DHAVE_REGEX_H=1 -DHAVE_REGCOMP=1 -DHAVE_REGEXEC=1 -DHAVE_LIBCRYPTO=1 -DHAVE_S6_ADDR32=1 -DPACKAGE=\"cryptopANT\" -DVERSION=\"1.2.2\" -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -g -O2 -MT src/cryptopANT.lo -MD -MP -MF src/.deps/cryptopANT.Tpo -c src/cryptopANT.c -fPIC -DPIC -o src/.libs/cryptopANT.o
libtool: compile: gcc -DPACKAGE_NAME=\"cryptopANT\" -DPACKAGE_TARNAME=\"cryptopANT\" -DPACKAGE_VERSION=\"1.2.2\" "-DPACKAGE_STRING=\"cryptopANT 1.2.2\"" -DPACKAGE_BUGREPORT=\"ant@isi.edu\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_OPENSSL_BLOWFISH_H=1 -DHAVE_OPENSSL_SHA_H=1 -DHAVE_REGEX_H=1 -DHAVE_REGCOMP=1 -DHAVE_REGEXEC=1 -DHAVE_LIBCRYPTO=1 -DHAVE_S6_ADDR32=1 -DPACKAGE=\"cryptopANT\" -DVERSION=\"1.2.2\" -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -g -O2 -MT src/cryptopANT.lo -MD -MP -MF src/.deps/cryptopANT.Tpo -c src/cryptopANT.c -o src/cryptopANT.o >/dev/null 2>&1
/bin/bash ./libtool --tag=CC --mode=link gcc -g -O2 -version-info 1:3:0 -lcrypto -o libcryptopANT.la -rpath /usr/local/lib src/cryptopANT.lo -lcrypto
libtool: link: gcc -shared -fPIC -DPIC src/.libs/cryptopANT.o -lcrypto -g -O2 -Wl,-soname -Wl,libcryptopANT.so.1 -o .libs/libcryptopANT.so.1.0.3
libtool: link: (cd ".libs" && rm -f "libcryptopANT.so.1" && ln -s "libcryptopANT.so.1.0.3" "libcryptopANT.so.1")
libtool: link: (cd ".libs" && rm -f "libcryptopANT.so" && ln -s "libcryptopANT.so.1.0.3" "libcryptopANT.so")
libtool: link: ar cru .libs/libcryptopANT.a src/cryptopANT.o
ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libcryptopANT.a
libtool: link: ( cd ".libs" && rm -f "libcryptopANT.la" && ln -s "../libcryptopANT.la" "libcryptopANT.la" )
make[1]: Entering directory '/usr/local/src/cryptopANT-1.2.2'
/bin/mkdir -p '/usr/local/lib'
/bin/bash ./libtool --mode=install /usr/bin/install -c libcryptopANT.la '/usr/local/lib'
libtool: install: /usr/bin/install -c .libs/libcryptopANT.so.1.0.3 /usr/local/lib/libcryptopANT.so.1.0.3
libtool: install: (cd /usr/local/lib && { ln -s -f libcryptopANT.so.1.0.3 libcryptopANT.so.1 || { rm -f libcryptopANT.so.1 && ln -s libcryptopANT.so.1.0.3 libcryptopANT.so.1; }; })
libtool: install: (cd /usr/local/lib && { ln -s -f libcryptopANT.so.1.0.3 libcryptopANT.so || { rm -f libcryptopANT.so && ln -s libcryptopANT.so.1.0.3 libcryptopANT.so; }; })
libtool: install: /usr/bin/install -c .libs/libcryptopANT.lai /usr/local/lib/libcryptopANT.la
libtool: install: /usr/bin/install -c .libs/libcryptopANT.a /usr/local/lib/libcryptopANT.a
libtool: install: chmod 644 /usr/local/lib/libcryptopANT.a
libtool: install: ranlib /usr/local/lib/libcryptopANT.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /usr/local/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/bin/mkdir -p '/usr/local/include'
/usr/bin/install -c -m 644 src/cryptopANT.h '/usr/local/include'
/bin/mkdir -p '/usr/local/share/man/man3'
/usr/bin/install -c -m 644 man/cryptopANT.3 '/usr/local/share/man/man3'
make[1]: Leaving directory '/usr/local/src/cryptopANT-1.2.2'