Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openSUSE build error: undefined reference to `EC_POINT_{set|get}_affine_coordinates_GF2m #31

Closed
alexander-naumov opened this issue Jan 20, 2021 · 4 comments · Fixed by #32

Comments

@alexander-naumov
Copy link
Contributor

Hello,
I get this error by trying to build OpenIKED on openSUSE TW.

$ make
[ 22%] Built target compat
[ 23%] Building C object iked/CMakeFiles/iked-shared.dir/ikev2_pld.c.o
[ 25%] Building C object iked/CMakeFiles/iked-shared.dir/imsg_util.c.o
[ 27%] Building C object iked/CMakeFiles/iked-shared.dir/log.c.o
[ 28%] Building C object iked/CMakeFiles/iked-shared.dir/util.c.o
[ 30%] Building C object iked/CMakeFiles/iked-shared.dir/ikev2_map.c.o
[ 32%] Building C object iked/CMakeFiles/iked-shared.dir/eap_map.c.o
[ 35%] Built target iked-shared
[ 37%] Generating parse.c
Scanning dependencies of target iked
[ 38%] Building C object iked/CMakeFiles/iked.dir/ipsec.c.o
[ 40%] Building C object iked/CMakeFiles/iked.dir/pfkey.c.o
[ 42%] Building C object iked/CMakeFiles/iked.dir/ca.c.o
[ 44%] Building C object iked/CMakeFiles/iked.dir/chap_ms.c.o
[ 45%] Building C object iked/CMakeFiles/iked.dir/config.c.o
[ 47%] Building C object iked/CMakeFiles/iked.dir/control.c.o
[ 49%] Building C object iked/CMakeFiles/iked.dir/crypto.c.o
[ 50%] Building C object iked/CMakeFiles/iked.dir/dh.c.o
/home/alex/github/openiked-portable/iked/dh.c: In function ‘ec_point2raw’:
/home/alex/github/openiked-portable/iked/dh.c:618:8: warning: implicit declaration of function ‘EC_POINT_get_affine_coordinates_GF2m’; did you mean ‘EC_POINT_get_affine_coordinates_GFp’? [-Wimplicit-function-declaration]
  618 |   if (!EC_POINT_get_affine_coordinates_GF2m(ecgroup,
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |        EC_POINT_get_affine_coordinates_GFp
/home/alex/github/openiked-portable/iked/dh.c: In function ‘ec_raw2point’:
/home/alex/github/openiked-portable/iked/dh.c:686:8: warning: implicit declaration of function ‘EC_POINT_set_affine_coordinates_GF2m’; did you mean ‘EC_POINT_set_affine_coordinates_GFp’? [-Wimplicit-function-declaration]
  686 |   if (!EC_POINT_set_affine_coordinates_GF2m(ecgroup,
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |        EC_POINT_set_affine_coordinates_GFp
[ 52%] Building C object iked/CMakeFiles/iked.dir/eap.c.o
[ 54%] Building C object iked/CMakeFiles/iked.dir/iked.c.o
[ 55%] Building C object iked/CMakeFiles/iked.dir/ikev2.c.o
[ 57%] Building C object iked/CMakeFiles/iked.dir/ikev2_msg.c.o
[ 59%] Building C object iked/CMakeFiles/iked.dir/ocsp.c.o
[ 61%] Building C object iked/CMakeFiles/iked.dir/policy.c.o
[ 62%] Building C object iked/CMakeFiles/iked.dir/proc.c.o
[ 64%] Building C object iked/CMakeFiles/iked.dir/smult_curve25519_ref.c.o
[ 66%] Building C object iked/CMakeFiles/iked.dir/timer.c.o
[ 67%] Building C object iked/CMakeFiles/iked.dir/parse.c.o
[ 69%] Linking C executable iked
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: CMakeFiles/iked.dir/dh.c.o: in function `ec_point2raw':
dh.c:(.text+0x7cb): undefined reference to `EC_POINT_get_affine_coordinates_GF2m'
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: CMakeFiles/iked.dir/dh.c.o: in function `ec_raw2point':
dh.c:(.text+0xa7e): undefined reference to `EC_POINT_set_affine_coordinates_GF2m'
collect2: error: ld returned 1 exit status
make[2]: *** [iked/CMakeFiles/iked.dir/build.make:400: iked/iked] Error 1
make[1]: *** [CMakeFiles/Makefile2:202: iked/CMakeFiles/iked.dir/all] Error 2
make: *** [Makefile:149: all] Error 2

changing these to *_GFp fixed the build problem. The question is: do we need this patch for openSUSE? Does it works on other GNU systems like Debian?

@tobhe
Copy link
Member

tobhe commented Jan 20, 2021

Our CI builds on Ubuntu and Debian and I'm locally developing on Arch without problems. What version of OpenSSL is installed on your system?

@tobhe
Copy link
Member

tobhe commented Jan 20, 2021

According to: https://www.openssl.org/docs/man1.1.1/man3/EC_POINT_set_affine_coordinates_GFp.html

The functions EC_POINT_set_affine_coordinates_GFp() and EC_POINT_set_affine_coordinates_GF2m() are synonyms for EC_POINT_set_affine_coordinates(). They are defined for backwards compatibility only and should not be used.

EDIT:
It looks like libressl does not support EC_POINT_set_affine_coordinates() but EC_POINT_set_affine_coordinates_GFp(), so we should probably use the second to make everyone happy.

@alexander-naumov
Copy link
Contributor Author

Our CI builds on Ubuntu and Debian and I'm locally developing on Arch without problems. What version of OpenSSL is installed on your system?

$ rpm -qa *openssl*
openssl-1_1-1.1.1h-2.1.x86_64
libopenssl1_1-1.1.1h-2.1.x86_64
openssl-1.1.1h-1.1.noarch
libopenssl-1_1-devel-1.1.1h-2.1.x86_64
libopenssl-devel-1.1.1h-1.1.noarch

@tobhe
Copy link
Member

tobhe commented Jan 20, 2021

So looking at the code it seems Suse builds OpenSSL with -DOPENSSL_NO_EC2M which disables _GF2m(). Also _GF2m() and _GF2p() are actually identical.

EDIT: Here's the upstream discussion openssl/openssl#6815

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants