Document -debug_decrypt option.
(cherry picked from commit 0dd5b94aeb77c2982bdf6886962b7a8491c6c9ed)
Fix double frees.
Fix use after free.
Add new sponsors
(cherry picked from commit 351f0a124bffaa94d2a8abdec2e7dde5ae9c457d)
Fix eckey_priv_encode()

Fix eckey_priv_encode to return an error on failure of i2d_ECPrivateKey.
Fix version documentation.

Specify -f is for compilation flags. Add -d to synopsis section.

(cherry picked from commit 006397ea62bbcae22c8664d53c2222b808c4bdd1)

Closes #79.
POD: Fix item numbering

Newer pod2man considers =item [1-9] part of a numbered list, while =item
0 starts an unnumbered list. Add a zero effect formatting mark to override
this.

doc/apps/smime.pod around line 315: Expected text after =item, not a
number
...

PR#3146
Fixed spelling error in error message. Fix supplied by Marcos Marado
typo in SSL_get_peer_cert_chain docs

RT: 3304
Double free in i2o_ECPublicKey

PR: 3338
- fix coverity issues 966593-966596
Set Enveloped data version to 2 if ktri version not zero.
Initialize num properly.

PR#3289
PR#3345
(cherry picked from commit 3ba1e406c2309adb427ced9815ebf05f5b58d155)
dso: eliminate VMS code on non-VMS systems

Even though the meat of dso_vms.c is compiled out on non-VMS builds,
the (pre-)compiler still traverses some of the macro handling. This
trips up at least one non-VMS build configuration, so this commit
makes the skip-VMS case more robust.

Signed-off-by: Geoff Thorpe <geoff@openssl.org>
bignum: allow concurrent BN_MONT_CTX_set_locked()

The lazy-initialisation of BN_MONT_CTX was serialising all threads, as
noted by Daniel Sands and co at Sandia. This was to handle the case that
2 or more threads race to lazy-init the same context, but stunted all
scalability in the case where 2 or more threads are doing unrelated
things! We favour the latter case by punishing the former. The init work
gets done by each thread that finds the context to be uninitialised, and
we then lock the "set" logic after that work is done - the winning
thread's work gets used, the losing threads throw away what they've done.

Signed-off-by: Geoff Thorpe <geoff@openssl.org>
evp: prevent underflow in base64 decoding

This patch resolves RT ticket #2608.

Thanks to Robert Dugal for originally spotting this, and to David
Ramos for noticing that the ball had been dropped.

Signed-off-by: Geoff Thorpe <geoff@openssl.org>
Fixed NULL pointer dereference in PKCS7_dataDecode reported by David Ramos in PR#3339
fix coverity issue 966597 - error line is not always initialised
PR#3342 fix resource leak coverity issue 966577
coverity 966576 - close socket in error path