lsh123 / xmlsec

XML Security Library
Other
127 stars 97 forks source link

gnutls error when compiling on Ubuntu 20.04 #797

Closed skoobasteeve closed 4 weeks ago

skoobasteeve commented 4 weeks ago

I'm getting the below error trying to build xmlsec:master on Ubuntu 20.04:

Making all in gnutls
make[3]: Entering directory '/home/runner/work/xmlsec/xmlsec/build.dir/src/gnutls'
  CC       libxmlsec1_gnutls_la-app.lo
  CC       libxmlsec1_gnutls_la-ciphers_cbc.lo
  CC       libxmlsec1_gnutls_la-ciphers_gcm.lo
../../../src/gnutls/ciphers_gcm.c: In function ‘xmlSecGnuTLSGcmCipherInitialize’:
../../../src/gnutls/ciphers_gcm.c:[111](https://github.com/ycharts/xmlsec/actions/runs/9420517246/job/25952742323#step:6:112):27: error: ‘GNUTLS_CIPHER_AES_192_GCM’ undeclared (first use in this function); did you mean ‘GNUTLS_CIPHER_AES_128_GCM’?
  111 |         ctx->algorithm  = GNUTLS_CIPHER_AES_192_GCM;
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                           GNUTLS_CIPHER_AES_128_GCM
../../../src/gnutls/ciphers_gcm.c:111:27: note: each undeclared identifier is reported only once for each function it appears in
make[3]: *** [Makefile:680: libxmlsec1_gnutls_la-ciphers_gcm.lo] Error 1
make[3]: Leaving directory '/home/runner/work/xmlsec/xmlsec/build.dir/src/gnutls'
make[2]: *** [Makefile:740: all-recursive] Error 1
make[2]: Leaving directory '/home/runner/work/xmlsec/xmlsec/build.dir/src'
make[1]: *** [Makefile:762: all-recursive] Error 1
make[1]: Leaving directory '/home/runner/work/xmlsec/xmlsec/build.dir'
make: *** [Makefile:580: all] Error 2

If I use the --without-gnutls flag, I don't get this error and the build completes, but I would like to include it if possible. Any ideas?

Thank you!

lsh123 commented 4 weeks ago

Probably got added to GnuTLS after the Ubuntu 20.04 was released:

https://github.com/gnutls/gnutls/commit/2e0f47858fd85dbb4ffa1cd0c741b3b1ff7203fe

Upgrade gnutls library or upgrade Ubuntu. Sorry, nothing else I can suggest. You can also disable AES:

https://github.com/lsh123/xmlsec/blob/243afff94c6eb468bec96e9637e0f1c6fe6da445/configure.ac#L2182

but it will disable it for ALL crypto libraries (not just GnuTLS) which is probably a bad idea.

skoobasteeve commented 3 weeks ago

@lsh123 thanks for following up! I'll play around with it and maybe try the 1.2.x branch.