KNF (when not conflicting with other cleanup changes in progress)
delete extra word in Nd
Don't free garbage in ec_wNAF_mul() if wNAF could be allocated but
other allocations in the same block couldn't.

problem pointed out by David Ramos on the openssl-dev list
ok miod@ doug@
correct the failure case for getentropy on win32

CryptAcquireContext and CryptGenRandom returns zero (FALSE) if fails.

From: Dongsheng Song <dongsheng.song@gmail.com>
f{read,write} take a number of items and an item size as arguments, and
return the number of items read of written.

When you intend to return the number of bytes actually processed, it is
wise to pass 1 as the item size and the size as the number of items.

But in *some* places, the OpenSSL does the opposite, and has extra logic
to change a successful return of 1 (item processed) into the real size.

And, guess why it does that? Because of old VMS, for they (used to) have a
substandard stdio implementation.

Note that this change causes the return values of BIO_dump_fp() and
BIO_dump_indent_fp() to no longer be useless (actual number of callback calls),
but actual bytes output. Given the irrelevance of the return value before,
it is unlikely that anything depends upon it (and if something does, it
probably has other problems in need for a fix...)

ok tedu@ beck@ jsing@
Fix GOST TC26-B curve description.
Sacrifice this code to the KNF deities.
Add many missing error checks (probably not exhaustive, but a good start):
- make VKO_compute_key() no longer void so that it can return failure.
- fix unchecked allocations in too many routines to mention /-:
- fix unchecked BN operations in gost2001_do_sign(), gost2001_do_verify(),
  VKO_compute_key().
- fix the gost2001_do_sign() interface violation by having its sole caller
  free the BIGNUM it passes to that function by itself, instead of having
  the callee do this.

Reviewed (except for the last item) by Dmitry Eremin-Solenikov.
Reduce instances of `` '' in manuals.

troff displays these as typographic quotes, but nroff implementations
almost always print them literally, which rarely has the intended effect
with modern fonts, even in stock xterm.

These uses of `` '' can be replaced either with more semantic alternatives
or with Dq, which prints typographic quotes in a UTF-8 locale (but will
automatically fall back to `` '' in an ASCII locale).

improvements and ok schwarze@
Sort and group includes.
add new function crypt_newhash to simplify creating new hashes.
does most of the work pwd_gensalt did, but also creates the hash.
(unused yet)
Make the ECDSA_SIG bowels public. This matches RSA_SIG and DSA_SIG, and we
expect a good use for this knowledge in the tree in the near future.

Contributed by Vincent Gross, thanks!
Add the Cammelia cipher to libcrypto.

There used to be a strong reluctance to provide this cipher in LibreSSL in the
past, because the licence terms under which Cammelia was released by NTT were
free-but-not-in-the-corners, by restricting the right to modify the source
code, as well retaining the right to enforce their patents against anyone
in the future.

However, as stated in http://www.ntt.co.jp/news/news06e/0604/060413a.html ,
NTT changed its mind and made this code truly free. We only wish there had
been more visibility of this, for we could have had enabled Cammelia
earlier (-:

Licence change noticed by deraadt@. General agreement from the usual LibreSSL
suspects.

Crank libcrypto.so minor version due to the added symbols.
further BUF_strdup conversion: these places should be safe to rely on
the function argument not being NULL
Return success in param_copy_gost01() if there is no private key to copy;
broken in r1.3.
Spotted by Dmitry Eremin-Solenikov
More missing error checks I forgot to commit last week, part of the large
cleanup diff.
Enable the build of GOST routines in libcrypto. Riding upon the Cammelia
libcrypto minor bump.
Update the GOST code in libssl, as contributed by Dmitry Eremin-Solenikov.

This causes a libssl major version bump as this affects the layout of some
internal-but-unfortunately-made-visible structs.
Nuke more obvious #include duplications.

ok deraadt@ millert@ tedu@
Argh, another bug introduced in r1.3; Dmitry Eremin-Solenikov