Project

General

Profile

Bug #2505

Compatibility of gmp plugin with old libgmp versions

Added by G. V. almost 3 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
libstrongswan
Target version:
Start date:
03.01.2018
Due date:
Estimated time:
Affected version:
5.6.1
Resolution:
Fixed

Description

Hi!

The gmp library version on CentOS 6 (aka RHEL 6) is 4.3.1.

configure script detect this and does not define HAVE_MPZ_POWM_SEC in config.h.
Still, calculate_pq() function from src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c file use mpz_powm_sec() and not the macro mpz_powm. calculate_pq also use mpz_inits(). Both are not available in gmp 4.3.1.

Now I have to compile gmp 6.0.0 static, strongswan complain that it cannot be used without -fPIC flag which force me to compile gmp with --enable-assembly=no (very slow!).

Can you fix this?
Thank you!

Sincerely,
Gabriel

Associated revisions

Revision 4a84fb07 (diff)
Added by Tobias Brunner over 2 years ago

gmp: Fix compatibility with older libgmp releases

Older releases don't have mpz_powm_sec() and mpz_inits() yet.

Fixes #2505.

History

#1 Updated by G. V. almost 3 years ago

One more thing: the compile does not fail. Starting strongswan does not work:
charon: 00[LIB] plugin 'gmp' failed to load: /usr/lib64/ipsec/plugins/libstrongswan-gmp.so: undefined symbol: mpz_powm_sec

#2 Updated by Tobias Brunner almost 3 years ago

  • Subject changed from gmp library to Compatibility of gmp plugin with old libgmp versions
  • Status changed from New to Feedback
  • Priority changed from High to Normal
  • Target version set to 5.6.2

configure script detect this and does not define HAVE_MPZ_POWM_SEC in config.h.

The configure script actually checks if mpz_powm_sec is available, it does not check the version.

Still, calculate_pq() function from src/libstrongswan/plugins/gmp/gmp_rsa_private_key.c file use mpz_powm_sec() and not the macro mpz_powm.

True, I've changed that in the 2505-gmp-old branch.

calculate_pq also use mpz_inits(). Both are not available in gmp 4.3.1.

Unfortunate, as that makes this quite a bit easier, but I guess we can just use individual mpz_init() calls.

Generally, I'd not recommend the use of a version of libgmp that does not yet support mpz_powem_sec().

#3 Updated by Tobias Brunner over 2 years ago

  • Status changed from Feedback to Closed
  • Assignee set to Tobias Brunner
  • Resolution set to Fixed

Also available in: Atom PDF