Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re: mod_perl + openssl (fwd) #299

Closed
p5pRT opened this issue Jul 31, 1999 · 4 comments
Closed

Re: mod_perl + openssl (fwd) #299

p5pRT opened this issue Jul 31, 1999 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Jul 31, 1999

Migrated from rt.perl.org#1122 (status was 'resolved')

Searchable as RT1122$

@p5pRT
Copy link
Author

p5pRT commented Jul 31, 1999

From fygrave@tigerteam.net

regards
Fyodor

---------- Forwarded message ----------
Date​: Sun, 1 Aug 1999 11​:44​:37 +0400 (MSD)
From​: CyberPsychotic <fygrave@​tigerteam.net>
To​: craig@​infoseek.com, w@​infoseek.com
Subject​: Re​: mod_perl + openssl

~
~ Hi,
~
~ I did a search of the archives at openssl and found your email. Did
~ your fix for the '_' define hold up? Are you using the server in
~ production?

Well, I am running the server on my friend's home machine
(www.scorpions.net) and it hasn't showed up any serious bug by this moment.
The basic problem appears because file
/usr/lib/perl5/i386-linux/5.00401/CORE/config.h

has the following definition​:

/* CAN_PROTOTYPE​:
* If defined, this macro indicates that the C compiler can handle
* function prototypes.
*/
/* _​:
* This macro is used to declare function parameters for folks who want
* to make declarations with prototypes using a different style than
* the above macros. Use double parentheses. For example​:
*
* int main _((int argc, char *argv[]));
*/
#define CAN_PROTOTYPE /**/
#ifdef CAN_PROTOTYPE
#define _(args) args
#else
#define _(args) ()
#endif

you could either fix perl to define function prototypes using
__P(args) method, which looks to be standard to me. (but in this case you'd
have to ride through whole perl source and fix all the prototypes there. Or
you could go simpler and apply patch bellow to des.h file. so far I didn't
notice any problem with it.

~ Thanks, I got the same error trying to put this up on a Solaris box.
~ What version of perl did you have installed. I was using 5.004.4
~

as you see I am running perl 5.004_01 which isn't recommended, but so far it
works :)

hope it helps

Fyodor

Inline Patch
--- openssl-0.9.3/crypto/des/des.h.orig	Fri Jul 30 21:56:51 1999
+++ openssl-0.9.3/crypto/des/des.h	Sat Jul 31 15:39:51 1999
@@ -92,8 +92,15 @@
 		 * 8 byte longs */
 		DES_LONG pad[2];
 		} ks;
-#if defined _
+#ifndef MOD_PERL
+#	if defined _
 # error "_ is defined, but some strange definition the DES library cannot handle that."
+#	endif
+#define _	ks._
+#else
+#    ifdef _
+#	undef _
+#    endif
 #endif
 #define _	ks._
 	int weak_key;

@p5pRT
Copy link
Author

p5pRT commented Aug 2, 1999

From [Unknown Contact. See original ticket]

On Sun, Aug 01, 1999 at 06​:48​:15PM +0400, "CyberPsychotic" wrote​:

Hello people,
I think it could make sence to fix perl includes to use standard prototype
definitions, i.g. foobar __P((args)) instead of foobar _((args)) since it
breaks some stuff. (like openssl library which uses `_' macro for its own
needs). I could complete a patch for this if such would be accepted.

It's funny that I just hit this too... but I don't fault it to perl... I
fault it to openssl. What kind of product has an include file that it intends
to be used by others define '_' to 'x._' or whatever it was?

Why can't openssl just be fixed?

In my experience, both _, and __P are used for ansi prototypes. Heck, I've
used both before.

mark (who when after compiling openssl, just removed the "define _" section
  as it doesn't seem to be necessary for compilation of apache...)

--
markm@​nortelnetworks.com/mark@​mielke.cc/markm@​ncf.ca __________________________
. . _ ._ . . .__ . . ._. .__ . . . .__ | CUE Development (4Y21)
|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ | Nortel Networks
| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada

  One ring to rule them all, one ring to find them, one ring to bring them all
  and in the darkness bind them...

  http​://mark.mielke.cc/

@p5pRT
Copy link
Author

p5pRT commented Aug 2, 1999

From [Unknown Contact. See original ticket]

[openssl people​: sorry for crosspost, I just hope you could have something
to add to our discussion. We basically talk about the problem with compiling
openssl+apache+mod_perl. Since crypto/des/des.h file defines _ as ks._ (if
my memory doesn't fail) and perl's config.h file uses `_' symbol for ansi
prototypes definition, which I felt was rather non-standard (I suggested
__P instead)]

~
~ It's funny that I just hit this too... but I don't fault it to perl... I
~ fault it to openssl. What kind of product has an include file that it intends
~ to be used by others define '_' to 'x._' or whatever it was?

:-) actually I haven't figured out if openssl needed that at all. At least I
grepped source with find and didn't find any referense on `_' definition.
Maybe DES requires this name to be defined(or maybe I missed something)?

~ Why can't openssl just be fixed?

no ideas. I mailed to openssl list while ago, but the only responces I've
been getting were private mails asking how did I fix this problem myself.

~ In my experience, both _, and __P are used for ansi prototypes. Heck, I've
~ used both before.

Well, recenly I've been into BSD alot, and __P is the only symbol used for
ansi prototypes there. Not quite sure of other Unix clones.

~
~ mark (who when after compiling openssl, just removed the "define _" section
~ as it doesn't seem to be necessary for compilation of apache...)

Well, as you probably have noticed from my patch, I did approximately the
same (just added #ifdef MOD_PERL there ;-))

regards
  ~Fyodor
--
http​://www.kalug.lug.net/ PGP key​: hkp​://keys.pgp.com/cyberpsychotic
http​://www.kalug.lug.net/fygrave email​:fygrave@​tigerteam.net

``the government isn't solution to our problems. The government is the problem.''

@p5pRT
Copy link
Author

p5pRT commented Aug 2, 1999

From [Unknown Contact. See original ticket]

On Tue, Aug 03, 1999 at 03​:50​:01PM +0400, CyberPsychotic wrote​:

[openssl people​: sorry for crosspost, I just hope you could have something
to add to our discussion. We basically talk about the problem with compiling
openssl+apache+mod_perl. Since crypto/des/des.h file defines _ as ks._ (if
my memory doesn't fail) and perl's config.h file uses `_' symbol for ansi
prototypes definition, which I felt was rather non-standard (I suggested
__P instead)]

This definition does no longer exist in OpenSSL. Please get a recent
snapshot from <URL​://ftp.openssl.org/snapshot;type=d> (OpenSSL 0.9.4
is going to be released soon, so the codebase is quite stable now --
and if there are any problems with the current code, they'll hopefully
be found before the new version is released).

                    What kind of product has an include file that it intends

~~ to be used by others define '_' to 'x._' or whatever it was?

:-) actually I haven't figured out if openssl needed that at all. At least I
grepped source with find and didn't find any referense on `_' definition.
Maybe DES requires this name to be defined(or maybe I missed something)?

That definition existed for compatibility with the DES implementation
in Kerberos (the SSLeay/OpenSSL libraries use a union that contains a
struct where Kerberos has directly the struct with that _ member).

There are other programs too that use some _ macro -- as I wrote
in an earlier message,

< For some reason, everyone thinks that noone else would be so stupid as
< to call a macro _, and this results in lots of conflicts when you're
< trying to mix software of different origin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant