Richard Levitte - VMS Whacker writes:

> You should take a closer look at 0.9.7 (currently in beta), where a
> some of the stricter type handling has already been applied.

I think I had a quick look at the CVS mainline, and the problems were still
present there.  Unless there are patches in the 0.9.7 branch that haven't
made it into mainline yet, it should apply equally to both.

> One thing in your patch that disturbs me a bit is all the casting,
> which should be necessary if the thing you cast is properly written.
> We're trying to avoid casting as much as possible, since that entirely
> obliterates anything that has to do with type safety...

Fully agreed, but I fear this isn't possible: consider for example the i2d
and d2i functions in asn1.h.  I've used the following prototypes for them:

typedef int (ASN1_METHOD_I2D)(void *, unsigned char **);
typedef char *(ASN1_METHOD_D2I)(void **, unsigned char **, long);

However, when struct asn1_method_st is initialized in e.g. asn1/a_meth.c,
you see that the types of the first arguments of the functions vary:

We have 

        int i2d_ASN1_IA5STRING(ASN1_IA5STRING *,unsigned char **);
and
        int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *,unsigned char **);

The same kind of variation occurs for the two other instantiations of this
function, as well as for the corresponding d2i functions.

The situation is similar with the env_md_st function pointer members:
e.g. the init function takes either an SHA_CTX * or MD5_CTX * or whatever.
Unless one wants to change all those functions to take a void * as first
arg (and loose type safety in all direct uses), the casts seem necessary
(and unavoidable) to me.

> We will probably not apply your change to the 0.9.6 line of
> development, because it's a rather big change, and we try to avoid
> that within the same line of development (for now, 0.9.x is a line of
> development, so 0.9.7 is a different one, as is 0.9.8 (in development
> right now, and where most if the bleeding edge hacking is done)).  We
> will definitely take a closer look at your patch for 0.9.7 and 0.9.8.

I can probably rework the patch for either the 0.9.7 or 0.9.8 lines,
whatever is more convenient for you.

        Rainer
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to