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

Building with glibc-1.31+ #293

Open
harpreetsc1992 opened this issue Apr 16, 2024 · 4 comments
Open

Building with glibc-1.31+ #293

harpreetsc1992 opened this issue Apr 16, 2024 · 4 comments

Comments

@harpreetsc1992
Copy link

harpreetsc1992 commented Apr 16, 2024

Hello,
I'm using a system with glibc-1.35. It seems that crypt.h has been deprecated from 1.31. Has anyone compiled dropbear with the newer glibc versions?
For context, these are the errors I'm getting:
_
In file included from src/options.h:29,
from src/includes.h:28,
from src/buffer.c:27:
src/sysoptions.h:297:36: warning: "HAVE_CRYPT" is not defined, evaluates to 0 [-Wundef]

297 | #if DROPBEAR_SVR_PASSWORD_AUTH && !HAVE_CRYPT
src/sysoptions.h:298:10: error: #error "DROPBEAR_SVR_PASSWORD_AUTH requires 'crypt()'."

298 | #error "DROPBEAR_SVR_PASSWORD_AUTH requires 'crypt()'."

In file included from src/options.h:29,
from src/includes.h:28,
from src/dbhelpers.c:2:
src/sysoptions.h:297:36: warning: "HAVE_CRYPT" is not defined, evaluates to 0 [-Wundef]
297 | #if DROPBEAR_SVR_PASSWORD_AUTH && !HAVE_CRYPT

src/sysoptions.h:298:10: error: #error "DROPBEAR_SVR_PASSWORD_AUTH requires 'crypt()'."
298 | #error "DROPBEAR_SVR_PASSWORD_AUTH requires 'crypt()'."

In file included from src/options.h:29,
from src/includes.h:28,
from src/dss.c:25:
src/sysoptions.h:297:36: warning: "HAVE_CRYPT" is not defined, evaluates to 0 [-Wundef]
297 | #if DROPBEAR_SVR_PASSWORD_AUTH && !HAVE_CRYPT

src/sysoptions.h:298:10: error: #error "DROPBEAR_SVR_PASSWORD_AUTH requires 'crypt()'."
298 | #error "DROPBEAR_SVR_PASSWORD_AUTH requires 'crypt()'."

In file included from src/options.h:29,
from src/includes.h:28,
from src/dbutil.c:64:
src/sysoptions.h:297:36: warning: "HAVE_CRYPT" is not defined, evaluates to 0 [-Wundef]
297 | #if DROPBEAR_SVR_PASSWORD_AUTH && !HAVE_CRYPT

src/sysoptions.h:298:10: error: #error "DROPBEAR_SVR_PASSWORD_AUTH requires 'crypt()'."
298 | #error "DROPBEAR_SVR_PASSWORD_AUTH requires 'crypt()'."

In file included from ./../src/options.h:29,
from src/headers/tomcrypt_dropbear.h:2,
from src/headers/tomcrypt_custom.h:13,
from src/headers/tomcrypt.h:22,
from src/ciphers/aes/aes.c:31:
./../src/sysoptions.h:297:36: warning: "HAVE_CRYPT" is not defined, evaluates to 0 [-Wundef]
297 | #if DROPBEAR_SVR_PASSWORD_AUTH && !HAVE_CRYPT

./../src/sysoptions.h:298:10: error: #error "DROPBEAR_SVR_PASSWORD_AUTH requires 'crypt()'."
298 | #error "DROPBEAR_SVR_PASSWORD_AUTH requires 'crypt()'."

In file included from ./../src/options.h:29,
from ./../src/dbmalloc.h:4,
from tommath_class.h:1322,
from tommath_class.h:1305,
from tommath_class.h:1305,
from tommath_class.h:1305,
from tommath_private.h:8,
from bn_cutoffs.c:1:
./../src/sysoptions.h:297:36: warning: "HAVE_CRYPT" is not defined, evaluates to 0 [-Wundef]
297 | #if DROPBEAR_SVR_PASSWORD_AUTH && !HAVE_CRYPT

