You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by Derek Atkins <wa...@MIT.EDU> on 2003/09/05 19:45:43 UTC

Xml-Security-1.0.0 fails to use OPENSSL properly

I just tried building xml-security-c-1.0.0 and it failed to
accept my OPENSSL configure setting properly.  The enclosed
(trivial) patch to configure.ac fixes the problem.

Thanks,

-derek


Re: Xml-Security-1.0.0 fails to use OPENSSL properly

Posted by Berin Lautenbach <be...@ozemail.com.au>.
Derek,

Apologies - didn't make myself clear.

The OPENSSL env variable is used to point to a standard *non-installed*
copy of OpenSSL.  I.e. un-tar, and compile, and you will come up with a
directory structure where the includes are in $OPENSSL/include, but the
libraries are placed in $OPENSSL.  (The compilation doesn't make a lib
directory for normal linux/solaris installs.)

I *think* you have then done a "make install" into specific directory
structures somewhere, at which point the install will place libs into a
lib directory off the base install point.

So, for what the configure.ac is designed for, it's not broken.  (Note
that Xerces and Xalan create a lib directory within their own directory
structures, thus the usage of "lib" in configure.ac for these.)

I've put a patch into cvs that first tries to link using -L${OPENSSL} 
and if that fails then tries -L{OPENSSL}/lib.  That should make it work 
for your purposes but still preserve the original intent.

Cheers,
	Berin


