Bug 462 - compile failure with openssl 0.9.7
Summary: compile failure with openssl 0.9.7
Status: CLOSED WORKSFORME
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: -current
Hardware: ix86 Linux
: P2 major
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords:
: 569 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-01-02 03:28 AEDT by madhon
Modified: 2004-04-14 12:24 AEST (History)
1 user (show)

See Also:


Attachments
Change BN_mod( . . . ) to BN_div(NULL, . . . .) (876 bytes, patch)
2003-01-03 01:00 AEDT, Andreas Sundstrom
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description madhon 2003-01-02 03:28:06 AEDT
on slackware-current with openssl 0.9.7 the build fails to make as follows

make[1]: Entering directory `/tmp/openssh-3.5p1/openbsd-compat'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/tmp/openssh-3.5p1/openbsd-compat'
i386-slackware-linux-gcc -o ssh ssh.o sshconnect.o sshconnect1.o sshconnect2.o 
sshtty.o readconf.o clientloop.o -L. -Lopenbsd-compat/  -lssh -lopenbsd-compat -
lutil -lz -lnsl  -lcrypto -lcrypt
./libssh.a(rsa.o)(.text+0x2a4): In funcion `rsa_generate_additional_parameters'
:
: undefined reference to `BN_mod'
./libssh.a(rsa.o)(.text+0x2a6): In funcion `rsa_generate_additional_parameters'
:
: undefined reference to `BN_mod'
collect2: ld returned 1 exit status
make: *** [ssh[ Error 1

configured as follows
CFLAGS="-O2 -march=i386 -mcpu=i686 -Wall" ./configure --prefix=/usr \
            --sysconfdir=/etc/ssh \
            --without-pam \
            --with-md5-passwords \
            --with-tcp-wrappers \
            --with-default-
path=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin \
            --with-ipv4-default \
            i386-slackware-linux

OpenSSH has been configured with the following options:
                     User binaries: /usr/bin
                   System binaries: /usr/sbin
               Configuration files: /etc/ssh
                   Askpass program: /usr/libexec/ssh-askpass
                      Manual pages: /usr/man/manX
                          PID file: /var/run
  Privilege separation chroot path: /var/empty
            sshd default user 
PATH: /usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin
                    Manpage format: doc
                       PAM support: no
                KerberosIV support: no
                 KerberosV support: no
                 Smartcard support: no
                       AFS support: no
                     S/KEY support: no
              TCP Wrappers support: yes
              MD5 password support: yes
       IP address in $DISPLAY hack: no
          Use IPv4 by default hack: yes
           Translate v4 in v6 hack: yes
                  BSD Auth support: no
              Random number source: OpenSSL internal ONLY

              Host: i386-slackware-linux-gnu
          Compiler: i386-slackware-linux-gcc
    Compiler flags: -O2 -march=i386 -mcpu=i686 -Wall -Wall -Wpointer-arith -Wno-
uninitialized
Preprocessor flags: 
      Linker flags: 
         Libraries: -lwrap  -lutil -lz -lnsl  -lcrypto -lcrypt
Comment 1 Markus Friedl 2003-01-02 04:04:45 AEDT
i think your openssl header files and libaries are not matching
Comment 2 madhon 2003-01-02 06:22:49 AEDT
just removed all traces of openssl, recompiled and installed it, and still the 
same error.

if what you say is true wouldnt it also stop me from compiling anything else 
that uses openssl (apache 2, php, curl, sasl to name just a few that ive 
recompiled using the new openssl fine) 
Comment 3 Darren Tucker 2003-01-02 10:47:31 AEDT
Try running the "findssl.sh" script from http://www.zip.com.au/~dtucker/openssh/ 
to see if there's any libraries or headers you missed.
Comment 4 madhon 2003-01-02 23:53:59 AEDT
heres the output from findssl.sh, i think it speaks for itself

Searching for OpenSSL header files.
0x0090700fL /usr/include/openssl/opensslv.h

Searching for OpenSSL shared library files.
0x0090700fL /usr/lib/libcrypto.so.0.9.7
0x0090700fL /usr/lib/libcrypto.so
0x0090700fL /usr/lib/libcrypto.so.0
0x0090700fL /usr/lib/libcrypto.so.0.9.6

Searching for OpenSSL static library files.
0x0090700fL /usr/lib/libcrypto.a
Comment 5 Andreas Sundstrom 2003-01-03 01:00:30 AEDT
Created attachment 189 [details]
Change BN_mod( . . . ) to BN_div(NULL, . . . .)
Comment 6 Markus Friedl 2003-01-03 01:19:47 AEDT
0x0090700fL /usr/lib/libcrypto.so.0.9.6                                         

this looks very much like a broken openssl setup to me.
Comment 7 Markus Friedl 2003-01-03 01:32:06 AEDT
openssl 0.9.7 defines
	#define BN_mod(rem,m,d,ctx) BN_div(NULL,(rem),(m),(d),(ctx))
in <openssl/bn.h>
and openssh's rsa.c includes rsa.h which includes <openssl/bn.h>

so i don't see why this is a problem in OpenSSH...
Comment 8 Markus Friedl 2003-01-03 01:53:26 AEDT
"Change BN_mod( . . . ) to BN_div(NULL, . . . .)"

this should not be necessary, since bn.h is included
and bn.h should do this....
Comment 9 madhon 2003-01-03 02:43:00 AEDT
"0x0090700fL /usr/lib/libcrypto.so.0.9.6                                        
this looks very much like a broken openssl setup to me"


thats just a sym link to libcrypto.so.9.9.7
Comment 10 madhon 2003-01-03 02:43:37 AEDT
"0x0090700fL /usr/lib/libcrypto.so.0.9.6                                        
this looks very much like a broken openssl setup to me"


thats just a sym link to libcrypto.so.0.9.7
Comment 11 madhon 2003-01-03 03:10:25 AEDT
the patch from Andreas Sundstrom worked ok, still a bit strange as to why it 
needed to be changed even though bn.h defines bn_mod
Comment 12 Andreas Sundstrom 2003-01-03 03:27:47 AEDT
My comment wasn't added, but here goes:

 I don't know why the #define statement in bn.h has no effect, the patch is just
what I did to be able to compile this for now.. Until someone who has more C
knowledge than me can fix whatever should be fixed..

/Andreas
Comment 13 Igor V. Khristophorov 2003-01-04 19:21:49 AEDT
I had the same problem, and it was because of old header file generated
by gcc's fixincludes, namely /usr/lib/gcc-lib/.../openssl/bh.h.
I just removed the whole directory openssl there.
Comment 14 Damien Miller 2003-05-17 17:37:02 AEST
*** Bug 569 has been marked as a duplicate of this bug. ***
Comment 15 Damien Miller 2004-04-14 12:24:18 AEST
Mass change of RESOLVED bugs to CLOSED