Remove SSLv2 support

The only support for SSLv2 left is receiving a SSLv2 compatible client hello.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Remove incorrect code inadvertently introduced through commit 59669b6ab.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Update changes to indicate that SSLv2 support has been removed

Reviewed-by: Matt Caswell <matt@openssl.org>
pkey_gost_ctrl: check for NULL after allocating pctx->shared_ukm

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
pkey_gost_mac_keygen: check for NULL after allocating keydata

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
capi_get_provname: free name on error if it was malloc'ed

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
capi_cert_get_fname: check for NULL after allocating wfname

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
capi_get_key: check for NULL after allocating key

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
dtls1_process_heartbeat: check for NULL after allocating buffer

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
dtls1_heartbeat: check for NULL after allocating s->cert->ctypes

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
dtls1_new: free s on error path

Reviewed-by: Richard Levitte <levitte@openssl.org>
ssl_cert_dup: Fix memory leak

Always use goto err on failure and call ssl_cert_free() on the error path so all
fields and "ret" itself are freed

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
ssl_create_cipher_list: check whether push onto cipherstack succeeds

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Richard Levitte <levitte@openssl.org>
capi_get_provname: Check return values

Reviewed-by: Richard Levitte <levitte@openssl.org>
Replace GOST_R_MALLOC_FAILURE and GOST_R_NO_MEMORY with ERR_R_MALLOC_FAILURE

Reviewed-by: Richard Levitte <levitte@openssl.org>
Fix broken build

Add includes missing from commit 33eab3f6af51c6d7fe68ee4960930df4f1616bd5

Reviewed-by: Geoff Thorpe <geoff@openssl.org>
Reject elliptic curve lists of odd lengths.

The Supported Elliptic Curves extension contains a vector of NamedCurves
of 2 bytes each, so the total length must be even. Accepting odd-length
lists was observed to lead to a non-exploitable one-byte out-of-bounds
read in the latest development branches (1.0.2 and master). Released
versions of OpenSSL are not affected.

Thanks to Felix Groebert of the Google Security Team for reporting this issue.

Reviewed-by: Matt Caswell <matt@openssl.org>
Add extra checks for odd-length EC curve lists.

Odd-length lists should be rejected everywhere upon parsing. Nevertheless,
be extra careful and add guards against off-by-one reads.

Also, drive-by replace inexplicable double-negation with an explicit comparison.

Reviewed-by: Matt Caswell <matt@openssl.org>
Clarify the return values for SSL_get_shared_curve.

Reviewed-by: Matt Caswell <matt@openssl.org>
Add support for OCB mode as per RFC7253

Reviewed-by: Tim Hudson <tjh@openssl.org>