Derek Atkins wrote:
> Hi,
> 
> Berin Lautenbach <be...@ozemail.com.au> writes:
> 
> 
>>Derek,
>>
>>That's a strange one.  What version of OpenSSL are you using and what
>>platform?
> 
> 
> It's not strange at all, it's a clear bug in configure.ac when trying
> to use a user-supplied ${OPENSSL}.  Consider this patch in the face of
> the rest of configure.ac (in particular, look at line 428 in the 1.0.0
> release).
> 
> I've got multiple versions of OpenSSL and I'm trying to use
> OPENSSL=... to point xml-security-c-1.0.0 at a specific
> version.
> 
> Line 428 says:
> 
> CPPFLAGS=["${CPPFLAGS} -I${OPENSSL}/include"]
> 
> This is correct, and it successfully finds the ssl .h file using this
> include path.  But then after this succeeds you have:
> 
>    AC_DEFINE(HAVE_OPENSSL)
>    LIBS="${LIBS} -L${OPENSSL} -lcrypto"
> 
> This is clearly wrong; this should be adding ${OPENSSL}/lib to the
> LIBS path so it finds the correct library.
> 
> 
>>I've got an "out of the box" 0.9.7b that compiles up on linux with the
>>libraries in the base directory, so the original settings work
>>correctly.
>>
>>Are you trying to point the configure script to something different?
> 
> 
> Yes.  I'm trying to point it at a specific version of OPENSSL using
> the ${OPENSSL} environment variable.
> 
> 
>>If that's the case, then maybe I need to be a bit more clever in
>>testing for OpenSSL?  (configure is very niaeve at the moment.)
> 
> 
> Nope..  You just need to use the provided ${OPENSSL} correctly as per
> my patch.  See above.
> 
> 
>>Cheers,
>>	Berin
> 
> 
> FWIW I've tested with this patch, and it works perfectly for me.
> 
> -derek
> 
> 
>>Derek Atkins wrote:
>>
>>>I just tried building xml-security-c-1.0.0 and it failed to
>>>accept my OPENSSL configure setting properly.  The enclosed
>>>(trivial) patch to configure.ac fixes the problem.
>>>Thanks,
>>>-derek
>>>------------------------------------------------------------------------
>>>--- src/configure.ac~	2003-08-05 07:49:49.000000000 -0400
>>>+++ src/configure.ac	2003-09-05 13:22:02.000000000 -0400
>>>@@ -430,7 +430,7 @@
>>> AC_TRY_CPP([#include <openssl/opensslv.h>],     openssl_found=yes
>>>AC_DEFINE(HAVE_OPENSSL)
>>>-   LIBS="${LIBS} -L${OPENSSL} -lcrypto"
>>>+   LIBS="${LIBS} -L${OPENSSL}/lib -lcrypto"
>>>    [AC_MSG_RESULT([found])],     CPPFLAGS=$OLD_CPPFLAGS
>>>    [AC_MSG_RESULT([no])]);
>>>------------------------------------------------------------------------
>>>
>>
> 



Re: Xml-Security-1.0.0 fails to use OPENSSL properly

Posted by Derek Atkins <wa...@MIT.EDU>.
Hi,

Berin Lautenbach <be...@ozemail.com.au> writes:

> Derek,
> 
> That's a strange one.  What version of OpenSSL are you using and what
> platform?

It's not strange at all, it's a clear bug in configure.ac when trying
to use a user-supplied ${OPENSSL}.  Consider this patch in the face of
the rest of configure.ac (in particular, look at line 428 in the 1.0.0
release).

I've got multiple versions of OpenSSL and I'm trying to use
OPENSSL=... to point xml-security-c-1.0.0 at a specific
version.

Line 428 says:

CPPFLAGS=["${CPPFLAGS} -I${OPENSSL}/include"]

This is correct, and it successfully finds the ssl .h file using this
include path.  But then after this succeeds you have:

   AC_DEFINE(HAVE_OPENSSL)
   LIBS="${LIBS} -L${OPENSSL} -lcrypto"

This is clearly wrong; this should be adding ${OPENSSL}/lib to the
LIBS path so it finds the correct library.

> I've got an "out of the box" 0.9.7b that compiles up on linux with the
> libraries in the base directory, so the original settings work
> correctly.
> 
> Are you trying to point the configure script to something different?

Yes.  I'm trying to point it at a specific version of OPENSSL using
the ${OPENSSL} environment variable.

> If that's the case, then maybe I need to be a bit more clever in
> testing for OpenSSL?  (configure is very niaeve at the moment.)

Nope..  You just need to use the provided ${OPENSSL} correctly as per
my patch.  See above.

> Cheers,
> 	Berin

FWIW I've tested with this patch, and it works perfectly for me.

-derek

> Derek Atkins wrote:
> > I just tried building xml-security-c-1.0.0 and it failed to
> > accept my OPENSSL configure setting properly.  The enclosed
> > (trivial) patch to configure.ac fixes the problem.
> > Thanks,
> > -derek
> > ------------------------------------------------------------------------
> > --- src/configure.ac~	2003-08-05 07:49:49.000000000 -0400
> > +++ src/configure.ac	2003-09-05 13:22:02.000000000 -0400
> > @@ -430,7 +430,7 @@
> >  AC_TRY_CPP([#include <openssl/opensslv.h>],     openssl_found=yes
> > AC_DEFINE(HAVE_OPENSSL)
> > -   LIBS="${LIBS} -L${OPENSSL} -lcrypto"
> > +   LIBS="${LIBS} -L${OPENSSL}/lib -lcrypto"
> >     [AC_MSG_RESULT([found])],     CPPFLAGS=$OLD_CPPFLAGS
> >     [AC_MSG_RESULT([no])]);
> > ------------------------------------------------------------------------
> >
> 

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available

Re: Xml-Security-1.0.0 fails to use OPENSSL properly

Posted by Berin Lautenbach <be...@ozemail.com.au>.
Derek,

That's a strange one.  What version of OpenSSL are you using and what 
platform?

I've got an "out of the box" 0.9.7b that compiles up on linux with the 
libraries in the base directory, so the original settings work correctly.

Are you trying to point the configure script to something different?  If 
that's the case, then maybe I need to be a bit more clever in testing 
for OpenSSL?  (configure is very niaeve at the moment.)

Cheers,
	Berin


Derek Atkins wrote:
> I just tried building xml-security-c-1.0.0 and it failed to
> accept my OPENSSL configure setting properly.  The enclosed
> (trivial) patch to configure.ac fixes the problem.
> 
> Thanks,
> 
> -derek
> 
> 
> 
> ------------------------------------------------------------------------
> 
> --- src/configure.ac~	2003-08-05 07:49:49.000000000 -0400
> +++ src/configure.ac	2003-09-05 13:22:02.000000000 -0400
> @@ -430,7 +430,7 @@
>  AC_TRY_CPP([#include <openssl/opensslv.h>], 
>     openssl_found=yes 
>     AC_DEFINE(HAVE_OPENSSL)
> -   LIBS="${LIBS} -L${OPENSSL} -lcrypto"
> +   LIBS="${LIBS} -L${OPENSSL}/lib -lcrypto"
>     [AC_MSG_RESULT([found])], 
>     CPPFLAGS=$OLD_CPPFLAGS
>     [AC_MSG_RESULT([no])]);
> 
> 
> ------------------------------------------------------------------------
> 
>