Problem building gpgmeutils.c.o in GVM-Lib 10.0.2 on CentOS 7 minimal

Trying to install gvm-libs from source on a CentOS 7 minimal install, I started with installing what I believe are the needed prerequisites for GVM libraries 10.0.2, OpenVAS Scanner 6.2.0, GVM 8.0.2 and GSA 8.0.2, per the install docs in those tarballs.

sudo yum install gcc cmake3 glib2-devel zlib-devel gpgme-devel gnutls-devel libuuid-devel libssh-devel openldap-devel hiredis-devel freeradius-devel doxygen xmltoman bison bison-devel flex flex-devel libgcrypt-devel libpcap-devel redis libksba-devel net-snmp-devel sqlite-devel libical-devel gnutls-utils libxslt-devel texinfo texlive libxml2-devel libmicrohttpd-devel python-polib rsync net-tools

Note: Before anyone asks, make and pkgconfig ARE on the system; as they’re part of the base install.

I expanded the source in my home, made a ‘build’ directory and inside that I ran what looked like a successful cmake … (to be precise, I ran a cmake3 … because the EL7 repo’s libssh-devel package has a dependency on regular cmake (which is 2.8) but cmake didn’t seem to mind being called as cmake3).

When I ran my make, though, while the gvm_base so built fine, I had problems building the object file gpgmeutils.c.o during the gvm_util so build. Here’s what I got from the make command:


