Re: wget 1.10.2 doesn't compile on NetBSD/i386 3.1

2007-10-10 Thread Micah Cowan
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

(We don't have reply-to's set; I've re-included the list on this.)

Ray Phillips wrote:
 Thanks for your reply Micah.
 
 
 Ray Phillips wrote:
  I thought I'd report my experiences trying to install wget 1.10.2 on
  NetBSD/i386 3.1.  I'll append the contents of config.log to the end of
  this email.

 snip

  gcc -I. -I.   -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\/usr/local/etc/wgetrc\
  -DLOCALEDIR=\/usr/local/share/locale\ -O2 -Wall -Wno-implicit -c
  http-ntlm.c
  http-ntlm.c:185: error: parse error before des_key_schedule
  http-ntlm.c: In function `setup_des_key':
  http-ntlm.c:187: error: `des_cblock' undeclared (first use in this
  function)

 What version of OpenSSL do you have installed?
 
 % which openssl
 /usr/bin/openssl
 % openssl version
 OpenSSL 0.9.7d 17 Mar 2004
 %
 
 DES_key_schedule and DES_cblock are defined in openssl/des.h in
 recent versions; they are uncapitalized in some old versions. It
 appears that your openssl/des.h does not declare these.
 
 % sed -n '75,91p' /usr/include/openssl/des.h
 
 typedef unsigned char DES_cblock[8];
 typedef /* const */ unsigned char const_DES_cblock[8];
 /* With const, gcc 2.8.1 on Solaris thinks that DES_cblock *
  * and const_DES_cblock * are incompatible pointer types. */
 
 typedef struct DES_ks
 {
 union
 {
 DES_cblock cblock;
 /* make sure things are correct size on machines with
  * 8 byte longs */
 DES_LONG deslong[2];
 } ks[16];
 } DES_key_schedule;
 
 %
 
 Does that look OK to you?
 
 I've just installed openssl 0.9.8e to see if it helps:

snip

 so there's no difference in that part of the code.  However, when I tell
 wget to use version 0.9.8e it compiles without error, as shown at the
 end of this email.
 
 It would be nice if wget 1.10.2 would compile on NetBSD without having
 to install a second version of openssl.

Well, it's too late to change Wget 1.10.2; any new version would have a
new version number. Wget 1.11 will be releasing RSN, though, so
hopefully we'll be able to square this in time for that release (we're
mostly just waiting on resolution of some licensing issues, which should
be done shortly).

It appears from your description that Wget's check in http-ntlm.c:

  #if OPENSSL_VERSION_NUMBER  0x00907001L

is wrong. Your copy of openssl seems to be issuing a number lower than
that, and yet has the newer, capitalized names. However, when I download
a copy of openssl-0.9.7d, I get a copy of opensslv.h that gives:

  #define OPENSSL_VERSION_NUMBER   0x0090704fL

The likeliest explanation, to me, is that OPENSSL_VERSION_NUMBER isn't
being defined by this point, which will cause the C preprocessor to
replace it in #if conditionals with 0 (guaranteeing a false positive).

I actually can't figure out how we're getting a definition of
OPENSSL_VERSION_NUMBER at all: AFAICT we're not directly #including
openssl/opensslv.h... it looks like we're depending on one of
openssl/md4.h and openssl/des.h to #include it indirectly.

It works for me because des.h includes des_old.h (for support for the
uncapitalized symbols), which includes ui_compat.h, which includes ui.h,
which includes crypto.h... which includes opensslv.h. But des_old.h is
only included if OPENSSL_DISABLE_OLD_DES_SUPPORT is not set. Probably it
isn't, on most systems, but happens to be on yours (perhaps in
openssl/opensslconf.h.

This obviously seems pretty precarious, and http-ntlm.c should be
directly #including openssl/opensslv.h rather than trusting to fate
that it will get #included by-and-by.

Ray, if you add the line

 #include openssl/opensslv.h

along with the other openssl #includes, does it fix your problem wrt
openssl-9.7d?

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHDUch7M8hyUobTrERCOXLAJ0eblOOGQ5SMrFKSfT8Tc13dpuECACfcs+M
4m3LuGLNEoIzdxEJ61HDILQ=
=Hvld
-END PGP SIGNATURE-


Re: wget 1.10.2 doesn't compile on NetBSD/i386 3.1

2007-10-10 Thread Daniel Stenberg

On Wed, 10 Oct 2007, Micah Cowan wrote:


It appears from your description that Wget's check in http-ntlm.c:

 #if OPENSSL_VERSION_NUMBER  0x00907001L

is wrong. Your copy of openssl seems to be issuing a number lower than
that, and yet has the newer, capitalized names.


I don't think that check is wrong. We have the exact same check in libcurl (no 
suprise) and it has worked fine since I wrote it, and I've tested it myself on 
numerous different openssl versions.


I would rather suspect that the problem is related to multiple openssl 
installations or similar.


