summaryrefslogtreecommitdiffstats
path: root/lib (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Sync RSA_padding_check_PKCS1_OAEP_mgf1().jsing2019-10-171-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@
* Provide err_clear_last_constant_time() as a way of clearing an error fromjsing2019-10-172-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@
* bump internal version to 3.0.2bcook2019-10-101-2/+2
|
* bump to 3.0.2bcook2019-10-101-2/+2
|
* Use EVP_MAX_MD_SIZE instead of SHA_DIGEST_LENGTH and remove OPENSSL_NO_SHA*jsing2019-10-091-7/+2
| | | | | | conditionals, now that this code handles arbitrary message digests. ok inoguchi@ tb@
* convert unbounded sprintf/strcpy (in disabled debug code) to snprintf/strlcpyderaadt2019-10-081-6/+6
|
* The mips64 symbol table layout means we have to consider symbol visibilityguenther2019-10-051-1/+2
| | | | | and skip 'protected' symbols when identifying which functions will be subjects of lazy resolution
* Get the architecture from the ELF header instead of running uname,guenther2019-10-051-5/+10
| | | | so that we can operate on libs from other archs
* Fix a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey.tb2019-10-044-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)
* Use a valid curve when constructing an EC_KEY that looks like X25519.jsing2019-10-041-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@
* Provide internal RSA_padding_{add,check}_PKCS1_OAEP_mgf1() functions.jsing2019-10-042-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)
* Move towards making RSA OAEP functions handle arbitrary message digests.jsing2019-10-031-53/+59
| | | | | | Based on OpenSSL 1.1.1. ok tb@, inoguchi@ (on an earlier/larger diff)
* bump for LibreSSL 3.0.1bcook2019-09-301-3/+3
|
* Update compiler-rt to 8.0.1. This is mostly a cosmetic update for us.patrick2019-09-2925-253/+417
| | | | | Tested in snaps ok kettenis@
* zap trailing whitespace;jmc2019-09-291-3/+3
|
* If a NULL or zero cofactor is passed to EC_GROUP_set_generator(),tb2019-09-293-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)
* Xr random 4 in a better wayderaadt2019-09-281-3/+5
|
* 1) don't repeat the 256 / EIO commentaryderaadt2019-09-281-7/+6
| | | | | 2) say that the data comes from the random(4) subsystem, so that curious people can go read up on how this works
* Make compiler-rt's __clear_cache() work on 32-bit ARM by makingpatrick2019-09-281-2/+2
| | | | | | | it use sysarch(). From Josh Elsasser ok kettenis@
* correctly handle read(2) return value.eric2019-09-281-3/+10
| | | | | | fix issue reported by Mikolaj Kucharski. ok martijn@ deraadt@
* Update libexpat to 2.2.8. CVE-2019-15903 has been fixed earlierbluhm2019-09-2534-13950/+12611
| | | | | | in our tree. Relevant is only bug fix #240. Most of the upstream diff is automated source format change. OK deraadt@
* the mentioned .Fn functions are in a another file, so .Xr themderaadt2019-09-251-5/+5
| | | | ok jmc
* pcap-filter now section 5: adjust Xrjmc2019-09-251-3/+3
|
* mdoc version of pcap-filter;jmc2019-09-253-759/+927
| | | | | | | conversion suggested by deraadt, as well as renaming from section 7 to section 5; ok deraadt
* Add comment line saying S is described vaguely on purpose.otto2019-09-141-2/+3
| | | | Prompted by guenther@
* Fix heap overflow in libexpat 2.2.7 triggered by XML_GetCurrentLineNumberbluhm2019-09-101-7/+13
| | | | | | | (or XML_GetCurrentColumnNumber), and deny internal entities closing the doctype; CVE-2019-15903 fixed in commit c20b758c332d9a13afbbb276d30db1d183a85d43 OK tb@
* document EVP_PKEY_CTX_get_signature_md(3);schwarze2019-09-101-4/+17
| | | | jsing@ provided it in evp.h rev. 1.77
* Plug memory leak in error paths. Found while comparing this filetb2019-09-091-5/+5
| | | | | | with OpenSSL 1.1.1's version which contains a similar fix. ok jsing
* Provide EVP_PKEY_CTX_get_signature_md() macro and implement thejsing2019-09-094-7/+25
| | | | | | | | EVP_PKEY_CTRL_GET_MD control for DSA, EC and RSA. This is used by the upcoming RSA CMS code. ok inoguchi@ tb@
* Load CMS error strings.jsing2019-09-091-1/+5
|
* Move #include <openssl/cms.h> to more appropriate location (since it isjsing2019-09-091-3/+2
| | | | now being installed).
* Install the openssl/cms.h header.jsing2019-09-091-1/+3
| | | | | | | | This header includes OPENSSL_NO_CMS guards, so even if things find the header it provides no useful content (and other code should technically also be using OPENSSL_NO_CMS...). ok deraadt@ inoguchi@
* sbrk(2) already existed in Version 4 AT&T UNIX;schwarze2019-09-081-5/+7
| | | | | source: https://minnie.tuhs.org/cgi-bin/utree.pl?file=V4/man/man2/break.2 pointed out by Sevan Janiyan <venture37 at geeklan dot co dot uk>
* Add CMS ECC support.jsing2019-09-081-2/+370
| | | | | | | | This brings in EC code from OpenSSL 1.1.1b, with style(9) and whitespace cleanups. All of this code is currently under OPENSSL_NO_CMS hence is a no-op. ok inoguchi@
* more Version 1 AT&T UNIX history:schwarze2019-09-072-8/+18
| | | | | a few cases that weren't altogether straightforward; tweak and OK jmc@, OK sobrado@
* More Version 1 AT&T UNIX history.schwarze2019-09-063-20/+23
| | | | | | This became possible because copies of the original v1 manuals have shown up on the Internet some time ago. Reminded by Sevan Janiyan <venture37 at geeklan dot co dot uk>.
* Add various macros and controls for EC_PKEY_CTX.jsing2019-09-064-28/+316
| | | | | | | | | These are needed for the upcoming EC CMS support (nothing else appears to use them). This largely syncs our ec_pmeth.c with OpenSSL 1.1.1b. With input from inoguchi@ and tb@. ok inoguchi@ tb@
* Handle CMS PEM headers.jsing2019-09-061-1/+11
| | | | ok inoguchi@ tb@
* Correct the description of EINTR and EINVAL. This looks like a mis-mergeasou2019-09-061-6/+8
| | | | | | in revision 1.30. ok deraadt@ tb@
* Add objects for ECDH schemes in RFC 5753.jsing2019-09-052-0/+32
| | | | | | Based on OpenSSL 1.1.1b. ok inoguchi@ tb@
* Build ecdh_kdf.cjsing2019-09-051-2/+2
|
* Replace OPENSSL_cleanse() with explicit_bzero().jsing2019-09-051-1/+1
|
* Provide prototype for ecdh_KDF_X9_63()jsing2019-09-051-1/+7
|
* Include correct header.jsing2019-09-051-1/+1
|
* style(9) and whitespace.jsing2019-09-051-65/+72
|
* Restore per-file license/copyright removed in OpenSSL commit 4f22f40507f.jsing2019-09-051-5/+48
|
* Remove ECDH_KDF_X9_62 wrapper.jsing2019-09-051-12/+0
|
* Provide ECDH KDF for X9.63 as needed for CMS ECC.jsing2019-09-051-0/+81
| | | | | | From OpenSSL 1.1.1b. ok tb@ inoguchi@
* gettimeofday, settimeofday(2): limit timezone supportcheloha2019-09-041-31/+31
| | | | | | | | | | | | | | | | | | | | | | For gettimeofday(2), always copy out an empty timezone struct. For settimeofday(2), still copyin(9) the struct but ignore the contents. In gettimeofday(2)'s case we have not changed the original BSD semantics: the kernel only tracks UTC time without an offset for DST, so a zeroed timezone struct is the correct thing to return to the caller. Future work could move these out into libc as stubs for clock_gettime and clock_settime(2). But, definitely a "later" thing, given that we are in beta. Update the manpage to de-emphasize the timezone parameters for these syscalls. Discussed with tedu@, deraadt@, millert@, kettenis@, yasuoka@, jca@, and guenther@. Tested by job@. Ports input from jca@ and sthen@. Manpage input from jca@. ok jca@ deraadt@
* Correct the length of read from file, wide character buffer, add NULasou2019-09-041-5/+5
| | | | | | | | terminate to read buffer. This fix the bug that does not run input command entered by vi editor. This fix is come from NetBSD lib/libedit/vi.c 1.46 and 1.47. ok schwarze@ deraadt@