Re: [openssl.org #85] 0.9.7 prototype constification problems

2002-06-18 Thread Bodo Moeller
On Mon, Jun 17, 2002 at 07:02:45PM +0100, Ben Laurie wrote: Avery Pennarun via RT wrote: On Mon, Jun 17, 2002 at 11:19:31AM +0200, Bodo Moeller wrote: Good question, but this problem does not appear to apply to C, and anyway it only makes *existing* code uglier -- for new code, the modified

Re: [openssl.org #85] 0.9.7 prototype constification problems

2002-06-18 Thread Ben Laurie
Bodo Moeller wrote: On Mon, Jun 17, 2002 at 07:02:45PM +0100, Ben Laurie wrote: Avery Pennarun via RT wrote: On Mon, Jun 17, 2002 at 11:19:31AM +0200, Bodo Moeller wrote: Good question, but this problem does not appear to apply to C, and anyway it only makes *existing* code uglier -- for

Re: [openssl.org #85] 0.9.7 prototype constification problems

2002-06-15 Thread Bodo Moeller
Avery Pennarun [EMAIL PROTECTED]: On Thu, Jun 13, 2002 at 01:26:42PM +0200, Bodo Moeller via RT wrote: [[EMAIL PROTECTED] - Thu Jun 6 18:39:34 2002]: It appears the openssl guys goofed in 0.97beta. The prototype for the d2i_RSAPrivateKey function in 0.9.6c, which I use, is like this:

Re: [openssl.org #85] 0.9.7 prototype constification problems

2002-06-15 Thread Avery Pennarun
On Sat, Jun 15, 2002 at 12:14:00PM +0200, Bodo Moeller wrote: Using const unsigned char **, however, is not 100% api-compatible, because you can't safely pass an unsigned char ** to it, for complicated reasons explained in the URL I sent earlier.

Re: [openssl.org #85] 0.9.7 prototype constification problems

2002-06-15 Thread Bodo Moeller via RT
Avery Pennarun [EMAIL PROTECTED]: On Thu, Jun 13, 2002 at 01:26:42PM +0200, Bodo Moeller via RT wrote: [[EMAIL PROTECTED] - Thu Jun 6 18:39:34 2002]: It appears the openssl guys goofed in 0.97beta. The prototype for the d2i_RSAPrivateKey function in 0.9.6c, which I use, is like this:

Re: [openssl.org #85] 0.9.7 prototype constification problems

2002-06-15 Thread Avery Pennarun via RT
On Sat, Jun 15, 2002 at 12:14:00PM +0200, Bodo Moeller wrote: Using const unsigned char **, however, is not 100% api-compatible, because you can't safely pass an unsigned char ** to it, for complicated reasons explained in the URL I sent earlier.

Re: [openssl.org #85] 0.9.7 prototype constification problems

2002-06-14 Thread Avery Pennarun
On Thu, Jun 13, 2002 at 01:26:42PM +0200, Bodo Moeller via RT wrote: [[EMAIL PROTECTED] - Thu Jun 6 18:39:34 2002]: It appears the openssl guys goofed in 0.97beta. The prototype for the d2i_RSAPrivateKey function in 0.9.6c, which I use, is like this: d2i_RSAPrivateKey(RSA **a,

Re: [openssl.org #85] 0.9.7 prototype constification problems

2002-06-14 Thread Avery Pennarun via RT
On Thu, Jun 13, 2002 at 01:26:42PM +0200, Bodo Moeller via RT wrote: [[EMAIL PROTECTED] - Thu Jun 6 18:39:34 2002]: It appears the openssl guys goofed in 0.97beta. The prototype for the d2i_RSAPrivateKey function in 0.9.6c, which I use, is like this: d2i_RSAPrivateKey(RSA **a,

[openssl.org #85] 0.9.7 prototype constification problems

2002-06-13 Thread Bodo Moeller via RT
[[EMAIL PROTECTED] - Thu Jun 6 18:39:34 2002]: [...] It appears the openssl guys goofed in 0.97beta. The prototype for the d2i_RSAPrivateKey function in 0.9.6c, which I use, is like this: d2i_RSAPrivateKey(RSA **a, unsigned char **pp, long length); ie., without a const on

Re: Constification

2000-11-17 Thread Bodo Moeller
On Wed, Nov 08, 2000 at 07:34:33AM -0800, Geoff Thorpe wrote: [...] whose internals are generally only managed inside OpenSSL anyway. Eg. the caller may pass a const X509* pointer, but the caller is generally not supposed to be using the structure's internals directly anyway - the use of

Constification buglet in crypto/bn/bn_asm.c

2000-11-17 Thread Krister Walfridsson
The BN_LLONG version of bn_add_words() didn't get constified in the recent changes, so it isn't consistent with its prototype. This is fixed by the patch below. /Krister --- openssl-SNAP-20001117/crypto/bn/bn_asm.c.bakFri Nov 17 00:00:26 2000 +++ openssl-SNAP-20001117/crypto/bn/bn_asm.c

Re: Constification

2000-11-13 Thread Paul D. Smith
to have two API's in the first place; you might as well just leave it simple with one API. Or, avoid the const altogether, but I think lhash really is an appropriate place for constification. bl But I'll freely admit that this is probably an API too far in bl lhash's case. I think we're in viole

Re: Constification

2000-11-11 Thread Rob Neff
he readers of this mail group. My point is that if the constification can be made to the exposed APIs without causing undo performance degradation or code breakage then I'm for it. Even if only half of the exposed function parameters can be constifyed then that is at least self-documenting code which helps those of us from a

Re: Constification

2000-11-11 Thread Paul D. Smith
%% Ben Laurie [EMAIL PROTECTED] writes: Are you saying you just don't use const, or that you provide two different functions or two interfaces to the same function? bl The latter. To me, that's much more ugly than simply casting it. This is C, not C++, and we do the best we can with

Re: Constification

2000-11-11 Thread Ben Laurie
"Paul D. Smith" wrote: %% Ben Laurie [EMAIL PROTECTED] writes: Are you saying you just don't use const, or that you provide two different functions or two interfaces to the same function? bl The latter. To me, that's much more ugly than simply casting it. This is C, not

Re: Constification

2000-11-10 Thread Ben Laurie
Richard Levitte - VMS Whacker wrote: From: Ben Laurie [EMAIL PROTECTED] ben Like strstr()... ben benbl Just because the C libraries are broken doesn't mean we should benbl break ours. In Apache we fix these rather than live with them. ben ben How exactly do you fix them?

Re: Constification

2000-11-10 Thread Richard Levitte - VMS Whacker
From: Ben Laurie [EMAIL PROTECTED] ben No, you have two, a const and a non-const version. Fine, I'll give it a shot. I do not believe in it, but I will. -- Richard Levitte \ Spannvägen 38, II \ [EMAIL PROTECTED] Chairman@Stacken \ S-168 35 BROMMA \ T: +46-8-26 52 47 Redakteur@Stacken

Re: Constification

2000-11-10 Thread Ben Laurie
"Paul D. Smith" wrote: %% Ben Laurie [EMAIL PROTECTED] writes: bl By wrapping them with correctly declared functions. Are you saying you just don't use const, or that you provide two different functions or two interfaces to the same function? The latter. I don't think either of

Re: Constification

2000-11-10 Thread Rob Neff
such a string must make a local copy first. My .02 cents worth... - Original Message - From: Lutz Jaenicke [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 08, 2000 10:08 AM Subject: Re: Constification On Wed, Nov 08, 2000 at 04:01:13PM +0100, Richard Levitte - VMS Whacker wrote

Re: Constification

2000-11-10 Thread Geoff Thorpe
API designer's case study in encapsulation, let alone a worthwhile example of "const"ification. For starters, generally there is no illusion of binary compatibility maintained, and direct access to Apache structures is actively encouraged anyway. I've butted heads with this consti

RE: Constification

2000-11-08 Thread Bernard Dautrevaux
-Original Message- From: Richard Levitte - VMS Whacker [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 07, 2000 8:55 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: Constification From: "Paul D. Smith" [EMAIL PROTECTED] psmith This is similar to

Re: Constification

2000-11-08 Thread Ben Laurie
Richard Levitte - VMS Whacker wrote: From: "Paul D. Smith" [EMAIL PROTECTED] psmith This is similar to standard C functions which take a const psmith char*, for example, and return a char* that points into the psmith string. Like strstr()... Just because the C libraries are broken

Re: Constification

2000-11-08 Thread Paul D. Smith
%% Ben Laurie [EMAIL PROTECTED] writes: Like strstr()... bl Just because the C libraries are broken doesn't mean we should bl break ours. In Apache we fix these rather than live with them. How exactly do you fix them? --

Re: Constification

2000-11-08 Thread Richard Levitte - VMS Whacker
From: Ben Laurie [EMAIL PROTECTED] ben Like strstr()... ben benbl Just because the C libraries are broken doesn't mean we should benbl break ours. In Apache we fix these rather than live with them. ben ben How exactly do you fix them? ben ben By wrapping them with correctly

Re: Constification

2000-11-08 Thread Paul D. Smith
%% Ben Laurie [EMAIL PROTECTED] writes: bl By wrapping them with correctly declared functions. Are you saying you just don't use const, or that you provide two different functions or two interfaces to the same function? I don't think either of these two options is better than deconstifying

Re: Constification

2000-11-08 Thread Lutz Jaenicke
On Wed, Nov 08, 2000 at 04:01:13PM +0100, Richard Levitte - VMS Whacker wrote: So, either: const char *correct_strstr(const char *s1, const char *s2) { return strstr(s1, s2); } or: char *correct_strstr(char *s1, const char *s2) { return strstr(s1,

Re: Constification

2000-11-07 Thread Dr S N Henson
Richard Levitte - VMS Whacker wrote: I've become irritated enough with some functions not having const used properly (or at least what appears proper), so I've started working on bringing better use of const to OpenSSL, as some may already have noticed. This may, for a few days, bring

Re: Constification

2000-11-07 Thread Richard Levitte - VMS Whacker
From: Dr S N Henson [EMAIL PROTECTED] drh There's a couple of areas I noticed that could be constified. The EVP drh library's use of EVP_MD and EVP_CIPHER is the main one. I also noticed drh that the version strings for some reason weren't constified. Thanks, I'll look at those next (after I've

Re: Constification

2000-11-07 Thread Richard Levitte - VMS Whacker
From: "Paul D. Smith" [EMAIL PROTECTED] psmith This is similar to standard C functions which take a const psmith char*, for example, and return a char* that points into the psmith string. Like strstr()... psmith IMHO this is a legitimate reason to cast away const, and that psmith the "const"

Re: Constification

2000-11-07 Thread Paul D. Smith
%% Richard Levitte - VMS Whacker [EMAIL PROTECTED] writes: rl From: "Paul D. Smith" [EMAIL PROTECTED] psmith This is similar to standard C functions which take a const psmith char*, for example, and return a char* that points into the psmith string. rl Like strstr()... Yep. Plus

Re: Constification

2000-11-07 Thread Ulf Moeller
On Tue, Nov 07, 2000, Paul D. Smith wrote: I sent this patch back on 05 May 2000, constifying crypto/lhash. Your patch can only be accepted if you CC it to [EMAIL PROTECTED] __ OpenSSL Project

Constification

2000-11-06 Thread Richard Levitte - VMS Whacker
I've become irritated enough with some functions not having const used properly (or at least what appears proper), so I've started working on bringing better use of const to OpenSSL, as some may already have noticed. This may, for a few days, bring along a number of warnings or errors because

Re: Constification

2000-11-06 Thread rsalz
I've started working on bringing better use of const to OpenSSL Huzzah. Also, this will bring about a few ugly casts in the ASN.1 macros or direct callers of them. Perhaps something like #define CONST(t, p) (const t)(p) #define UNCONST(t, p) (t)(p) As in extern void

Re: Attempt at constification generates questions...

2000-11-04 Thread Richard Levitte - VMS Whacker
From: Ben Laurie [EMAIL PROTECTED] ben Woah! Let's not get carried away - unless they gain is actually zero, ben then constification is not justification, in itself, for doing this. ben Note, you could have a constified version that either didn't do ben BN_RECURSION or copied instead

Re: Attempt at constification generates questions...

2000-11-03 Thread Ben Laurie
, then constification is not justification, in itself, for doing this. Note, you could have a constified version that either didn't do BN_RECURSION or copied instead of expanding. Cheers, Ben. -- http://www.apache-ssl.org/ben.html "There is no limit to what a man can do or how far he can go if he doesn't

Re: Attempt at constification generates questions...

2000-11-03 Thread Bodo Moeller
carried away - unless they gain is actually zero, then constification is not justification, in itself, for doing this. Note, you could have a constified version that either didn't do BN_RECURSION or copied instead of expanding. I think copying wouldn't be the way to do it -- rather, merely check