Don't include asn1_mac.h if all you need is asn1.h.
EVP_DigestInit_ex() may be used to recycle an existing EVP_MD_CTX without having
to reinitialize all of it, especially if it is used with the same MD algorithm.

However, when the MD algorithm changes, it needs to perform more cleanups.
Make that code more closer to what EVP_MD_CTX_cleanup() does by:
- only freeing md_data if EVP_MD_CTX_FLAG_REUSE is not set
- performing an explicit_bzero of md_data before freeing it
- making sure we call EVP_PKEY_CTX_free on the pctx if the allocation for the
  new md_data fails.

ok tedu@
Check X509_NAME_oneline() return value when it will have to allocate memory.
dsa_priv_decode(): only destroy the object we've created, and with the
  appropriate function. Checking for privkey != NULL is not enough since
  privkey points to a member of ndsa if ndsa != NULL.
dsa_priv_encode(): possible double free in error path.
Possible PBEPARAM leak in the error path.
Make sure all error conditions in RSA_padding_add_PKCS1_PSS_mgf1() cause
EVP_MD_CTX_cleanup() to be called.
Provide a link to the canonical API specification.
ok beck
Use dl_iterate_phdr() to iterate over the segments and throw the addresses
into the hash; hoping the system has some ASLR or PIE.  This replaces and
substantially improves upon &main which proved problematic with some picky
linkers.
Work with kettenis, testing by beck
unbreak build this needed to be an and..
ok jsing@
once srandomdev() is called, switch to using arc4random() but mask off the
high bit as required by posix. wouldn't want to break any standards.
idea and ok deraadt
remove a lie spotted by guenther
oops, i deleted the wrong word
Warn about the use of BUF_strdup.
OPENSSL_{malloc,free} -> {malloc,free}
Fix memory leak.

OK from beck@ and miod@
The bell tolls for BUF_strdup - Start the migration to using
intrinsics. This is the easy ones, a few left to check one at
a time.
ok miod@ deraadt@
Add a regress test for the ASN1 handling of SSL session tickets.
Rewrite i2d_SSL_SESSION to use the ASN1 primitives, rather than using the
horrific macros from asn1_mac.h.

This is a classic example of using macros to obfuscate code, in an attempt
to reduce the line count. The end result is so ridiculously convoluted that
it is completely unreadable and it takes hours to deconstruct the macros
and figure out what is actually going on behind the scenes.

ok miod@
Expand the tlsext_sigalg macros. The end result is about the same number
of lines and much more readable.

ok miod@
Another compression remnant.