-----BEGIN PGP SIGNED MESSAGE-----

>>>>> "Michael" == Michael Richardson <[EMAIL PROTECTED]> writes:
    Michael>   My suggestion:

    Michael> change the typedef, (or probably, add a new one):

    Michael>   struct des_ks_struct
    Michael>    {
    Michael>    union   {
    Michael>            des_cblock _;
    Michael>            /* make sure things are correct size on machines with
    Michael>             * 8 byte longs */
    Michael>            DES_LONG pad[2];
    Michael>            } ks[16];
    Michael>    };

    Michael>   typedef struct des_ks_struct * des_key_schedule;

  I see the error of my ways.

  des_key_schedule gets to be a nice chameleon.
  If declared as an auto/static, its gets storage like a structure.
  If declared in a parameter list, it gets treated like a pointer. This is
the nature of arrays in C. (And before structure passing, this was the case
for structures as well)

  The above breaks lots of programs.
  The problem is that one can't cast a pointer to a "des_key_schedule"
(as it was defined before) because that is an array type, not a pointer to an
array. So, one needs at a minimum:

struct des_eks {
  des_key_schedule ks;
};

  so that one can do ((struct des_eks *)foo)->ks to get the right type to
satisfy the prototype.

]       ON HUMILITY: to err is human. To moo, bovine.           |  firewalls  [
]   Michael Richardson, Sandelman Software Works, Ottawa, ON    |net architect[
] [EMAIL PROTECTED] http://www.sandelman.ottawa.on.ca/ |device driver[
] panic("Just another NetBSD/notebook using, kernel hacking, security guy");  [

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: latin1
Comment: Finger me for keys

iQCVAwUBO84/04qHRg3pndX9AQHfPQQA5b9VQhsmCjX6rqiG43WNO5IRqBfvk7cA
mBUab6p7DQPG+390HO7ULMNskb4F7cVBocMYZe/e7ErczA81UbNN8U6ty21tC1td
tHqAQprx2N1767fNeLv5Ro0bx7gIqWgsFTlKRNuxmUduwcwI9GTwSbgFDeY/lMbW
2xH5vlwfB50=
=6o0U
-----END PGP SIGNATURE-----
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to