convert 53 malloc(a*b) to reallocarray(NULL, a, b).  that is 53
potential integer overflows easily changed into an allocation return
of NULL, with errno nicely set if need be.  checks for an allocations
returning NULL are commonplace, or if the object is dereferenced
(quite normal) will result in a nice fault which can be detected &
repaired properly.
ok tedu
ok, next pass after review:  when possible, put the reallocarray arguments
in the "size_t nmemb, size_t size"
we no longer care that these aren't used for ssl2
the comment says RAND_pseudo_bytes should be RAND_bytes. make it so.
ok deraadt
trivial realloc -> reallocarray
I do not have time to describe how bad the realloc() uses in here, now
being relaced by reallocarray().  you will have to look at the diff.
there can be no explanations for the extra casts.  as beck says,
"Don't go towards the light theo!"
ok beck tedu