summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_init.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-11-01Update RSA ASN.1 code to handle RSA-PSS.jsing4-302/+389
From OpenSSL 1.1.1d. ok tb@
2019-11-01Clean up RSA_new_method().jsing1-40/+24
Use calloc() instead of malloc() for initialisation and remove explicit zero initialisation of members. This ensures that new members always get initialised. Also use a single error return path, simplifying code. ok tb@
2019-10-31Add RSA OAEP test for pkeyutl in appstest.shinoguchi1-1/+21
2019-10-31In rsa_pmeth.c rev. 1.30, jsing@ set the minimum RSA key lengthschwarze1-2/+3
for RSA key generation to 512 bits. Document that minimum.
2019-10-31Add CMS controls for RSA.jsing1-1/+8
2019-10-31Add support for RSA-PSS.jsing5-65/+370
From OpenSSL 1.1.1d. ok inoguchi@
2019-10-31Move RSA min modulus to a define and increase from 256 to 512 bits.jsing2-4/+6
From OpenSSL 1.1.1d. ok inoguchi@
2019-10-31Fix indent and indent before labels.jsing1-5/+5
2019-10-31Use braces where a statement has both multi-line and single-line blocks.jsing1-8/+13
Makes code more robust and reduces differences with OpenSSL. ok inoguchi@
2019-10-31Add additional validation of key size, message digest size and publicjsing1-3/+17
exponent. From OpenSSL 1.1.1d. ok inoguchi@
2019-10-31Clean up some code.jsing1-11/+13
Assign and test, explicitly test against NULL and use calloc() rather than malloc. ok inoguchi@
2019-10-31Avoid potentially leaking pub_exp in pkey_rsa_copy().jsing1-4/+4
ok inoguchi@
2019-10-29In rsa.h rev. 1.41, jsing@ provided RSA_pkey_ctx_ctrl(3).schwarze1-1/+26
Write the documentation from scratch.
2019-10-29merge documentation for several macros EVP_PKEY_CTX_*_rsa_oaep_*(3)schwarze1-4/+239
and EVP_PKEY_CTX_*_ecdh_*(3); from Antoine Salon <asalon at vmware dot com> via OpenSSL commit 87103969 Oct 1 14:11:57 2018 -0700 from the OpenSSL 1.1.1 branch, which is still under a free license
2019-10-29merge documentation for EVP_PKEY_CTX_set1_id(3), EVP_PKEY_CTX_get1_id(3),schwarze1-2/+57
and EVP_PKEY_CTX_get1_id_len(3), but make it sound more like English text; from Paul Yang via OpenSSL commit f922dac8 Sep 6 10:36:11 2018 +0800 from the OpenSSL 1.1.1 branch, which is still under a free license
2019-10-29merge documentation of EVP_PKEY_CTX_set_ec_param_enc(3)schwarze1-6/+23
from Stephen Henson via OpenSSL commit 146ca72c Feb 19 14:35:43 2015 +0000
2019-10-29correct HISTORY of some RSA control macrosschwarze1-5/+26
2019-10-29list supported algorithm ids and clarify how the engine argument is usedschwarze1-10/+50
2019-10-29Add two controls that were missed in the previous commit.jsing1-1/+13
2019-10-29Update RSA OAEP code.jsing2-21/+124
This syncs the RSA OAEP code with OpenSSL 1.1.1d, correctly handling OAEP padding and providing various OAEP related controls. ok inoguchi@ tb@
2019-10-29Provide EVP_PKEY_CTX_md().jsing2-8/+18
This handles controls with a message digest by name, looks up the message digest and then proxies the control through with the EVP_MD *. This is internal only for now and will be used in upcoming RSA related changes. Based on OpenSSL 1.1.1d. ok inoguchi@ tb@
2019-10-25Free maskHash when RSA_PSS_PARAMS is freed.jsing1-3/+23
ok tb@
2019-10-24Service names are still resolved with -nkn1-4/+4
Just like pfctl(8)'s -N, this flag only avoid DNS; "nc -vz ::1 socks" still works. Fix documentation by copying pfctl's wording. OK deraadt
2019-10-24Provide ASN1_TYPE_{,un}pack_sequence().jsing2-2/+36
These are internal only for now. Based on OpenSSL 1.1.1d. ok inoguchi@
2019-10-24Provide RSA_OAEP_PARAMS along with ASN.1 encoding/decoding.jsing2-2/+97
For now these are internal only. From OpenSSL 1.1.1d. ok inoguchi@
2019-10-24Bump libcrypto, libssl and libtls majors due to changes in struct sizesjsing3-6/+6
and symbol addition.
2019-10-24Add RSA_PSS_PARAMS pointer to RSA struct.jsing1-1/+8
This will be used by upcoming RSA-PSS code. ok tb@
2019-10-24Add maskHash field to RSA_PSS_PARAMS.jsing1-1/+4
This will be soon used as an optimisation and reduces the differences between OpenSSL. ok tb@
2019-10-24Provide RSA_pkey_ctx_ctrl().jsing3-2/+20
This is a wrapper around EVP_PKEY_CTX_ctrl() which requires the key to be either RSA or RSA-PSS. From OpenSSL 1.1.1d. ok tb@
2019-10-24Add EVP_PKEY_RSA_PSS.jsing1-1/+2
ok tb@
2019-10-24Print IP address in verbose modejob1-12/+34
OK kn@
2019-10-23Revert previous, which works for -N case but causes regress failuresbeck1-18/+1
for tls, since the socket is shut down without calling tls_close(). Since nc appears to have a problem with this in other shutdown() cases I am simply going to bake a new diff for this. noticed by bluhm@.
2019-10-17Sync RSA_padding_check_PKCS1_OAEP_mgf1().jsing1-64/+111
Update RSA_padding_check_PKCS1_OAEP_mgf1() with code from OpenSSL 1.1.1d (with some improvements/corrections to comments). This brings in code to make the padding check constant time. ok inoguchi@ tb@
2019-10-17Fix -N flag to actually shut down the (entire) socket when the inputbeck1-1/+18
goes away. This allows for using nc in cases where the network server will no longer expect anything after eof, instead of hanging waiting for more input from our end. Additionaly, shut down if tls is in use if either side of the socket goes away, since we higher level TLS operations (tls_read and write) will require the socket to be both readable and writable as we can get TLS_WANT_POLLIN or TLS_WANT_POLLOUT on either operation. deraadt@ buying it. found by sthen@
2019-10-17Provide err_clear_last_constant_time() as a way of clearing an error fromjsing2-1/+24
the top of the error stack in constant time. This will be used by upcoming RSA changes. From OpenSSL 1.1.1d. ok inoguchi@ tb@
2019-10-10bump internal version to 3.0.2bcook1-2/+2
2019-10-10bump to 3.0.2bcook1-2/+2
2019-10-09Use EVP_MAX_MD_SIZE instead of SHA_DIGEST_LENGTH and remove OPENSSL_NO_SHA*jsing1-7/+2
conditionals, now that this code handles arbitrary message digests. ok inoguchi@ tb@
2019-10-04Fix a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey.tb4-11/+35
(Note that the CMS code is currently disabled.) Port of Edlinger's Fix for CVE-2019-1563 from OpenSSL 1.1.1 (old license) tests from bluhm@ ok jsing commit e21f8cf78a125cd3c8c0d1a1a6c8bb0b901f893f Author: Bernd Edlinger <bernd.edlinger@hotmail.de> Date: Sun Sep 1 00:16:28 2019 +0200 Fix a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey An attack is simple, if the first CMS_recipientInfo is valid but the second CMS_recipientInfo is chosen ciphertext. If the second recipientInfo decodes to PKCS #1 v1.5 form plaintext, the correct encryption key will be replaced by garbage, and the message cannot be decoded, but if the RSA decryption fails, the correct encryption key is used and the recipient will not notice the attack. As a work around for this potential attack the length of the decrypted key must be equal to the cipher default key length, in case the certifiate is not given and all recipientInfo are tried out. The old behaviour can be re-enabled in the CMS code by setting the CMS_DEBUG_DECRYPT flag. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9777) (cherry picked from commit 5840ed0cd1e6487d247efbc1a04136a41d7b3a37)
2019-10-04Use a valid curve when constructing an EC_KEY that looks like X25519.jsing1-2/+3
The recent EC group cofactor change results in stricter validation, which causes the EC_GROUP_set_generator() call to fail. Issue reported and fix tested by rsadowski@ ok tb@
2019-10-04Provide internal RSA_padding_{add,check}_PKCS1_OAEP_mgf1() functions.jsing2-10/+90
These are internal only for now and will be made public at a later date. The RSA_padding_{add,check}_PKCS1_OAEP() functions become wrappers around the *_mgf1() variant. ok tb@ inoguchi@ (as part of a larger diff)
2019-10-04Avoid a path traversal bug in s_server on Windows.bcook1-3/+3
openssl s_server has an arbitrary read vulnerability on Windows when run with the -WWW or -HTTP options, due to an incomplete path check logic. Thanks to Jobert Abma for reporting. ok tb@
2019-10-04the formatting for the mini synopses in this page did not render welljmc1-115/+179
on html or groff. the solution, to replace the non-standard .nr macros with a hang list, was provided by ingo - thanks! ok schwarze
2019-10-03Move towards making RSA OAEP functions handle arbitrary message digests.jsing1-53/+59
Based on OpenSSL 1.1.1. ok tb@, inoguchi@ (on an earlier/larger diff)
2019-09-30bump for LibreSSL 3.0.1libressl-v3.0.1bcook1-3/+3
2019-09-29zap trailing whitespace;jmc1-3/+3
2019-09-29If a NULL or zero cofactor is passed to EC_GROUP_set_generator(),tb3-11/+113
try to compute it using Hasse's bound. This works as long as the cofactor is small enough. Port of Brumley's fix for CVE-2019-1547 in OpenSSL 1.1.1 (old license) tests & ok inoguchi input & ok jsing commit 30c22fa8b1d840036b8e203585738df62a03cec8 Author: Billy Brumley <bbrumley@gmail.com> Date: Thu Sep 5 21:25:37 2019 +0300 [crypto/ec] for ECC parameters with NULL or zero cofactor, compute it The cofactor argument to EC_GROUP_set_generator is optional, and SCA mitigations for ECC currently use it. So the library currently falls back to very old SCA-vulnerable code if the cofactor is not present. This PR allows EC_GROUP_set_generator to compute the cofactor for all curves of cryptographic interest. Steering scalar multiplication to more SCA-robust code. This issue affects persisted private keys in explicit parameter form, where the (optional) cofactor field is zero or absent. It also affects curves not built-in to the library, but constructed programatically with explicit parameters, then calling EC_GROUP_set_generator with a nonsensical value (NULL, zero). The very old scalar multiplication code is known to be vulnerable to local uarch attacks, outside of the OpenSSL threat model. New results suggest the code path is also vulnerable to traditional wall clock timing attacks. CVE-2019-1547 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/9781)
2019-09-28Xr random 4 in a better wayderaadt1-3/+5
2019-09-14Add comment line saying S is described vaguely on purpose.otto1-2/+3
Prompted by guenther@
2019-09-10document EVP_PKEY_CTX_get_signature_md(3);schwarze1-4/+17
jsing@ provided it in evp.h rev. 1.77