Scanning dependencies of target gvm_base_shared
[ 2%] Building C object base/CMakeFiles/gvm_base_shared.dir/array.c.o
[ 5%] Building C object base/CMakeFiles/gvm_base_shared.dir/credentials.c.o
[ 8%] Building C object base/CMakeFiles/gvm_base_shared.dir/cvss.c.o
[ 11%] Building C object base/CMakeFiles/gvm_base_shared.dir/drop_privileges.c.o
[ 14%] Building C object base/CMakeFiles/gvm_base_shared.dir/hosts.c.o
[ 17%] Building C object base/CMakeFiles/gvm_base_shared.dir/logging.c.o
[ 20%] Building C object base/CMakeFiles/gvm_base_shared.dir/networking.c.o
[ 23%] Building C object base/CMakeFiles/gvm_base_shared.dir/nvti.c.o
[ 26%] Building C object base/CMakeFiles/gvm_base_shared.dir/pidfile.c.o
[ 29%] Building C object base/CMakeFiles/gvm_base_shared.dir/prefs.c.o
[ 32%] Building C object base/CMakeFiles/gvm_base_shared.dir/proctitle.c.o
[ 35%] Building C object base/CMakeFiles/gvm_base_shared.dir/pwpolicy.c.o
[ 38%] Building C object base/CMakeFiles/gvm_base_shared.dir/settings.c.o
[ 41%] Building C object base/CMakeFiles/gvm_base_shared.dir/strings.c.o
[ 44%] Linking C shared library libgvm_base.so
[ 44%] Built target gvm_base_shared
Scanning dependencies of target gvm_util_shared
[ 47%] Building C object util/CMakeFiles/gvm_util_shared.dir/authutils.c.o
[ 50%] Building C object util/CMakeFiles/gvm_util_shared.dir/compressutils.c.o
[ 52%] Building C object util/CMakeFiles/gvm_util_shared.dir/fileutils.c.o
[ 55%] Building C object util/CMakeFiles/gvm_util_shared.dir/gpgmeutils.c.o
In file included from /home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:25:0:
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.h:47:29: error: unknown type name ‘gpgme_data_type_t’
gpgme_data_type_t);
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c: In function ‘gvm_gpg_import_many_types_from_string’:
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:187:3: error: unknown type name ‘gpgme_data_type_t’
gpgme_data_type_t given_key_type;
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:195:3: error: implicit declaration of function ‘gpgme_data_identify’ [-Werror=implicit-function-declaration]
given_key_type = gpgme_data_identify (key_data, 0);
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:197:25: error: ‘GPGME_DATA_TYPE_INVALID’ undeclared (first use in this function)
if (given_key_type == GPGME_DATA_TYPE_INVALID)
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:197:25: note: each undeclared identifier is reported only once for each function it appears in
In file included from /usr/include/glib-2.0/glib.h:31:0,
from /home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.h:30,
from /home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:25:
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:207:41: error: ‘gpgme_data_type_t’ undeclared (first use in this function)
if (g_array_index (key_types, gpgme_data_type_t, index)
^
/usr/include/glib-2.0/glib/garray.h:67:38: note: in definition of macro ‘g_array_index’
#define g_array_index(a,t,i) (((t*) (void ) (a)->data) [(i)])
^
/usr/include/glib-2.0/glib/garray.h:67:40: error: expected expression before ‘)’ token
#define g_array_index(a,t,i) (((t
) (void ) (a)->data) [(i)])
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:207:15: note: in expansion of macro ‘g_array_index’
if (g_array_index (key_types, gpgme_data_type_t, index)
^
/usr/include/glib-2.0/glib/garray.h:67:40: error: expected expression before ‘)’ token
#define g_array_index(a,t,i) (((t
) (void *) (a)->data) [(i)])
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:222:39: note: in expansion of macro ‘g_array_index’
g_array_index (key_types,
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c: At top level:
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:283:46: error: unknown type name ‘gpgme_data_type_t’
ssize_t key_len, gpgme_data_type_t key_type)
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c: In function ‘create_all_certificates_trustlist’:
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:425:3: error: implicit declaration of function ‘gpgme_set_pinentry_mode’ [-Werror=implicit-function-declaration]
gpgme_set_pinentry_mode (ctx, GPGME_PINENTRY_MODE_CANCEL);
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:425:33: error: ‘GPGME_PINENTRY_MODE_CANCEL’ undeclared (first use in this function)
gpgme_set_pinentry_mode (ctx, GPGME_PINENTRY_MODE_CANCEL);
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:437:63: error: ‘struct _gpgme_key’ has no member named ‘fpr’
g_string_append_printf (trustlist_content, “%s S\n”, key->fpr);
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c: In function ‘encrypt_stream_internal’:
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:518:48: error: ‘GPGME_ENCRYPT_NO_COMPRESS’ undeclared (first use in this function)
encrypt_flags = GPGME_ENCRYPT_ALWAYS_TRUST | GPGME_ENCRYPT_NO_COMPRESS;
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c: In function ‘gvm_pgp_pubkey_encrypt_stream’:
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:609:3: error: unknown type name ‘gpgme_data_type_t’
const gpgme_data_type_t types_ptr[1] = {GPGME_DATA_TYPE_PGP_KEY};
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:609:43: error: ‘GPGME_DATA_TYPE_PGP_KEY’ undeclared (first use in this function)
const gpgme_data_type_t types_ptr[1] = {GPGME_DATA_TYPE_PGP_KEY};
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:610:58: error: ‘gpgme_data_type_t’ undeclared (first use in this function)
GArray *key_types = g_array_new (FALSE, FALSE, sizeof (gpgme_data_type_t));
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c: In function ‘gvm_smime_encrypt_stream’:
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:640:3: error: unknown type name ‘gpgme_data_type_t’
const gpgme_data_type_t types_ptr[2] = {GPGME_DATA_TYPE_X509_CERT,
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:640:43: error: ‘GPGME_DATA_TYPE_X509_CERT’ undeclared (first use in this function)
const gpgme_data_type_t types_ptr[2] = {GPGME_DATA_TYPE_X509_CERT,
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:641:43: error: ‘GPGME_DATA_TYPE_CMS_OTHER’ undeclared (first use in this function)
GPGME_DATA_TYPE_CMS_OTHER};
^
/home/sawozny/gvm-libs-10.0.2/util/gpgmeutils.c:642:58: error: ‘gpgme_data_type_t’ undeclared (first use in this function)
GArray *key_types = g_array_new (FALSE, FALSE, sizeof (gpgme_data_type_t));
^
cc1: all warnings being treated as errors
make[2]: *** [util/CMakeFiles/gvm_util_shared.dir/gpgmeutils.c.o] Error 1
make[1]: *** [util/CMakeFiles/gvm_util_shared.dir/all] Error 2
make: *** [all] Error 2


Assuming the code is good, I went looking at whatever I could find referenced in the errors around my environment to see if I could find an issue, but I can’t. My gpgme-devel package is 1.3.2-5.el7 and my glib2-devel package is 2.56.1-5.el7 which both appear to meet the minimum requirements and nothing else seems to be referenced in the build output.

Has anyone run into this before and do you have any suggestions on how to fix it?

Thanks,

Scott

Sorry, any semblance of the spacing / formatting seems to have been lost when posting (it wasn’t great before but at least there were leading spaces trying to keep things in line which have been stripped out).

If it reads too poorly to be of any use I can try again if I can figure out how to use the preformatted text tagging in this forum.

Also, when I say cmake (or cmake3) dot dot the forum added an extra dot. I only had 2 dots in my post which seemed to be correct (and built the base so fine). :slight_smile:

Thanks,

Scott

Quick follow-up on this. I did some further digging and noticed that a lot of the errors were centered around gpgme data type types and functions so I asked myself, “When were these types introduced into gpgme?”

I assumed since the requirement is version 1.1.2 and CentOS 7 comes with 1.3.2-5 there wouldn’t be a problem, but it turns out that per https://gnupg.org/documentation/manuals/gpgme.pdf, gpgme_data_type_t, the GPGME_DATA_TYPE_INVALID, GPGME_DATA_TYPE_PGP_KEY, GPGME_DATA_TYPE_X509_CERT & GPGME_DATA_TYPE_CMS_OTHER types themselves as well as the gpgme_data_identify function were all introduced in version 1.4.3. I was hoping the update to 1.4.3 got backported into one of those 5 updates the RH package managers made to their builds of 1.3.2, but I guess not. So. I suppose this means I’ll need to update gpgme from source.

Not sure if anyone at Greenbone is doing any adjustments to gvm-libs 10.0.2, but if you are, the source package should probably be updated to reflect this including the INSTALL.md and the GPG_MIN_VERSION in util/CmakeLists.txt.

I’ll report back on whether the upgrade of libgpgme fixes my build problems.

Thanks,

Scott

Quick follow up on this. The gpgme update to 1.4.3 got rid of most of the compiler errors, but a couple were left.

error: ‘struct _gpgme_key’ has no member named ‘fpr’ needs gpgme 1.7.0 to resolve (which was also noted in https://github.com/greenbone/gvm-libs/issues/329 and Gvm-libs 10 / 11 - latest release branch gpgme compilation error) so the GPG_MIN_VERSION in the CMake config really ought to be fixed as this should have been caught before trying to build.

Interestingly enough, even though gvmlibs built and installed with no issues when I moved on to building OpenVAS scanner, the CMake failed with:

– Checking for module ‘libgvm_base>=10.0.0’
– No package ‘libgvm_base’ found
CMake Error at /usr/share/cmake3/Modules/FindPkgConfig.cmake:467 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake3/Modules/FindPkgConfig.cmake:647 (_pkg_check_modules_internal)
misc/CMakeLists.txt:31 (pkg_check_modules)

– Configuring incomplete, errors occurred!
See also “/home/sawozny/openvas-6.0.2/build/CmakeFiles/CmakeOutput.log”.

Even though gvmlibs appear to be installed and accessible:

[sawozny@openvas build]$ ldconfig -p | grep gvm
libgvm_util.so.10 (libc6,x86-64) => /usr/local/lib64/libgvm_util.so.10
libgvm_util.so (libc6,x86-64) => /usr/local/lib64/libgvm_util.so
libgvm_osp.so.10 (libc6,x86-64) => /usr/local/lib64/libgvm_osp.so.10
libgvm_osp.so (libc6,x86-64) => /usr/local/lib64/libgvm_osp.so
libgvm_gmp.so.10 (libc6,x86-64) => /usr/local/lib64/libgvm_gmp.so.10
libgvm_gmp.so (libc6,x86-64) => /usr/local/lib64/libgvm_gmp.so
libgvm_base.so.10 (libc6,x86-64) => /usr/local/lib64/libgvm_base.so.10
libgvm_base.so (libc6,x86-64) => /usr/local/lib64/libgvm_base.so
[sawozny@openvas build]$ ls -la /usr/local/lib64
total 456
drwxr-xr-x. 3 root root 4096 Jul 12 21:21 .
drwxr-xr-x. 13 root root 4096 Jul 12 21:21 …
lrwxrwxrwx. 1 root root 17 Jul 12 21:21 libgvm_base.so -> libgvm_base.so.10
lrwxrwxrwx. 1 root root 21 Jul 12 21:21 libgvm_base.so.10 -> libgvm_base.so.10.0.2
-rwxr-xr-x. 1 root root 141808 Jul 12 21:18 libgvm_base.so.10.0.2
lrwxrwxrwx. 1 root root 16 Jul 12 21:21 libgvm_gmp.so -> libgvm_gmp.so.10
lrwxrwxrwx. 1 root root 20 Jul 12 21:21 libgvm_gmp.so.10 -> libgvm_gmp.so.10.0.2
-rwxr-xr-x. 1 root root 50680 Jul 12 21:18 libgvm_gmp.so.10.0.2
lrwxrwxrwx. 1 root root 16 Jul 12 21:21 libgvm_osp.so -> libgvm_osp.so.10
lrwxrwxrwx. 1 root root 20 Jul 12 21:21 libgvm_osp.so.10 -> libgvm_osp.so.10.0.2
-rwxr-xr-x. 1 root root 30304 Jul 12 21:18 libgvm_osp.so.10.0.2
lrwxrwxrwx. 1 root root 17 Jul 12 21:21 libgvm_util.so -> libgvm_util.so.10
lrwxrwxrwx. 1 root root 21 Jul 12 21:21 libgvm_util.so.10 -> libgvm_util.so.10.0.2
-rwxr-xr-x. 1 root root 223192 Jul 12 21:18 libgvm_util.so.10.0.2
drwxr-xr-x. 2 root root 4096 Jul 12 21:21 pkgconfig

I guess that one is a problem for another day.

Thanks,

Scott