Don't mention old systems where realloc(NULL, n) didn't work as we
don't want to give people the idea that this is non-portable (it
has been present since C89).  OK deraadt@ schwarze@
clean up verbiage around the calculations; ok ingo jmc otto
Rename libressl to libtls to avoid confusion and to make it easier to
distinguish between LibreSSL (the project) and libressl (the library).

Discussed with many.
Remove support for ephemeral/temporary RSA private keys.

The only use for these is via SSL_OP_EPHEMERAL_RSA (which is effectively
a standards violation) and for RSA sign-only, should only be possible if
you are using an export cipher and have an RSA private key that is more
than 512 bits in size (however we no longer support export ciphers).

ok bcook@ miod@
Add support for automatic DH ephemeral keys.

This allows an SSL server to enable DHE ciphers with a single setting,
which results in an DH key being generated based on the server key length.

Partly based on OpenSSL.
Remove now unused remnants from public structs.
Crank libssl major due to recent additions, removals and changes.
Update comments for TLS ExtensionType values - many of the referenced
drafts are now RFCs. Also add the TLS extension type for ALPN and be
consistent with RFC reference formatting.
Remove an outdated comment re EDH vs DHE - DHE is now used consistently and
there are backwards compatible names/aliases for EDH.
Use automatic DH ephemeral parameters instead of fixed 512 bit.

Based on OpenSSL.
Remove ephemeral RSA key handling.
Remove remnants from RC2 and SEED - there are no longer any cipher suites
that use these algorithms (and SEED was removed from libcrypto some time
ago).

ok doug@
Add a tls_connect_fds() function that allows a secure connection to be
established using a pair of existing file descriptors.

Based on a diff/request from Jan Klemkow.

Rides previous libtls rename/library bump.

Discussed with tedu@.
Add hooks to override native arc4random_buf on FreeBSD.

The FreeBSD-native arc4random_buf implementation falls back to weak sources of
entropy if the sysctl fails. Remove these dangerous fallbacks by overriding
locally.

Unfortunately, pthread_atfork() is also broken on FreeBSD (at least 9 and 10)
if a program does not link to -lthr. Callbacks registered with pthread_atfork()
simply fail silently. So, it is not always possible to detect a PID wraparound.
I wish we could do better.

This improves arc4random_buf's safety compared to the native FreeBSD
implementation.

Tested on FreeBSD 9 and 10.
minor cleanup of zlib code. DSO is gone. ok jsing.
only call SRTP (whatever that is) functions when the connection type is
DTLS (whatever that is) instead of for TLS too. ok jsing.
simple select() to poll() conversion; reviewed by millert and doug