| Summary: | Android doesn't provide an implementation of crypt(). | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Nathan Osman <nathan.osman> | ||||||
| Component: | Build system | Assignee: | Assigned to nobody <unassigned-bugs> | ||||||
| Status: | CLOSED FIXED | ||||||||
| Severity: | minor | CC: | dtucker | ||||||
| Priority: | P5 | ||||||||
| Version: | 6.2p1 | ||||||||
| Hardware: | Other | ||||||||
| OS: | Linux | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 2076 | ||||||||
| Attachments: |
|
||||||||
Actually I made a mistake in describing my patch - the first two steps are reversed. First a check for OpenSSL is made and then DES_crypt is used only if crypt is missing. I wasn't sure which order to do things in. I can reverse the '#if defined' lines if needed. Comment on attachment 2284 [details] Use OpenSSL DES_crypt function as a drop-in replacement for crypt(). >+# if defined(HAVE_OPENSSL) openssl is mandatory so there's no point checking for this (I'm not sure why configure even sets it). >+# if !defined(HAVE_CRYPT_H) you don't really care whether or not crypt.h exists, what you really care about is whether or not you have a crypt function, so that's what you should be checking for. I'll attach a modified patch shortly. Created attachment 2288 [details]
Use OpenSSL DES_crypt function as a drop-in replacement for crypt().
Please try this. note that you'll need to run "autoreconf" to rebuild configure before running ./configure.
I applied the patch on a clean copy of the OpenSSH source code and can confirm that it solves the problem. Thanks! Patch applied, thanks. Set all RESOLVED bugs to CLOSED with release of OpenSSH 7.1 |
Created attachment 2284 [details] Use OpenSSL DES_crypt function as a drop-in replacement for crypt(). The Android platform does not provide a crypt() function (crypt.h does not exist) and therefore the following error is produced when attempting to link xcrypt.o from the openbsd-compat library: libopenbsd-compat.a(xcrypt.o): in function xcrypt:xcrypt.c:78: error: undefined reference to 'crypt' However, OpenSSL includes an implementation of crypt in the libcrypto library. I have attached a small patch that: - checks if crypt.h is available - if not, checks if openssl is available - uses a #define to point crypt to DES_crypt