The previous commit to crypto/stack/*.[ch] pulled the type-safety strings
authorGeoff Thorpe <geoff@openssl.org>
Thu, 1 Jun 2000 02:36:58 +0000 (02:36 +0000)
committerGeoff Thorpe <geoff@openssl.org>
Thu, 1 Jun 2000 02:36:58 +0000 (02:36 +0000)
commitccd86b68ef7f9a5cfaaed4089bce29fdc5fe4219
treea17b8dc9415fd53a48aad7152f08b2ede5a45d34
parent7bb7043580900b8f06cb418b46004b755ff0fc96
The previous commit to crypto/stack/*.[ch] pulled the type-safety strings
yet tighter, and also put some heat on the rest of the library by
insisting (correctly) that compare callbacks used in stacks are prototyped
with "const" parameters. This has led to a depth-first explosion of
compiler warnings in the code where 1 constification has led to 3 or 4
more. Fortunately these have all been resolved to completion and the code
seems cleaner as a result - in particular many of the _cmp() functions
should have been prototyped with "const"s, and now are. There was one
little problem however;

X509_cmp() should by rights compare "const X509 *" pointers, and it is now
declared as such. However, it's internal workings can involve
recalculating hash values and extensions if they have not already been
setup. Someone with a more intricate understanding of the flow control of
X509 might be able to tighten this up, but for now - this seemed the
obvious place to stop the "depth-first" constification of the code by
using an evil cast (they have migrated all the way here from safestack.h).

Fortunately, this is the only place in the code where this was required
to complete these type-safety changes, and it's reasonably clear and
commented, and seemed the least unacceptable of the options. Trying to
take the constification further ends up exploding out considerably, and
indeed leads directly into generalised ASN functions which are not likely
to cooperate well with this.
16 files changed:
CHANGES
crypto/asn1/a_strnid.c
crypto/asn1/x_crl.c
crypto/pkcs7/pk7_mime.c
crypto/x509/x509.h
crypto/x509/x509_cmp.c
crypto/x509/x509_trs.c
crypto/x509/x_all.c
crypto/x509v3/v3_lib.c
crypto/x509v3/v3_purp.c
crypto/x509v3/x509v3.h
ssl/s3_clnt.c
ssl/ssl_cert.c
ssl/ssl_ciph.c
ssl/ssl_lib.c
ssl/ssl_locl.h