简体   繁体   中英

Macro not found in libgcrypt on Centos 7

I have a C program that uses libgcrypt . I put this string in the builder to install the libraries for Centos 7:

yum -y install json-c-devel expat-devel libpcap-devel flex-devel automake libtool bison libuv-devel openssl-devel libgcrypt-devel

and no problem come out.

Unfortunately, the compilation of the code terminate with an error caused by a macro cannot be found:

error: 'GCRY_CIPHER_MODE_GCM' undeclared (first use in this function)

The macro is inside the libgcrypt for sure, so I really don't understand how cannot be found at all.

If I compile the same code in Debian, it works well and the macro is resolved properly.

PS My system is Debian 8 and I use docker for Centos 7

CentOS-7 uses libgcrypt and libgcrypt-devel version 1.5 (patched), which seems to not include GCRY_CIPHER_MODE_GCM declaration.

Looking at the git commits, it seems to have been available in 1.6+.

https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=90cce18b9eced4f412ceeec5bcae18c4493322df

On a newer version, you would see a line in /usr/include/gcrypt.h , like the following:

GCRY_CIPHER_MODE_GCM      = 9,   /* Galois Counter Mode. */

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM