Three independent typos for `independent' or `independently'.
Replace the remaining ssl3_get_cipher_by_char() calls with n2s() and
ssl3_get_cipher_by_id().

ok bcook@
Remove non-standard GOST cipher suites (which are not compiled in
currently).

From Dmitry Eremin-Solenikov.
Replace the remaining uses of ssl3_put_cipher_by_char() with s2n and a
ssl3_cipher_get_value() helper function, which returns the cipher suite
value for the given cipher.

ok miod@
Let SSL_CIPHER_description() allocate the buffer for the description,
rather than passing in a fixed size buffer.

This is yet another example of a horribly designed API - if the given
buffer is NULL then SSL_CIPHER_description() allocates one for us (great!),
which we then need to free (no problem). However, if this allocation fails
it returns a pointer to a static string "OPENSSL_malloc Error" - obviously
bad things happen if we call free() with this pointer.

Unfortunately, there is no way of knowing that the function failed, other
than comparing the returned string against the string literal - so do that
before calling free()...

Joint work with beck@ during g2k14.
Include <sys/select.h> to get select

These files currently depends on the wrapper <stdlib.h> file indirectly
including a header that provides select().

from Jonas 'Sortie' Termansen

ok deraadt@ tedu@
Include <sys/time.h> to get struct timeval

The crypto/bio/bss_dgram.c file assumes that another file indirectly
includes <stdlib.h> that includes <sys/time.h>.

from Jonas 'Sortie' Termansen

ok deraadt@ tedu@
constify strerror return value

There is no intention to modify the string returned by strerror and
doing so is forbidden by the standard.

from Jonas 'Sortie' Termansen

ok tedu@ deraadt@
digests: *_LONG_LOG2 is not used, stop talking about it

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
md32_common: allow digest to override Final function

Define HASH_NO_FINAL to let digest implementation to provide Hash_Final
function on its own.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
SSL: Fix memory leak in d2i_SSL_SESSION

==28360== 98 bytes in 2 blocks are definitely lost in loss record 7 of 7
==28360==    at 0x402AC54: realloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==28360==    by 0x40E2D2C: ASN1_STRING_set (asn1_lib.c:393)
==28360==    by 0x40EC22C: asn1_ex_c2i (tasn_dec.c:959)
==28360==    by 0x40EC632: asn1_d2i_ex_primitive (tasn_dec.c:824)
==28360==    by 0x40ED2E6: ASN1_item_ex_d2i (tasn_dec.c:230)
==28360==    by 0x40ED421: ASN1_item_d2i (tasn_dec.c:133)
==28360==    by 0x40F0335: d2i_ASN1_OCTET_STRING (tasn_typ.c:75)
==28360==    by 0x405FD6D: d2i_SSL_SESSION (ssl_asn1.c:367)
==28360==    by 0x405DD6E: ssl3_send_newsession_ticket (s3_srvr.c:2743)
==28360==    by 0x405EA48: ssl3_accept (s3_srvr.c:665)
==28360==    by 0x4067C34: SSL_accept (ssl_lib.c:922)
==28360==    by 0x404E97B: ssl23_get_client_hello (s23_srvr.c:573)

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
s_client: don't call shutdown on non-existing socket descriptor

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Add GOST 28147-89 cipher implementation

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Add GOST 28147-89 MAC implementation

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Add GOSR R 34.11-94 message digest implementation

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Hook GOST 28147-89 cipher algorithms

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Add GOST 28147-89 ASN1 parameters support

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Hook GOST R 34.11-94 message digest algorithm

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Hook GOST 28147-89 MAC algorithm

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Hook GOST error handling and strings

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>