Re: wget 1.10.2 doesn't compile on NetBSD/i386 3.1

2007-10-10 Thread Micah Cowan
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Daniel Stenberg wrote:
 On Wed, 10 Oct 2007, Micah Cowan wrote:
 
 It appears from your description that Wget's check in http-ntlm.c:

  #if OPENSSL_VERSION_NUMBER  0x00907001L

 is wrong. Your copy of openssl seems to be issuing a number lower than
 that, and yet has the newer, capitalized names.
 
 I don't think that check is wrong. We have the exact same check in
 libcurl (no suprise) and it has worked fine since I wrote it, and I've
 tested it myself on numerous different openssl versions.
 
 I would rather suspect that the problem is related to multiple openssl
 installations or similar.

If you read further, you'll see that I actually believe that we're not
properly #including the header that will _define_ OPENSSL_VERSION_NUMBER
(meaning it will be replaced with 0 in things like #if).

Sorry, the style for that mail was mainly logging what I'm
discovering; I probably should have deleted the initial suggestion that
the number could be wrong, as the not-including-opensslv.h seems far
likelier (plus, the mail ended up being a bit lengthier than it really
needed to be to make that final point).

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHDU6c7M8hyUobTrERCEubAJ45HgmxMUhbptQmHUPD/PIn1TGjYQCeIIv7
7chLx5ySHC/J/4GRWx16yPQ=
=VGI/
-END PGP SIGNATURE-


Re: wget 1.10.2 doesn't compile on NetBSD/i386 3.1

2007-10-10 Thread Micah Cowan
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Ray Phillips wrote:
 Ray, if you add the line

  #include openssl/opensslv.h

 along with the other openssl #includes, does it fix your problem wrt
 openssl-9.7d?
 
 I made this change:
 
 % diff -u http-ntlm.c.orig http-ntlm.c
 --- http-ntlm.c.orig2007-10-11 10:07:18.0 +1000
 +++ http-ntlm.c 2007-10-11 09:58:26.0 +1000
 @@ -48,6 +48,7 @@
 
  #include openssl/des.h
  #include openssl/md4.h
 +#include openssl/opensslv.h
 
  #include wget.h
  #include utils.h
 %
 
 and wget 1.10.2 now compiles and installs without errors, as far as I
 can see.  Thanks.

Excellent! Looks like that was the issue, then. I'll apply that change
for 1.11, then.

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHDW697M8hyUobTrERCPQNAJ4mtC/6yccgdeKDk9FsSn4oRSb3/wCfTnUE
Qn2Ww8R3Kvz2qdk0gMUi1X0=
=A4xC
-END PGP SIGNATURE-


Re: wget 1.10.2 doesn't compile on NetBSD/i386 3.1

2007-10-10 Thread Ray Phillips

  It would be nice if wget 1.10.2 would compile on NetBSD without having

 to install a second version of openssl.


Well, it's too late to change Wget 1.10.2;


Yes, sorry Micah--I really meant any future versions.


Ray, if you add the line

 #include openssl/opensslv.h

along with the other openssl #includes, does it fix your problem wrt
openssl-9.7d?


I made this change:

% diff -u http-ntlm.c.orig http-ntlm.c
--- http-ntlm.c.orig2007-10-11 10:07:18.0 +1000
+++ http-ntlm.c 2007-10-11 09:58:26.0 +1000
@@ -48,6 +48,7 @@

 #include openssl/des.h
 #include openssl/md4.h
+#include openssl/opensslv.h

 #include wget.h
 #include utils.h
%

and wget 1.10.2 now compiles and installs without errors, as far as I 
can see.  Thanks.



Ray


Re: wget 1.10.2 doesn't compile on NetBSD/i386 3.1

2007-10-09 Thread Micah Cowan
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Ray Phillips wrote:
 I thought I'd report my experiences trying to install wget 1.10.2 on
 NetBSD/i386 3.1.  I'll append the contents of config.log to the end of
 this email.

snip

 gcc -I. -I.   -DHAVE_CONFIG_H -DSYSTEM_WGETRC=\/usr/local/etc/wgetrc\
 -DLOCALEDIR=\/usr/local/share/locale\ -O2 -Wall -Wno-implicit -c
 http-ntlm.c
 http-ntlm.c:185: error: parse error before des_key_schedule
 http-ntlm.c: In function `setup_des_key':
 http-ntlm.c:187: error: `des_cblock' undeclared (first use in this
 function)

What version of OpenSSL do you have installed? DES_key_schedule and
DES_cblock are defined in openssl/des.h in recent versions; they are
uncapitalized in some old versions. It appears that your openssl/des.h
does not declare these.

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer...
http://micah.cowan.name/

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHDDHf7M8hyUobTrERCKccAJ949G3y17x6RM95VusdkRYoa2IIogCeK/kM
6LsbRrdExihUVZM0tOKM968=
=nF9y
-END PGP SIGNATURE-