Memory allocation checks.

PR#3399.
Make sure BN_sqr can never return a negative value.

PR#3410
(cherry picked from commit e14e764c0d5d469da63d0819c6ffc0e1e9e7f0bb)
Fix OID encoding for one component.

OIDs with one component don't have an encoding.

PR#2556 (Bug#1)
Memory leak and NULL derefernce fixes.

PR#3403
Remove ancient obsolete files under pkcs7.
(cherry picked from commit 7be6b27aaf5ed77f13c93dc89a2c27a42082db3f)
Clarify docs.

Document that the certificate passed to SSL_CTX_add_extra_chain_cert()
should not be freed by the application.

PR#3409
(cherry picked from commit 0535c2d67ca2d684087ef90be35d5fb207aab227)

Add restrictions section present in other branches.

Conflicts:

	doc/ssl/SSL_CTX_add_extra_chain_cert.pod
Don't advertise ECC ciphersuits in SSLv2 compatible client hello.

PR#3374
(cherry picked from commit 0436369fccd128cb7f6a8538d5fed1c876c437af)
Handle IPv6 addresses in OCSP_parse_url.

PR#2783
(cherry picked from commit b36f35cda964544a15d53d3fdfec9b2bab8cacb1)
Tolerate critical AKID in CRLs.

PR#3014
(cherry picked from commit 11da66f8b1fbe5777fe08cc6ace9e1f2c1576a50)
Fix for EVP_PBE_alg_add().

In EVP_PBE_alg_add don't use the underlying NID for the cipher
as it may have a non-standard key size.

PR#3206
(cherry picked from commit efb7caef637a1de8468ca109efd355a9d0e73a45)
Remove redundant check.

PR#3174
(cherry picked from commit fd331c0bb9b557903dd2ce88398570a3327b5ef0)
Fix typo in ideatest.c
(cherry picked from commit d1d4382dcb3fdcad4758ef7e7dd7b61dbf5abbfe)
Fix compilation with -DSSL_DEBUG -DTLS_DEBUG -DKSSL_DEBUG

PR#3141
(cherry picked from commit d183545d4589f1e7a40190400b8b99ea3d1f7f97)
Don't disable state strings with no-ssl2

Some state strings were erronously not compiled when no-ssl2
was set.

PR#3295
(cherry picked from commit 0518a3e19e18cfc441cab261b28441b8c8bd77bf)
Typo.

PR#3107
(cherry picked from commit 7c206db9280865ae4af352dbc14e9019a6c4795d)
Clarify protocols supported.

Update protocols supported and note that SSLv2 is effectively disabled
by default.

PR#3184
(cherry picked from commit 1b13a4f38dfc385d5e776f6b3e06c5795874cf9b)
Make no-ssl3 no-ssl2 do more sensible things.
(cherry picked from commit 7ae6a4b659facfd7ad8131238aa1d349cb3fc951)
Merge remote-tracking branch 'upstream/OpenSSL_1_0_1-stable' into 1.0.1-chacha
Fix for compiling without ChaCha&Poly support

Added AEAD tests
Merged from 1.0.2-chacha branch