aboutsummaryrefslogtreecommitdiff
path: root/crypto/openssl
Commit message (Collapse)AuthorAgeFilesLines
* OpenSSL: clean up botched merges in OpenSSL 3.0.9 importJung-uk Kim2023-08-112-43/+0
| | | | No functional change intended.
* OpenSSL: regen opensslv.h for OpenSSL 3.0.10Jung-uk Kim2023-08-111-5/+5
|
* OpenSSL: update to 3.0.10Pierre Pronchery2023-08-10127-398/+846
|\ | | | | | | | | | | | | | | | | | | | | | | | | OpenSSL 3.0.10 addresses: - CVE-2023-3817 - CVE-2023-3446 - CVE-2023-2975 (Note that the vendor branch commit incorrectly referenced 3.0.9.) Relnotes: Yes Pull request: https://github.com/freebsd/freebsd-src/pull/808 Sponsored by: The FreeBSD Foundation
* | libcrypto: add missing symbols to the fips providerPierre Pronchery2023-07-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenSSL 3 supports a modular architecture, allowing different providers to bring specific implementations of cryptographical algorithms. One such provider, "fips", ships with OpenSSL 3 directly, and groups algorithms that can be FIPS 140-2 validated. The import of OpenSSL 3.0.9 was building this provider incorrectly, missing symbols required for proper operation. In addition, without the change in OpenSSL's crypto/bn/bn_const.c, the FIPS module fails loading: `Undefined symbol "ossl_bignum_modp_1536_p"`. This change is consistent with crypto/bn/bn_dh.c though. Sponsored by: The FreeBSD Foundation Pull Request: https://github.com/freebsd/freebsd-src/pull/787
* | libcrypto: Revert recent changes to fix legacy and fips providersMark Johnston2023-07-041-2/+0
| | | | | | | | | | | | | | They break the !amd64 builds due to an underspecified include path and will be re-applied once that's fixed. Reported by: Ronald Klop <ronald-lists@klop.ws>
* | libcrypto: add missing symbols to the fips providerPierre Pronchery2023-07-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenSSL 3 supports a modular architecture, allowing different providers to bring specific implementations of cryptographical algorithms. One such provider, "fips", ships with OpenSSL 3 directly, and groups algorithms that can be FIPS 140-2 validated. The import of OpenSSL 3.0.9 was building this provider incorrectly, missing symbols required for proper operation. In addition, without the change in OpenSSL's crypto/bn/bn_const.c, the FIPS module fails loading: `Undefined symbol "ossl_bignum_modp_1536_p"`. This change is consistent with crypto/bn/bn_dh.c though. Sponsored by: The FreeBSD Foundation Pull Request: https://github.com/freebsd/freebsd-src/pull/787
* | Merge OpenSSL 3.0.9Pierre Pronchery2023-06-232983-132618/+385163
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrate to OpenSSL 3.0 in advance of FreeBSD 14.0. OpenSSL 1.1.1 (the version we were previously using) will be EOL as of 2023-09-11. Most of the base system has already been updated for a seamless switch to OpenSSL 3.0. For many components we've added `-DOPENSSL_API_COMPAT=0x10100000L` to CFLAGS to specify the API version, which avoids deprecation warnings from OpenSSL 3.0. Changes have also been made to avoid OpenSSL APIs that were already deprecated in OpenSSL 1.1.1. The process of updating to contemporary APIs can continue after this merge. Additional changes are still required for libarchive and Kerberos- related libraries or tools; workarounds will immediately follow this commit. Fixes are in progress in the upstream projects and will be incorporated when those are next updated. There are some performance regressions in benchmarks (certain tests in `openssl speed`) and in some OpenSSL consumers in ports (e.g. haproxy). Investigation will continue for these. Netflix's testing showed no functional regression and a rather small, albeit statistically significant, increase in CPU consumption with OpenSSL 3.0. Thanks to ngie@ and des@ for updating base system components, to antoine@ and bofh@ for ports exp-runs and port fixes/workarounds, and to Netflix and everyone who tested prior to commit or contributed to this update in other ways. PR: 271615 PR: 271656 [exp-run] Relnotes: Yes Sponsored by: The FreeBSD Foundation
* | OpenSSL: Merge OpenSSL 1.1.1uJung-uk Kim2023-05-3029-772/+344
| | | | | | | | (cherry picked from commit 8ecb489345f08012fdc92a202a40119891cac330)
* | OpenSSL: aes/asm/bsaes-armv7.pl: Replace adrl with addKornel Dulęba2023-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "adrl" is a pseudo-instruction used to calculate an address relative to PC. It's not recognized by clang resulting in a compilation error. I've stumbled upon it when trying to integrate the bsaes-armv7 assmebly logic into FreeBSD kernel, which uses clang as it's default compiler. Note that this affect the build only if BSAES_ASM_EXTENDED_KEY is defined, which is not the default option in OpenSSL. The solution here is to replace it with an add instruction. This mimics what has already been done in !BSAES_ASM_EXTENDED_KEY logic. Because of that I've marked this as trivial CLA. No objections from: jkim Obtained from: OpenSSL commit 27093ba73372935fe4ef91d0a45ce6ea90a1ac8e Differential Revision: https://reviews.freebsd.org/D39091
* | OpenSSL: Merge OpenSSL 1.1.1tJung-uk Kim2023-02-0735-96/+938
|\| | | | | | | Merge commit '0d51f658515c605fcc4a8073cb5a8e0d7d904088'
* | OpenSSL: Merge OpenSSL 1.1.1sJung-uk Kim2022-11-0148-342/+693
|\| | | | | | | Merge commit 'b6b67f23b82101d4c04c89f81d726b902ab77106'
* | OpenSSL: Merge OpenSSL 1.1.1qJung-uk Kim2022-07-0510-17/+49
|\| | | | | | | Merge commit 'f874e59ffcd8b5ecd018ad8311d78e866340f3e9'
* | OpenSSL: Merge OpenSSL 1.1.1pJung-uk Kim2022-06-2125-283/+297
|\| | | | | | | Merge commit '54ae8e38f717f22963c2a87f48af6ecefc6b3e9b'
* | OpenSSL: KTLS: Enable KTLS for receiving as well in TLS 1.3John Baldwin2022-05-041-11/+21
| | | | | | | | | | | | | | | | | | | | | | | | This removes a guard condition that prevents KTLS being enabled for receiving in TLS 1.3. Use the correct sequence number and BIO for receive vs transmit offload. Approved by: jkim Obtained from: OpenSSL commit 7c78932b9a4330fb7c8db72b3fb37cbff1401f8b MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D34976
* | OpenSSL: KTLS: Handle TLS 1.3 in ssl3_get_record.John Baldwin2022-05-041-16/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Don't unpad records, check the outer record type, or extract the inner record type from TLS 1.3 records handled by the kernel. KTLS performs all of these steps and returns the inner record type in the TLS header. - When checking the length of a received TLS 1.3 record don't allow for the extra byte for the nested record type when KTLS is used. - Pass a pointer to the record type in the TLS header to the SSL3_RT_INNER_CONTENT_TYPE message callback. For KTLS, the old pointer pointed to the last byte of payload rather than the record type. For the non-KTLS case, the TLS header has been updated with the inner type before this callback is invoked. Approved by: jkim Obtained from: OpenSSL commit a5fb9605329fb939abb536c1604d44a511741624 MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D34975
* | OpenSSL: KTLS: Add using_ktls helper variable in ssl3_get_record().John Baldwin2022-05-041-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When KTLS receive is enabled, pending data may still be present due to read ahead. This data must still be processed the same as records received without KTLS. To ease readability (especially in consideration of additional checks which will be added for TLS 1.3), add a helper variable 'using_ktls' that is true when the KTLS receive path is being used to receive a record. Approved by: jkim Obtained from: OpenSSL commit 031132c297e54cbc20404a0bf8de6ed863196399 MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D34974
* | OpenSSL: KTLS: Check for unprocessed receive records in ktls_configure_crypto.John Baldwin2022-05-044-81/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | KTLS implementations currently assume that the start of the in-kernel socket buffer is aligned with the start of a TLS record for the receive side. The socket option to enable KTLS specifies the TLS sequence number of this initial record. When read ahead is enabled, data can be pending in the SSL read buffer after negotiating session keys. This pending data must be examined to ensurs that the kernel's socket buffer does not contain a partial TLS record as well as to determine the correct sequence number of the first TLS record to be processed by the kernel. In preparation for enabling receive kernel offload for TLS 1.3, move the existing logic to handle read ahead from t1_enc.c into ktls.c and invoke it from ktls_configure_crypto(). Approved by: jkim Obtained from: OpenSSL commit 85773128d0e80cd8dcc772a6931d385b8cf4acd1 MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D34973
* | OpenSSL: Cleanup record length checks for KTLSJohn Baldwin2022-05-041-6/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | In some corner cases the check for packets which exceed the allowed record length was missing when KTLS is initially enabled, when some unprocessed packets are still pending. Approved by: jkim Obtained from: OpenSSL commit 8fff986d52606e1a33f9404504535e2e2aee3e8b MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D34972
* | OpenSSL: Merge OpenSSL 1.1.1oJung-uk Kim2022-05-0327-89/+180
|\| | | | | | | Merge commit 'cf0ffd7607ed8f39829c6951a65a55fa1eb3aafe'
* | OpenSSL: Merge OpenSSL 1.1.1nJung-uk Kim2022-03-1541-119/+296
| |
* | Fix a bug in BN_mod_sqrt() that can cause it to loop forever.Gordon Tetlow2022-03-152-14/+31
| | | | | | | | | | Obtained from: OpenSSL Project Security: CVE-2022-0778
* | OpenSSL: Fix the same BIO_FLAGS macro definitionJohn Baldwin2022-02-012-1/+3
| | | | | | | | | | | | | | | | | | | | | | Also add comment to the public header to avoid making another conflict in future. Reviewed by: jkim Obtained from: OpenSSL commit 5d4975ecd88ac17d0749513a8fac9a7c7befd900 MFC after: 1 week Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D34135
* | OpenSSL: Merge OpenSSL 1.1.1mJung-uk Kim2021-12-1466-219/+502
| | | | | | | | Merge commit '56eae1b760adf10835560a9ee595549a1f10410f'
* | SSL_sendfile: Replace ERR_raise_data with SYSerr.John Baldwin2021-12-141-1/+2
| | | | | | | | | | | | | | | | | | ERR_raise_data is only present in OpenSSL 3.0 and later. Reviewed by: jkim Obtained from: CheriBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D33363
* | Add assembly optimized code for OpenSSL on powerpc, powerpc64 and powerpc64lePiotr Kubaj2021-11-232-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | Summary: 1. https://github.com/openssl/openssl/commit/34ab13b7d8e3e723adb60be8142e38b7c9cd382a needs to be merged for ELFv2 support on big-endian. 2. crypto/openssl/crypto/ppccap.c needs to be patched. Same reason as in https://github.com/openssl/openssl/pull/17082. Approved by: jkim, jhibbits MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D33076
* | openssl: Fix detection of ARMv7 and ARM64 CPU featuresAllan Jude2021-11-221-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenSSL assumes the same value for AT_HWCAP=16 (Linux) So it ends up calling elf_auxv_info() with AT_CANARY which returns ENOENT, and all acceleration features are disabled. With this, my ARM64 test machine runs the benchmark `openssl speed -evp aes-256-gcm` nearly 20x faster going from 100 MB/sec to 2000 MB/sec It also improves sha256 from 300 MB/sec to 1800 MB/sec This fix has been accepted but not yet merged upstream: https://github.com/openssl/openssl/pull/17082 PR: 259937 Reviewed by: manu, imp MFC after: immediate Relnotes: yes Fixes: 88e852c0b5c872b1a ("OpenSSL: Merge OpenSSL 1.1.1j") Sponsored by: Ampere Computing LLC Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D33060
* | Import OpenSSL 1.1.1lJung-uk Kim2021-09-0179-332/+701
| |
* | Fix multiple OpenSSL vulnerabilities.Gordon Tetlow2021-08-2414-71/+177
| | | | | | | | | | | | | | Approved by: so Security: SA-21:16.openssl Security: CVE-2021-3711 Security: CVE-2021-3712
* | OpenSSL: Add support for Chacha20-Poly1305 to kernel TLS on FreeBSD.John Baldwin2021-08-172-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | FreeBSD's kernel TLS supports Chacha20 for both TLS 1.2 and TLS 1.3. NB: This commit has not yet been merged upstream as it is deemed a new feature and did not make the feature freeze cutoff for OpenSSL 3.0. Reviewed by: jkim MFC after: 5 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31443
* | OpenSSL: Refactor KTLS tests to better support TLS 1.3.John Baldwin2021-08-171-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | Most of this upstream commit touched tests not included in the vendor import. The one change merged in is to remove a constant only present in an internal header to appease the older tests. Reviewed by: jkim Obtained from: OpenSSL (e1fdd5262e4a45ce3aaa631768e877ee7b6da21b) MFC after: 5 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31442
* | OpenSSL: Update KTLS documentationJohn Baldwin2021-08-173-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | KTLS support has been changed to be off by default, and configuration is via a single "option" rather two "modes". Documentation is updated accordingly. Reviewed by: jkim Obtained from: OpenSSL (6878f4300213cfd7d4f01e26a8b97f70344da100) MFC after: 5 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31441
* | OpenSSL: Only enable KTLS if it is explicitly configuredJohn Baldwin2021-08-175-17/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It has always been the case that KTLS is not compiled by default. However if it is compiled then it was automatically used unless specifically configured not to. This is problematic because it avoids any crypto implementations from providers. A user who configures all crypto to use the FIPS provider may unexpectedly find that TLS related crypto is actually being performed outside of the FIPS boundary. Instead we change KTLS so that it is disabled by default. We also swap to using a single "option" (i.e. SSL_OP_ENABLE_KTLS) rather than two separate "modes", (i.e. SSL_MODE_NO_KTLS_RX and SSL_MODE_NO_KTLS_TX). Reviewed by: jkim Obtained from: OpenSSL (a3a54179b6754fbed6d88e434baac710a83aaf80) MFC after: 5 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31440
* | OpenSSL: ktls: Initial support for ChaCha20-Poly1305John Baldwin2021-08-172-1/+28
| | | | | | | | | | | | | | | | | | | | | | Linux kernel is going to support ChaCha20-Poly1305 in TLS offload. Add support for this cipher. Reviewed by: jkim Obtained from: OpenSSL (3aa7212e0a4fd1533c8a28b8587dd8b022f3a66f) MFC after: 5 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31439
* | OpenSSL: Correct the return value of BIO_get_ktls_*().John Baldwin2021-08-173-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BIO_get_ktls_send() and BIO_get_ktls_recv() are documented as returning either 0 or 1. However, they were actually returning the internal value of the associated BIO flag for the true case instead of 1. Also trim redundant ternary operators. Reviewed by: jkim Obtained from: OpenSSL (f16e52b67c9261bdc7e1284a50502a802921ac6d) MFC after: 5 days Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31438
* | OpenSSL: Merge OpenSSL 1.1.1kJung-uk Kim2021-03-2522-44/+166
|\| | | | | | | Merge commit '94fa08a4bcdfbb3434b025d67d014af3b18e5380'
* | Handle partial data re-sending on ktls/sendfile on FreeBSDOleksandr Tymoshenko2021-02-172-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a handler for EBUSY sendfile error in addition to EAGAIN. With EBUSY returned the data still can be partially sent and user code has to be notified about it, otherwise it may try to send data multiple times. PR: 251969 Reviewed by: jkim Obtained from: OpenSSL (dfcfd17f2818cf520ce6381aed9ec3d2fc12170d) MFC after: 1 week Sponsored by: Netflix (merging to FreeBSD) Differential Revision: https://reviews.freebsd.org/D28714
* | OpenSSL: Remove obsolete include directoryJung-uk Kim2021-02-1731-2134/+0
| | | | | | | | | | | | This directory was deprecated since OpenSSL 1.1.1e. https://github.com/openssl/openssl/pull/9681
* | OpenSSL: Merge OpenSSL 1.1.1jJung-uk Kim2021-02-1690-202/+433
|\| | | | | | | Merge commit '4f55bd5321b72491d4eff396e4928e9ab0706735'
* | OpenSSL: Support for kernel TLS offload (KTLS)John Baldwin2021-01-2834-86/+1428
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This merges upstream patches from OpenSSL's master branch to add KTLS infrastructure for TLS 1.0-1.3 including both RX and TX offload and SSL_sendfile support on both Linux and FreeBSD. Note that TLS 1.3 only supports TX offload. A new WITH/WITHOUT_OPENSSL_KTLS determines if OpenSSL is built with KTLS support. It defaults to enabled on amd64 and disabled on all other architectures. Reviewed by: jkim (earlier version) Approved by: secteam Obtained from: OpenSSL (patches from master) MFC after: 1 week Relnotes: yes Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D28273
* | Merge OpenSSL 1.1.1i.Jung-uk Kim2020-12-0935-119/+186
|\| | | | | | | Notes: svn path=/head/; revision=368472
* | OpenSSL: address CVE-2020-1971Ed Maste2020-12-086-10/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OpenSSL commit 3db2c9f3: Complain if we are attempting to encode with an invalid ASN.1 template OpenSSL commit 43a7033: Check that multi-strings/CHOICE types don't use implicit tagging OpenSSL commit f960d812: Correctly compare EdiPartyName in GENERAL_NAME_cmp() Obtained from: OpenSSL 3db2c9f3, 43a7033, f960d812 Security: CVE-2020-1971 Notes: svn path=/head/; revision=368447
* | Merge OpenSSL 1.1.1h.Jung-uk Kim2020-09-22250-3915/+2134
|\| | | | | | | Notes: svn path=/head/; revision=366004
* | Fix Clang version detection.Jung-uk Kim2020-08-2622-22/+22
| | | | | | | | | | | | | | | | | | | | We prepend "FreeBSD" to Clang version string. This broke compiler test for AVX instruction support. Reported by: jhb Notes: svn path=/head/; revision=364822
* | Merge OpenSSL 1.1.1g.Jung-uk Kim2020-04-2138-614/+1739
|\| | | | | | | Notes: svn path=/head/; revision=360175
* | Fix OpenSSL remote denial of service.Gordon Tetlow2020-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | See https://www.openssl.org/news/secadv/20200421.txt for details. Approved by: so Security: CVE-2020-1967 Notes: svn path=/head/; revision=360146
* | Merge OpenSSL 1.1.1f.Jung-uk Kim2020-03-3126-242/+267
|\| | | | | | | Notes: svn path=/head/; revision=359486
* | Merge OpenSSL 1.1.1e.Jung-uk Kim2020-03-18901-2971/+6878
|\| | | | | | | Notes: svn path=/head/; revision=359060
* | Merge OpenSSL 1.1.1d.Jung-uk Kim2019-09-10269-10545/+2999
|\| | | | | | | Notes: svn path=/head/; revision=352191
* | Merge OpenSSL 1.1.1c.Jung-uk Kim2019-05-28168-2108/+3528
|\| | | | | | | Notes: svn path=/head/; revision=348340
* | Merge OpenSSL 1.1.1b.Jung-uk Kim2019-02-26301-3540/+5472
|\| | | | | | | Notes: svn path=/head/; revision=344602