./../src/sysoptions.h:298:10: error: #error "DROPBEAR_SVR_PASSWORD_AUTH requires 'crypt()'."
298 | #error "DROPBEAR_SVR_PASSWORD_AUTH requires 'crypt()'."
make[2]: *** [Makefile:246: src/ciphers/aes/aes.o] Error 1
make[2]: Leaving directory '/home/grads/h/harpreetsc/Documents/busybear-linux/build/dropbear-2024.84/libtomcrypt'
make[1]: *** [Makefile:255: libtomcrypt/libtomcrypt.a] Error 2
make[1]: *** Waiting for unfinished jobs....
riscv64-unknown-linux-gnu-gcc -c -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fPIE -Wundef -fno-strict-overflow -Wno-pointer-sign -Os -W -Wall -I. -I../libtomcrypt/src/headers/ -I./../libtomcrypt/src/headers/ -I../ -I./../src -Wno-deprecated -I./src/../libtomcrypt/src/headers/ -I. -I./src -DDROPBEAR_SERVER -DDROPBEAR_CLIENT -I./ -Wall -Wsign-compare -Wextra -Wshadow -Wdeclaration-after-statement -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wpointer-arith -Wsystem-headers -O3 -funroll-loops -fomit-frame-pointer bn_deprecated.c -o bn_deprecated.o
make[2]: *** [Makefile:40: bn_cutoffs.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:169: obj/dss.o] Error 1
make[1]: *** [Makefile:169: obj/buffer.o] Error 1
In file included from ./../src/options.h:29,
from ./../src/dbmalloc.h:4,
from tommath_class.h:1322,
from tommath_class.h:1305,
from tommath_class.h:1305,
from tommath_class.h:1305,
from tommath_private.h:8,
from bn_deprecated.c:1:
./../src/sysoptions.h:297:36: warning: "HAVE_CRYPT" is not defined, evaluates to 0 [-Wundef]
297 | #if DROPBEAR_SVR_PASSWORD_AUTH && !HAVE_CRYPT

./../src/sysoptions.h:298:10: error: #error "DROPBEAR_SVR_PASSWORD_AUTH requires 'crypt()'."
298 | #error "DROPBEAR_SVR_PASSWORD_AUTH requires 'crypt()'."

make[2]: *** [Makefile:40: bn_deprecated.o] Error 1
make[2]: Leaving directory '/home/grads/h/harpreetsc/Documents/busybear-linux/build/dropbear-2024.84/libtommath'
make[1]: *** [Makefile:258: libtommath/libtommath.a] Error 2
make[1]: *** [Makefile:169: obj/dbutil.o] Error 1
make[1]: *** [Makefile:169: obj/dbhelpers.o] Error 1
make[1]: Leaving directory '/home/grads/h/harpreetsc/Documents/busybear-linux/build/dropbear-2024.84'
make: *** [Makefile:10: busybear.bin] Error 2
_

Or am I just interpreting the error wrong?

@mkj
Copy link
Owner

mkj commented Apr 16, 2024

This sounds the same as #143 , does that help?

@mkj
Copy link
Owner

mkj commented Apr 17, 2024

What platform are you building on?
Building against libxcrypt should have worked. Can you look in config.log what is recorded when it looks for crypt?

@harpreetsc1992
Copy link
Author

@mkj Thanks for the quick replies.
My system is Linux 5.15.0-100-generic (Ubuntu Jammy) on an x86_64 system, gcc-11.4.0.

There seems to be checks at multiple places for crypt (along with other errors - which can again be version mismatch), and the message can get really long. I am attaching the config.log file with the message. Will it be okay to do so?
config.log

I am not sure where exactly I'm messing up.

@mkj
Copy link
Owner

mkj commented Apr 17, 2024

configure:5346: checking for crypt in -lcrypt
configure:5369: riscv64-unknown-linux-gnu-gcc -o conftest -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fPIE -Wundef -fno-strict-overflow -Wno-pointer-sign -Os -W -Wall  -Wl,-z,now -Wl,-z,relro -pie  conftest.c -lcrypt   >&5
/home/grads/h/harpreetsc/Documents/keystone/riscv/lib/gcc/riscv64-unknown-linux-gnu/13.2.0/../../../../riscv64-unknown-linux-gnu/bin/ld: cannot find -lcrypt: No such file or directory

It can't find libcrypt. Did libxcrypt get built for riscv64 and installed to a path that the riscv toolchain will find?

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

No branches or pull requests

2 participants