[GH-ISSUE #1865] ./configure does not add the path to openssl header files in generated Makefile on OSX #1239

Closed
opened 2026-10-14 03:40:39 +07:00 by bsakaguchi · 4 comments
Owner

Originally created by @thecommandline on GitHub (Oct 30, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1865

Originally assigned to: @magnumripper on GitHub.

On OSX the Makefile created by ./configure is missing the path to the openssl header files.

make clean && make -s
rm -f ../run/john ../run/unshadow ../run/unafs ../run/unique ../run/undrop ../run/rar2john ../run/zip2john ../run/genmkvpwd ../run/mkvcalcproba ../run/calc_stat ../run/tgtsnarf ../run/racf2john ../run/hccap2john ../run/raw2dyna ../run/keepass2john ../run/dmg2john ../run/putty2john ../run/uaf2john ../run/wpapcap2john ../run/luks2john ../run/gpg2john ../run/cprepair ../run/base64conv ../run/pfx2john ../run/ssh2john ../run/SIPdump ../run/vncpcap2john
rm -f john-macosx-* *.o escrypt/*.o *.bak core
rm -f ../run/kernels/*
rm -f detect bench generic.h tmp.s
rm -f cuda/*.o cuda/*~ *~
cp /dev/null Makefile.dep
/usr/bin/find . -name \*.a -exec /bin/rm -f {} \;
/usr/bin/find . -name \*.o -exec /bin/rm -f {} \;
/bin/rm -f tests crypto_scrypt-best.o crypto_scrypt-common.o sha256.o tests.o crypto_scrypt-*.o
In file included from md5.c:25:
./md5.h:25:10: fatal error: 'openssl/md5.h' file not found
#include <openssl/md5.h>
         ^
1 error generated.
make[1]: *** [md5.o] Error 1
make: *** [default] Error 2

If I manually add the path to the Makefile it compiles and runs successfully. I am assuming this is the default system one installed with xCode but I cant say with 100% certainty.

CPPFLAGS =  -I/usr/local/include -I/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdk/MacOSX.sdk/usr/include

Alternatively I can use the homebrew version which is a much nicer path but dependent on homebrew having installed openssl.

CPPFLAGS =  -I/usr/local/include -I/usr/local//Cellar/openssl/1.0.2d_1/include/

Here is some additional system info:

$ xcodebuild -version
Xcode 7.1
Build version 7B91b

$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.11.1
BuildVersion:   15B42

This is from a successful build after manually adding the openssl include path (the one under the Xcode.app dir path).

./john --list=build-info
Version: 1.8.0-jumbo-1-4148-gff38778
Build: darwin15.0.0 64-bit AVX-ac MPI
SIMD: AVX, interleaving: MD4:4 MD5:5 SHA1:2 SHA256:1 SHA512:1
$JOHN is ./
Format interface version: 13
Max. number of reported tunable costs: 3
Rec file version: REC4
Charset file version: CHR3
CHARSET_MIN: 1 (0x01)
CHARSET_MAX: 255 (0xff)
CHARSET_LENGTH: 24
SALT_HASH_SIZE: 1048576
Max. Markov mode level: 400
Max. Markov mode password length: 30
clang version: 7.0.0 (clang-700.1.76) (gcc 4.2.1 compatibility)
Crypto library: OpenSSL
OpenSSL library version: 0009081df
OpenSSL 0.9.8zd 8 Jan 2015  (loaded: OpenSSL 0.9.8zg 14 July 2015)
GMP library version: 6.0.0
File locking: fcntl()
fseek(): fseek
ftell(): ftell
fopen(): fopen
memmem(): System's
Originally created by @thecommandline on GitHub (Oct 30, 2015). Original GitHub issue: https://github.com/openwall/john/issues/1865 Originally assigned to: @magnumripper on GitHub. On OSX the Makefile created by ./configure is missing the path to the openssl header files. ``` make clean && make -s rm -f ../run/john ../run/unshadow ../run/unafs ../run/unique ../run/undrop ../run/rar2john ../run/zip2john ../run/genmkvpwd ../run/mkvcalcproba ../run/calc_stat ../run/tgtsnarf ../run/racf2john ../run/hccap2john ../run/raw2dyna ../run/keepass2john ../run/dmg2john ../run/putty2john ../run/uaf2john ../run/wpapcap2john ../run/luks2john ../run/gpg2john ../run/cprepair ../run/base64conv ../run/pfx2john ../run/ssh2john ../run/SIPdump ../run/vncpcap2john rm -f john-macosx-* *.o escrypt/*.o *.bak core rm -f ../run/kernels/* rm -f detect bench generic.h tmp.s rm -f cuda/*.o cuda/*~ *~ cp /dev/null Makefile.dep /usr/bin/find . -name \*.a -exec /bin/rm -f {} \; /usr/bin/find . -name \*.o -exec /bin/rm -f {} \; /bin/rm -f tests crypto_scrypt-best.o crypto_scrypt-common.o sha256.o tests.o crypto_scrypt-*.o In file included from md5.c:25: ./md5.h:25:10: fatal error: 'openssl/md5.h' file not found #include <openssl/md5.h> ^ 1 error generated. make[1]: *** [md5.o] Error 1 make: *** [default] Error 2 ``` If I manually add the path to the Makefile it compiles and runs successfully. I am assuming this is the default system one installed with xCode but I cant say with 100% certainty. ``` CPPFLAGS = -I/usr/local/include -I/Applications/Xcode.app//Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdk/MacOSX.sdk/usr/include ``` Alternatively I can use the homebrew version which is a much nicer path but dependent on homebrew having installed openssl. ``` CPPFLAGS = -I/usr/local/include -I/usr/local//Cellar/openssl/1.0.2d_1/include/ ``` Here is some additional system info: ``` $ xcodebuild -version Xcode 7.1 Build version 7B91b $ sw_vers ProductName: Mac OS X ProductVersion: 10.11.1 BuildVersion: 15B42 ``` This is from a successful build after manually adding the openssl include path (the one under the Xcode.app dir path). ``` ./john --list=build-info Version: 1.8.0-jumbo-1-4148-gff38778 Build: darwin15.0.0 64-bit AVX-ac MPI SIMD: AVX, interleaving: MD4:4 MD5:5 SHA1:2 SHA256:1 SHA512:1 $JOHN is ./ Format interface version: 13 Max. number of reported tunable costs: 3 Rec file version: REC4 Charset file version: CHR3 CHARSET_MIN: 1 (0x01) CHARSET_MAX: 255 (0xff) CHARSET_LENGTH: 24 SALT_HASH_SIZE: 1048576 Max. Markov mode level: 400 Max. Markov mode password length: 30 clang version: 7.0.0 (clang-700.1.76) (gcc 4.2.1 compatibility) Crypto library: OpenSSL OpenSSL library version: 0009081df OpenSSL 0.9.8zd 8 Jan 2015 (loaded: OpenSSL 0.9.8zg 14 July 2015) GMP library version: 6.0.0 File locking: fcntl() fseek(): fseek ftell(): ftell fopen(): fopen memmem(): System's ```
bsakaguchi 2026-10-14 03:40:39 +07:00
Author
Owner

@magnumripper commented on GitHub (Oct 30, 2015):

I thought Apple stopped supplying OpenSSL headers with El Capitan but I see they're there now (maybe they were re-added in 10.11.1?)

$ locate openssl/md5.h
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdk/MacOSX.sdk/usr/include/openssl/md5.h
/usr/local/Cellar/openssl/1.0.2d_1/include/openssl/md5.h

The thing is autoconf is not really supposed to go out of its way to find it. These are both non-standard paths so it's natural you need to supply one of them as an argument to ./configure. Some hard-core beards would even say we shouldn't look in /usr/local/include unless told so (but I disagree).

I usually have a symlink like this one for Homebrew:

$ ls -l /usr/local/include/openssl
lrwxr-xr-x  1 magnum  admin  50 Oct  3 17:00 /usr/local/include/openssl -> /usr/local/Cellar/openssl/1.0.2d_1/include/openssl

However, since this is a very common special-case, I guess we should do two things: 1. Add instructions to doc/INSTALL about how to handle eg. Homebrew and (perhaps) 2. find that crazy long path under /Applications/Xcode.app as a last resort.

<!-- gh-comment-id:152477187 --> @magnumripper commented on GitHub (Oct 30, 2015): I thought Apple stopped supplying OpenSSL headers with El Capitan but I see they're there now (maybe they were re-added in 10.11.1?) ``` $ locate openssl/md5.h /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-migrator/sdk/MacOSX.sdk/usr/include/openssl/md5.h /usr/local/Cellar/openssl/1.0.2d_1/include/openssl/md5.h ``` The thing is autoconf is not really supposed to go out of its way to find it. These are both non-standard paths so it's natural you need to supply one of them as an argument to ./configure. Some hard-core beards would even say we shouldn't look in /usr/local/include unless told so (but I disagree). I usually have a symlink like this one for Homebrew: ``` $ ls -l /usr/local/include/openssl lrwxr-xr-x 1 magnum admin 50 Oct 3 17:00 /usr/local/include/openssl -> /usr/local/Cellar/openssl/1.0.2d_1/include/openssl ``` However, since this is a very common special-case, I guess we should do two things: 1. Add instructions to doc/INSTALL about how to handle eg. Homebrew and (perhaps) 2. find that crazy long path under /Applications/Xcode.app as a last resort.
Author
Owner

@magnumripper commented on GitHub (Oct 30, 2015):

BTW I consider this a bug in Homebrew: (EDIT not a bug, it's keg-only - see below).

$ pkg-config --list-all | grep ssl
libssl                              OpenSSL - Secure Sockets Layer and cryptography libraries
openssl                             OpenSSL - Secure Sockets Layer and cryptography libraries and tools
libevent_openssl                    libevent_openssl - libevent_openssl adds openssl-based TLS support to libevent

$ pkg-config --cflags openssl

$ pkg-config --libs openssl
-lssl -lcrypto -lz

The problem is --cflags, I believe it should say -I/usr/local/Cellar/openssl/1.0.2d_1/include/. The pkg-config thing is utterly useless unless they start actually supplying correct data for it when installing things. We do use pkg-config in our AC enumeration so as soon as Homebrew start doing the right things, it will work for us.

<!-- gh-comment-id:152479150 --> @magnumripper commented on GitHub (Oct 30, 2015): BTW I consider this a bug in Homebrew: (EDIT not a bug, it's keg-only - see [below](https://github.com/magnumripper/JohnTheRipper/issues/1865#issuecomment-152487853)). ``` $ pkg-config --list-all | grep ssl libssl OpenSSL - Secure Sockets Layer and cryptography libraries openssl OpenSSL - Secure Sockets Layer and cryptography libraries and tools libevent_openssl libevent_openssl - libevent_openssl adds openssl-based TLS support to libevent $ pkg-config --cflags openssl $ pkg-config --libs openssl -lssl -lcrypto -lz ``` The problem is `--cflags`, I believe it should say `-I/usr/local/Cellar/openssl/1.0.2d_1/include/`. The pkg-config thing is utterly useless unless they start actually supplying correct data for it when installing things. We do use pkg-config in our AC enumeration so as soon as Homebrew start doing the right things, it will work for us.
Author
Owner

@magnumripper commented on GitHub (Oct 30, 2015):

OK, here's how to do it for Homebrew:

brew link --force openssl

After that, it works as a champ.

<!-- gh-comment-id:152487853 --> @magnumripper commented on GitHub (Oct 30, 2015): OK, here's how to do it for Homebrew: ``` brew link --force openssl ``` After that, it works as a champ.
Author
Owner

@magnumripper commented on GitHub (Oct 30, 2015):

LOL, I was going to add instructions to doc/INSTALL and found we already had them

  2. Install Homebrew's gcc and openssl:
    brew install gcc openssl
    brew link --force openssl
<!-- gh-comment-id:152488916 --> @magnumripper commented on GitHub (Oct 30, 2015): LOL, I was going to add instructions to doc/INSTALL and found we already had them ``` 2. Install Homebrew's gcc and openssl: brew install gcc openssl brew link --force openssl ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openwall/john#1239
No description provided.