ppp icon indicating copy to clipboard operation
ppp copied to clipboard

auth.c:893: undefined reference to `crypt'

Open ptorrent opened this issue 2 years ago • 5 comments

Hey there !

I'm not able to compile from source

./configure
make

auth.c:893: undefined reference to `crypt'

Is there a way to solve this issue ?

Thanks a lot for your support !

ptorrent avatar Jan 12 '22 16:01 ptorrent

We will need more information to be able to help you. Are you compiling a release, or if not, what is the git SHA1 id of the commit you are trying to build from?

What operating system and version are you using? Are you cross-compiling and if so for what architecture and OS?

If you are building from git commit ab4d4992050e (24 July 2021) or later, please attach the config.log that was produced by the ./configure step.

paulusmack avatar Jan 13 '22 07:01 paulusmack

@ptorrent: Have you seen the comment of @paulusmack?

Neustradamus avatar Mar 29 '22 00:03 Neustradamus

At the moment, this should only happen if you try to compile without openssl. This means, if you didn't specify --without-openssl to configure, then you don't have the openssl headers installed.

Glibc 2.27 removed the crypt / des functions, and we don't have a replacement for these. We'll have to find a replacement other than libcrypt (via glibc).

enaess avatar Jul 30 '22 21:07 enaess

At the moment, this should only happen if you try to compile without openssl. This means, if you didn't specify --without-openssl to configure, then you don't have the openssl headers installed.

Glibc 2.27 removed the crypt / des functions, and we don't have a replacement for these. We'll have to find a replacement other than libcrypt (via glibc).

EDIT: Ah, I see, glibc still provides crypt(3), but we need encrypt(3) and setkey(3)! :(

thesamesam avatar Aug 01 '22 05:08 thesamesam

I can reproduce a failure, no idea if it's the same one, when I build with ./configure --without-openssl --disable-eaptls --disable-peap:

/bin/sh ../libtool  --tag=CC   --mode=link gcc  -g -O2  -Wl,-E    -o pppd pppd-auth.o pppd-ccp.o pppd-chap-md5.o pppd-chap-new.o pppd-demand.o pppd-eap.o pppd-ecp.o pppd-fsm.o pppd-ipcp.o pppd-lcp.o pppd-magic.o pppd-main.o pppd-options.o pppd-session.o pppd-tty.o pppd-upap.o pppd-utils.o pppd-sys-linux.o  pppd-chap_ms.o pppd-pppcrypt.o   pppd-mppe.o   pppd-ipv6cp.o pppd-eui64.o    -lcrypt   -lpcap -ldl -lpam -ldl libppp_crypt.la
libtool: link: gcc -g -O2 -Wl,-E -o pppd pppd-auth.o pppd-ccp.o pppd-chap-md5.o pppd-chap-new.o pppd-demand.o pppd-eap.o pppd-ecp.o pppd-fsm.o pppd-ipcp.o pppd-lcp.o pppd-magic.o pppd-main.o pppd-options.o pppd-session.o pppd-tty.o pppd-upap.o pppd-utils.o pppd-sys-linux.o pppd-chap_ms.o pppd-pppcrypt.o pppd-mppe.o pppd-ipv6cp.o pppd-eui64.o  -lcrypt -lpcap -lpam -ldl ./.libs/libppp_crypt.a
/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: pppd-pppcrypt.o: in function `DesSetkey':
/home/sam/git/ppp/pppd/pppcrypt.c:120: undefined reference to `setkey'
/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: pppd-pppcrypt.o: in function `DesEncrypt':
/home/sam/git/ppp/pppd/pppcrypt.c:133: undefined reference to `encrypt'
/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.1/../../../../x86_64-pc-linux-gnu/bin/ld: pppd-pppcrypt.o: in function `DesDecrypt':
/home/sam/git/ppp/pppd/pppcrypt.c:147: undefined reference to `encrypt'

thesamesam avatar Aug 01 '22 06:08 thesamesam

@ptorrent, @thesamesam, @paulusmack: Have you seen the @enaess PR?

  • https://github.com/ppp-project/ppp/pull/362

Neustradamus avatar Aug 15 '22 18:08 Neustradamus

No, I hadn't! Thanks @Neustradamus. I'll take a look.

thesamesam avatar Aug 15 '22 19:08 thesamesam