Commit Graph

1754 Commits

Author SHA1 Message Date
christos 65a6eb62ad Don't use the hcrypto version, use the OpenSSL one. 2023-06-20 17:22:01 +00:00
christos 9b6abc8760 Add hcrypto/ui.h to avoid -I gymnastics everywhere else 2023-06-20 16:49:46 +00:00
mrg 6913120ff0 re-fix the previous - i had only fixed one case, not the general one.
guard the .BEGIN: rule with:

   .if !make(clean) && !make(cleandir) && !make(distclean) && !make(obj)

so that it doesn't trigger in cases where we don't expect the objdir
to exist already, or we don't want to be adding things while we're
cleaning them out.
2023-06-20 07:17:11 +00:00
mrg 1a2bd47ea1 don't try to setup things in objdir before it exists. 2023-06-20 05:06:04 +00:00
mrg 02952e8c1c XXX stop gap to fix the builds in a way that doesn't make them useless.
it does build "ui.c" a large number of times into individual places.
in the libraries, they're force to local symbols, and in the binaries
it doesn't really matter.
2023-06-20 00:30:16 +00:00
mrg a4ccfd02eb fix missing header issues.
might seems to have an undef symbol issue in libkrb5.so:
hc_UI_UTIL_read_pw_string
2023-06-19 23:56:55 +00:00
christos e2a3a913a6 Adjust the build to include ui.c from hcrypto. 2023-06-19 23:11:43 +00:00
christos 3120d7d64c need the hcrypto/ui.h header for UI_UTIL_read_pw_string/UI_UTIL_FLAG_VERIFY* 2023-06-19 23:10:48 +00:00
christos afab4e300d Merge differences between 7.7.0 and 7.8.0 2023-06-19 21:41:38 +00:00
christos dd75ac5b44 Import heimdal-7.8.0 (previous was 7.7.0)
This release includes both the Heimdal 7.7.1 Security Vulnerability
fixes and non-Security bug fixes/improvements.

Security Vulnerabilities:
- CVE-2022-42898 PAC parse integer overflows
- CVE-2022-3437 Overflows and non-constant time leaks in DES{,3} and arcfour
- CVE-2022-41916 Fix Unicode normalization read of 1 bytes past end of array
- CVE-2021-44758 A null pointer de-reference DoS in SPNEGO acceptors
- CVE-2021-3671 A null pointer de-reference when handling missing sname
  in TGS-REQ
- CVE-2022-44640 Heimdal KDC: invalid free in ASN.1 codec
  Note that CVE-2022-44640 is a severe vulnerability, possibly a 10.0
  on the Common Vulnerability Scoring System (CVSS) v3, as we believe
  it should be possible to get an RCE on a KDC, which means that
  credentials can be compromised that can be used to impersonate
  anyone in a realm or forest of realms.

  Heimdal's ASN.1 compiler generates code that allows specially
  crafted DER encodings of CHOICEs to invoke the wrong free function
  on the decoded structure upon decode error. This is known to impact
  the Heimdal KDC, leading to an invalid free() of an address partly
  or wholly under the control of the attacker, in turn leading to a
  potential remote code execution (RCE) vulnerability.

  This error affects the DER codec for all extensible CHOICE types
  used in Heimdal, though not all cases will be exploitable. We have
  not completed a thorough analysis of all the Heimdal components
  affected, thus the Kerberos client, the X.509 library, and other
  parts, may be affected as well.

  This bug has been in Heimdal's ASN.1 compiler since 2005, but it may
  only affect Heimdal 1.6 and up. It was first reported by Douglas
  Bagnall, though it had been found independently by the Heimdal
  maintainers via fuzzing a few weeks earlier.

  While no zero-day exploit is known, such an exploit will likely be
  available soon after public disclosure.
- CVE-2019-14870: Validate client attributes in protocol-transition
- CVE-2019-14870: Apply forwardable policy in protocol-transition
- CVE-2019-14870: Always lookup impersonate client in DB

Other changes:
- Bugs found by UBSAN (including the incorrect encoding of unconstrained
  INTEGER value -1).
- Errors found by the LLVM scan-build static analyzer.
- Errors found by the valgrind memory debugger.
- Work around GCC Bug 95189 (memcmp wrongly stripped like strcmp).
- Correct ASN.1 OID typo for SHA-384
- Fix a deadlock in in the MEMORY ccache type.
- TGS: strip forwardable and proxiable flags if the server is
  disallowed.
- CVE-2019-14870: Validate client attributes in protocol-transition
- CVE-2019-14870: Apply forwardable policy in protocol-transition
- CVE-2019-14870: Always lookup impersonate client in DB
- Incremental HDB propagation improvements
  Refactor send_diffs making it progressive
  Handle partial writes on non-blocking sockets
  Disable Nagle in iprop master and slave
  Use async I/O
  Don't send I_HAVE in response to AYT
  Do not recover log in kadm5_get_principal()
  Don't send diffs to slaves with not yet known version
  Don't stutter in send_diffs
- Optional backwards-compatible anon-pkinit behavior
2023-06-19 21:33:04 +00:00
christos 4ff621cc11 Split the SUBDIR variable into a separate Makefile so it can be used
by /usr/src/lib/Makefile
2023-06-17 15:45:51 +00:00
christos cd98df3318 don't assume that the root directory of CVS is called src (Jan-Benedict Glaw) 2023-06-08 21:24:00 +00:00
lukem 230c41e44c adapt to ${CC_WNO_IMPLICIT_FALLTHROUGH}
Use ${CC_WNO_IMPLICIT_FALLTHROUGH} instead of
the older style more complex expressions.
2023-06-03 21:30:20 +00:00
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
christos 7b2118de5f Add checks to EVP_CipherInit_ex() where they were missing and add a cheesy
define to get the RC4 cipher from the legacy provider, since the legacy
provider is not loaded by default now.
2023-06-01 20:40:18 +00:00
christos 63c35a6c57 fix the build 2023-05-31 20:57:31 +00:00
christos a53fe4a1e9 regen 2023-05-31 20:43:28 +00:00
christos cd340f292c regen 2023-05-31 19:35:31 +00:00
christos d6e24a893e merge conflicts between 3.0.8 and 3.0.9 2023-05-31 19:30:28 +00:00
christos 4170684f22 Import OpenSSL-3.0.9
### Changes between 3.0.8 and 3.0.9 [30 May 2023]

 * Mitigate for the time it takes for `OBJ_obj2txt` to translate gigantic
   OBJECT IDENTIFIER sub-identifiers to canonical numeric text form.

   OBJ_obj2txt() would translate any size OBJECT IDENTIFIER to canonical
   numeric text form.  For gigantic sub-identifiers, this would take a very
   long time, the time complexity being O(n^2) where n is the size of that
   sub-identifier.  ([CVE-2023-2650])

   To mitigitate this, `OBJ_obj2txt()` will only translate an OBJECT
   IDENTIFIER to canonical numeric text form if the size of that OBJECT
   IDENTIFIER is 586 bytes or less, and fail otherwise.

   The basis for this restriction is RFC 2578 (STD 58), section 3.5. OBJECT
   IDENTIFIER values, which stipulates that OBJECT IDENTIFIERS may have at
   most 128 sub-identifiers, and that the maximum value that each sub-
   identifier may have is 2^32-1 (4294967295 decimal).

   For each byte of every sub-identifier, only the 7 lower bits are part of
   the value, so the maximum amount of bytes that an OBJECT IDENTIFIER with
   these restrictions may occupy is 32 * 128 / 7, which is approximately 586
   bytes.

   Ref: https://datatracker.ietf.org/doc/html/rfc2578#section-3.5

   *Richard Levitte*

 * Fixed buffer overread in AES-XTS decryption on ARM 64 bit platforms which
   happens if the buffer size is 4 mod 5 in 16 byte AES blocks. This can
   trigger a crash of an application using AES-XTS decryption if the memory
   just after the buffer being decrypted is not mapped.
   Thanks to Anton Romanov (Amazon) for discovering the issue.
   ([CVE-2023-1255])

   *Nevine Ebeid*

 * Reworked the Fix for the Timing Oracle in RSA Decryption ([CVE-2022-4304]).
   The previous fix for this timing side channel turned out to cause
   a severe 2-3x performance regression in the typical use case
   compared to 3.0.7. The new fix uses existing constant time
   code paths, and restores the previous performance level while
   fully eliminating all existing timing side channels.
   The fix was developed by Bernd Edlinger with testing support
   by Hubert Kario.

   *Bernd Edlinger*

 * Corrected documentation of X509_VERIFY_PARAM_add0_policy() to mention
   that it does not enable policy checking. Thanks to David Benjamin for
   discovering this issue.
   ([CVE-2023-0466])

   *Tomáš Mráz*

 * Fixed an issue where invalid certificate policies in leaf certificates are
   silently ignored by OpenSSL and other certificate policy checks are skipped
   for that certificate. A malicious CA could use this to deliberately assert
   invalid certificate policies in order to circumvent policy checking on the
   certificate altogether.
   ([CVE-2023-0465])

   *Matt Caswell*

 * Limited the number of nodes created in a policy tree to mitigate
   against CVE-2023-0464.  The default limit is set to 1000 nodes, which
   should be sufficient for most installations.  If required, the limit
   can be adjusted by setting the OPENSSL_POLICY_TREE_NODES_MAX build
   time define to a desired maximum number of nodes or zero to allow
   unlimited growth.
   ([CVE-2023-0464])

   *Paul Dale*
2023-05-31 19:25:17 +00:00
hgutch 18ffd308fa Explicitly run openssl's "gen" script in a shell
The script has permissions 755 in the repo but ends up with permissions
644 in the source sets, therefore we cannot invoke it simply as
path/to/gen .
2023-05-27 20:51:22 +00:00
riastradh 7072e38764 openssl: Delete capi makefiles -- not likely to ever see use here. 2023-05-27 02:30:40 +00:00
riastradh aae5207d1c openssl: Nix capi.so engine -- it's for the Windows crypto API.
Not likely to work in NetBSD base!
2023-05-27 02:28:45 +00:00
riastradh 3cfc95ce12 openssl: padlock.so engine for VIA CPUs makes sense only on x86. 2023-05-27 00:08:30 +00:00
riastradh 5ee8a6418c openssl: Link engines against libcrypto so they can be loaded. 2023-05-26 23:13:37 +00:00
riastradh 717caf24ae openssl: Wire up dynamic engine build goo.
This restores the devcrypto engine, which was converted from static
to dynamic since the previous OpenSSL update.

XXX Pretty sure I got some of the set list package names wrong, but
it's not clear what the right ones are or what consequences any of
this has.

XXX Needs testing.
2023-05-26 22:27:50 +00:00
riastradh 1bca1b82cb Revert "openssl: Nix build goo for dynamically loaded engines."
Turns out there is a regression lurking here: the devcrypto engine
was made dynamic-only (https://github.com/openssl/openssl/pull/7859),
so to maintain that functionality, we need to build dynamic engines.
Will fix the aarch64 build issue and wire things up separately.
2023-05-26 22:26:10 +00:00
riastradh 6377aad786 openssl: Nix build goo for dynamically loaded engines.
- Engines are deprecated in openssl 3.

- We never actually had the .so engines wired up to be built in
  openssl 1.1, and judging by the lack of obsolete entries in the set
  lists, I don't think we ever had them wired up to be built at all.
2023-05-26 13:21:51 +00:00
riastradh 06e60785a0 openssl: Consolidate new CWARNFLAGS.clang stuff in Makefile.openssl. 2023-05-25 19:12:06 +00:00
christos 0ca4a2096b add a little const to help clang 2023-05-25 17:20:14 +00:00
riastradh acf361f7fc openssl: Suppress clang warnings for using string literals as char *.
Not sure this is actually forbidden by the C standard.  There may be
bugs lurking here, but OpenSSL uses this extensively, so let's just
get the build going again.
2023-05-25 16:05:27 +00:00
riastradh f68d28ccb5 openssl: Nix trailing whitespace in build goo.
No functional change intended.
2023-05-25 15:52:28 +00:00
christos 5442314cf2 centralie warnings 2023-05-23 12:04:42 +00:00
christos f49971e7bf remove old files that cause conflicts on case insensitive filesystems. Reported
by lukem@
2023-05-20 14:44:29 +00:00
christos 80473f9937 vax-inate (does not have _pic, .a is pic) 2023-05-19 18:45:52 +00:00
christos f64148b9a8 fix riscv32 2023-05-18 00:27:08 +00:00
christos c80c2c5435 add missing assembly stub macro, remove WARNS=0 2023-05-17 19:09:41 +00:00
christos e866d5f23c include earm to <=5 2023-05-16 19:22:58 +00:00
christos 136cc48766 fix ia64 2023-05-16 19:10:23 +00:00
christos d160f67663 use the pic version of the common library (affects hppa/alpha) 2023-05-16 19:06:09 +00:00
riastradh 4f2595521a openssl: Limit armv8 stuff to aarch64.
Strictly speaking there is armv8 aarch32, e.g. AES instructions are
exposed to 32-bit mode, but OpenSSL's `*_armv8.S' files are staunchly
aarch64 and don't work when built for aarch64 32-bit compat libraries
(which could take advantage of armv8 instructions, but only if the
code is actually aarch32, which it isn't).

The armv8 stuff is still included in aarch64 /usr/lib/libcrypto, just
not in the 32-bit compat libraries.

With any luck, this will fix the aarch64 clang build (again).
2023-05-16 18:25:54 +00:00
martin 6b1434d492 Simplify previous, from Riastradh 2023-05-16 09:52:30 +00:00
christos f7df41b2a4 fix typo 2023-05-15 21:55:26 +00:00
christos 98943f2f8c add riskv64 from Robert Swindells 2023-05-15 21:09:10 +00:00
martin 89bee5e893 32bit sparc needs the atomic hack too 2023-05-15 17:06:05 +00:00
christos 91acd0302c fix ppc, sh3 2023-05-15 16:12:03 +00:00
martin 741d15f3ae armv4 also needs the atomic hack 2023-05-15 14:27:29 +00:00
martin d4e0b3912e Fix armv5 2023-05-15 14:08:17 +00:00
christos a15acc0ca9 fix build 2023-05-15 14:04:38 +00:00
christos dc2384b526 fix mips 2023-05-15 13:54:12 +00:00
christos a44e145462 fix powerpc 2023-05-14 21:28:36 +00:00
christos 8c0cfe7a2b make things link 2023-05-14 19:52:39 +00:00
christos 33f7a1f145 make arm build 2023-05-14 17:50:29 +00:00
christos 30e1e2b7fc fix alpha 2023-05-13 18:59:36 +00:00
christos 97591ca356 fix m68k/i386 2023-05-13 13:43:25 +00:00
riastradh ffc5358d68 libcryptotest: Suppress some warnings.
Detected by clang aarch64 32-bit arm compat library build.
2023-05-13 11:11:39 +00:00
christos 84495a947b we don't have int128 2023-05-12 02:23:32 +00:00
christos 2808d7da00 fix vax, restructure. 2023-05-11 20:08:59 +00:00
christos fcbfaf3da8 fix sparc64 2023-05-11 15:26:13 +00:00
christos dd97656630 changes to get aarch64 to link 2023-05-11 14:36:11 +00:00
christos d392e29584 add glue to make it link 2023-05-11 01:45:38 +00:00
christos 902282dac0 regen for 64 bit arm and make it link 2023-05-11 01:31:54 +00:00
christos 738424bae8 avoid dup openssl 2023-05-10 02:23:56 +00:00
christos c3599c3821 Handle OpenSSH-3.x 2023-05-09 22:25:26 +00:00
christos 86e114eabf Handle OpenSSL-3.x 2023-05-09 22:12:33 +00:00
christos 38cbfbd6b7 make things build again. 2023-05-09 19:22:07 +00:00
christos d4d317b21f Add new files 2023-05-09 17:22:43 +00:00
christos 1b3d6f9380 Regen 2023-05-09 17:21:16 +00:00
christos 5aa989d31c fix 32 bit builds 2023-05-09 16:41:29 +00:00
christos ac172e9e3f deal with OpenSSL-3.x 2023-05-09 02:19:32 +00:00
christos 95d57831bc Accomodate OpenSLL-3.x 2023-05-09 02:08:31 +00:00
christos 0f4c02b710 handle OpenSSL-3.x 2023-05-09 00:14:44 +00:00
christos b7e32b3484 handle OpenSSL-3 deprecations 2023-05-08 22:17:36 +00:00
christos baf3398b43 put back ssl.h in libcrypto it is also in libssl 2023-05-08 19:14:28 +00:00
christos 5314239046 make legacy.so work 2023-05-08 14:30:33 +00:00
christos f88177bd0d regen man pages 2023-05-07 20:06:17 +00:00
christos 59d862a1ed misc cleanups 2023-05-07 19:13:15 +00:00
christos d59d657492 merge the rest of the changes, this now builds on x86_64. 2023-05-07 18:41:34 +00:00
christos 8fbed61efd merge conflicts between 1.1.1t and 3.0.8 2023-05-07 18:40:14 +00:00
christos b0d1725196 Import OpenSSL 3.0.8, last import was 1.1.1t
### Major changes between OpenSSL 3.0.7 and OpenSSL 3.0.8 [7 Feb 2023]

  * Fixed NULL dereference during PKCS7 data verification ([CVE-2023-0401])
  * Fixed X.400 address type confusion in X.509 GeneralName ([CVE-2023-0286])
  * Fixed NULL dereference validating DSA public key ([CVE-2023-0217])
  * Fixed Invalid pointer dereference in d2i_PKCS7 functions ([CVE-2023-0216])
  * Fixed Use-after-free following BIO_new_NDEF ([CVE-2023-0215])
  * Fixed Double free after calling PEM_read_bio_ex ([CVE-2022-4450])
  * Fixed Timing Oracle in RSA Decryption ([CVE-2022-4304])
  * Fixed X.509 Name Constraints Read Buffer Overflow ([CVE-2022-4203])
  * Fixed X.509 Policy Constraints Double Locking ([CVE-2022-3996])

### Major changes between OpenSSL 3.0.6 and OpenSSL 3.0.7 [1 Nov 2022]

  * Added RIPEMD160 to the default provider.
  * Fixed regressions introduced in 3.0.6 version.
  * Fixed two buffer overflows in punycode decoding functions.
    ([CVE-2022-3786]) and ([CVE-2022-3602])

### Major changes between OpenSSL 3.0.5 and OpenSSL 3.0.6 [11 Oct 2022]

  * Fix for custom ciphers to prevent accidental use of NULL encryption
    ([CVE-2022-3358])

### Major changes between OpenSSL 3.0.4 and OpenSSL 3.0.5 [5 Jul 2022]

  * Fixed heap memory corruption with RSA private key operation
    ([CVE-2022-2274])
  * Fixed AES OCB failure to encrypt some bytes on 32-bit x86 platforms
    ([CVE-2022-2097])

### Major changes between OpenSSL 3.0.3 and OpenSSL 3.0.4 [21 Jun 2022]

  * Fixed additional bugs in the c_rehash script which was not properly
    sanitising shell metacharacters to prevent command injection
    ([CVE-2022-2068])

### Major changes between OpenSSL 3.0.2 and OpenSSL 3.0.3 [3 May 2022]

  * Fixed a bug in the c_rehash script which was not properly sanitising shell
    metacharacters to prevent command injection ([CVE-2022-1292])
  * Fixed a bug in the function `OCSP_basic_verify` that verifies the signer
    certificate on an OCSP response ([CVE-2022-1343])
  * Fixed a bug where the RC4-MD5 ciphersuite incorrectly used the
    AAD data as the MAC key ([CVE-2022-1434])
  * Fix a bug in the OPENSSL_LH_flush() function that breaks reuse of the memory
    occuppied by the removed hash table entries ([CVE-2022-1473])

### Major changes between OpenSSL 3.0.1 and OpenSSL 3.0.2 [15 Mar 2022]

  * Fixed a bug in the BN_mod_sqrt() function that can cause it to loop forever
    for non-prime moduli ([CVE-2022-0778])

### Major changes between OpenSSL 3.0.0 and OpenSSL 3.0.1 [14 Dec 2021]

  * Fixed invalid handling of X509_verify_cert() internal errors in libssl
    ([CVE-2021-4044])
  * Allow fetching an operation from the provider that owns an unexportable key
    as a fallback if that is still allowed by the property query.

### Major changes between OpenSSL 1.1.1 and OpenSSL 3.0.0 [7 sep 2021]

  * Enhanced 'openssl list' with many new options.
  * Added migration guide to man7.
  * Implemented support for fully "pluggable" TLSv1.3 groups.
  * Added suport for Kernel TLS (KTLS).
  * Changed the license to the Apache License v2.0.
  * Moved all variations of the EVP ciphers CAST5, BF, IDEA, SEED, RC2,
    RC4, RC5, and DES to the legacy provider.
  * Moved the EVP digests MD2, MD4, MDC2, WHIRLPOOL and RIPEMD-160 to the legacy
    provider.
  * Added convenience functions for generating asymmetric key pairs.
  * Deprecated the `OCSP_REQ_CTX` type and functions.
  * Deprecated the `EC_KEY` and `EC_KEY_METHOD` types and functions.
  * Deprecated the `RSA` and `RSA_METHOD` types and functions.
  * Deprecated the `DSA` and `DSA_METHOD` types and functions.
  * Deprecated the `DH` and `DH_METHOD` types and functions.
  * Deprecated the `ERR_load_` functions.
  * Remove the `RAND_DRBG` API.
  * Deprecated the `ENGINE` API.
  * Added `OSSL_LIB_CTX`, a libcrypto library context.
  * Added various `_ex` functions to the OpenSSL API that support using
    a non-default `OSSL_LIB_CTX`.
  * Interactive mode is removed from the 'openssl' program.
  * The X25519, X448, Ed25519, Ed448, SHAKE128 and SHAKE256 algorithms are
    included in the FIPS provider.
  * X509 certificates signed using SHA1 are no longer allowed at security
    level 1 or higher. The default security level for TLS is 1, so
    certificates signed using SHA1 are by default no longer trusted to
    authenticate servers or clients.
  * enable-crypto-mdebug and enable-crypto-mdebug-backtrace were mostly
    disabled; the project uses address sanitize/leak-detect instead.
  * Added a Certificate Management Protocol (CMP, RFC 4210) implementation
    also covering CRMF (RFC 4211) and HTTP transfer (RFC 6712).
    It is part of the crypto lib and adds a 'cmp' app with a demo configuration.
    All widely used CMP features are supported for both clients and servers.
  * Added a proper HTTP client supporting GET with optional redirection, POST,
    arbitrary request and response content types, TLS, persistent connections,
    connections via HTTP(s) proxies, connections and exchange via user-defined
    BIOs (allowing implicit connections), and timeout checks.
  * Added util/check-format.pl for checking adherence to the coding guidelines.
  * Added OSSL_ENCODER, a generic encoder API.
  * Added OSSL_DECODER, a generic decoder API.
  * Added OSSL_PARAM_BLD, an easier to use API to OSSL_PARAM.
  * Added error raising macros, ERR_raise() and ERR_raise_data().
  * Deprecated ERR_put_error(), ERR_get_error_line(), ERR_get_error_line_data(),
    ERR_peek_error_line_data(), ERR_peek_last_error_line_data() and
    ERR_func_error_string().
  * Added OSSL_PROVIDER_available(), to check provider availibility.
  * Added 'openssl mac' that uses the EVP_MAC API.
  * Added 'openssl kdf' that uses the EVP_KDF API.
  * Add OPENSSL_info() and 'openssl info' to get built-in data.
  * Add support for enabling instrumentation through trace and debug
    output.
  * Changed our version number scheme and set the next major release to
    3.0.0
  * Added EVP_MAC, an EVP layer MAC API, and a generic EVP_PKEY to EVP_MAC
    bridge.  Supported MACs are: BLAKE2, CMAC, GMAC, HMAC, KMAC, POLY1305
    and SIPHASH.
  * Removed the heartbeat message in DTLS feature.
  * Added EVP_KDF, an EVP layer KDF and PRF API, and a generic EVP_PKEY to
    EVP_KDF bridge.  Supported KDFs are: HKDF, KBKDF, KRB5 KDF, PBKDF2,
    PKCS12 KDF, SCRYPT, SSH KDF, SSKDF, TLS1 PRF, X9.42 KDF and X9.63 KDF.
  * All of the low-level MD2, MD4, MD5, MDC2, RIPEMD160, SHA1, SHA224,
    SHA256, SHA384, SHA512 and Whirlpool digest functions have been
    deprecated.
  * All of the low-level AES, Blowfish, Camellia, CAST, DES, IDEA, RC2,
    RC4, RC5 and SEED cipher functions have been deprecated.
  * All of the low-level DH, DSA, ECDH, ECDSA and RSA public key functions
    have been deprecated.
  * SSL 3, TLS 1.0, TLS 1.1, and DTLS 1.0 only work at security level 0,
    except when RSA key exchange without SHA1 is used.
  * Added providers, a new pluggability concept that will replace the
    ENGINE API and ENGINE implementations.

OpenSSL 1.1.1
-------------

### Major changes between OpenSSL 1.1.1k and OpenSSL 1.1.1l [24 Aug 2021]

  * Fixed an SM2 Decryption Buffer Overflow ([CVE-2021-3711])
  * Fixed various read buffer overruns processing ASN.1 strings ([CVE-2021-3712])

### Major changes between OpenSSL 1.1.1j and OpenSSL 1.1.1k [25 Mar 2021]

  * Fixed a problem with verifying a certificate chain when using the
    X509_V_FLAG_X509_STRICT flag ([CVE-2021-3450])
  * Fixed an issue where an OpenSSL TLS server may crash if sent a maliciously
    crafted renegotiation ClientHello message from a client ([CVE-2021-3449])

### Major changes between OpenSSL 1.1.1i and OpenSSL 1.1.1j [16 Feb 2021]

  * Fixed a NULL pointer deref in the X509_issuer_and_serial_hash()
    function ([CVE-2021-23841])
  * Fixed the RSA_padding_check_SSLv23() function and the RSA_SSLV23_PADDING
    padding mode to correctly check for rollback attacks
  * Fixed an overflow in the EVP_CipherUpdate, EVP_EncryptUpdate and
    EVP_DecryptUpdate functions ([CVE-2021-23840])
  * Fixed SRP_Calc_client_key so that it runs in constant time

### Major changes between OpenSSL 1.1.1h and OpenSSL 1.1.1i [8 Dec 2020]

  * Fixed NULL pointer deref in GENERAL_NAME_cmp ([CVE-2020-1971])

### Major changes between OpenSSL 1.1.1g and OpenSSL 1.1.1h [22 Sep 2020]

  * Disallow explicit curve parameters in verifications chains when
    X509_V_FLAG_X509_STRICT is used
  * Enable 'MinProtocol' and 'MaxProtocol' to configure both TLS and DTLS
    contexts
  * Oracle Developer Studio will start reporting deprecation warnings

### Major changes between OpenSSL 1.1.1f and OpenSSL 1.1.1g [21 Apr 2020]

  * Fixed segmentation fault in SSL_check_chain() ([CVE-2020-1967])

### Major changes between OpenSSL 1.1.1e and OpenSSL 1.1.1f [31 Mar 2020]

  * Revert the unexpected EOF reporting via SSL_ERROR_SSL

### Major changes between OpenSSL 1.1.1d and OpenSSL 1.1.1e [17 Mar 2020]

  * Fixed an overflow bug in the x64_64 Montgomery squaring procedure
    used in exponentiation with 512-bit moduli ([CVE-2019-1551])

### Major changes between OpenSSL 1.1.1c and OpenSSL 1.1.1d [10 Sep 2019]

  * Fixed a fork protection issue ([CVE-2019-1549])
  * Fixed a padding oracle in PKCS7_dataDecode and CMS_decrypt_set1_pkey
    ([CVE-2019-1563])
  * For built-in EC curves, ensure an EC_GROUP built from the curve name is
    used even when parsing explicit parameters
  * Compute ECC cofactors if not provided during EC_GROUP construction
    ([CVE-2019-1547])
  * Early start up entropy quality from the DEVRANDOM seed source has been
    improved for older Linux systems
  * Correct the extended master secret constant on EBCDIC systems
  * Use Windows installation paths in the mingw builds ([CVE-2019-1552])
  * Changed DH_check to accept parameters with order q and 2q subgroups
  * Significantly reduce secure memory usage by the randomness pools
  * Revert the DEVRANDOM_WAIT feature for Linux systems

### Major changes between OpenSSL 1.1.1b and OpenSSL 1.1.1c [28 May 2019]

  * Prevent over long nonces in ChaCha20-Poly1305 ([CVE-2019-1543])

### Major changes between OpenSSL 1.1.1a and OpenSSL 1.1.1b [26 Feb 2019]

  * Change the info callback signals for the start and end of a post-handshake
    message exchange in TLSv1.3.
  * Fix a bug in DTLS over SCTP. This breaks interoperability with older
    versions of OpenSSL like OpenSSL 1.1.0 and OpenSSL 1.0.2.

### Major changes between OpenSSL 1.1.1 and OpenSSL 1.1.1a [20 Nov 2018]

  * Timing vulnerability in DSA signature generation ([CVE-2018-0734])
  * Timing vulnerability in ECDSA signature generation ([CVE-2018-0735])

### Major changes between OpenSSL 1.1.0i and OpenSSL 1.1.1 [11 Sep 2018]

  * Support for TLSv1.3 added. The TLSv1.3 implementation includes:
    * Fully compliant implementation of RFC8446 (TLSv1.3) on by default
    * Early data (0-RTT)
    * Post-handshake authentication and key update
    * Middlebox Compatibility Mode
    * TLSv1.3 PSKs
    * Support for all five RFC8446 ciphersuites
    * RSA-PSS signature algorithms (backported to TLSv1.2)
    * Configurable session ticket support
    * Stateless server support
    * Rewrite of the packet construction code for "safer" packet handling
    * Rewrite of the extension handling code
    For further important information, see the [TLS1.3 page](
    https://wiki.openssl.org/index.php/TLS1.3) in the OpenSSL Wiki.

  * Complete rewrite of the OpenSSL random number generator to introduce the
    following capabilities
      * The default RAND method now utilizes an AES-CTR DRBG according to
        NIST standard SP 800-90Ar1.
      * Support for multiple DRBG instances with seed chaining.
      * There is a public and private DRBG instance.
      * The DRBG instances are fork-safe.
      * Keep all global DRBG instances on the secure heap if it is enabled.
      * The public and private DRBG instance are per thread for lock free
      operation
  * Support for various new cryptographic algorithms including:
      * SHA3
      * SHA512/224 and SHA512/256
      * EdDSA (both Ed25519 and Ed448) including X509 and TLS support
      * X448 (adding to the existing X25519 support in 1.1.0)
      * Multi-prime RSA
      * SM2
      * SM3
      * SM4
      * SipHash
      * ARIA (including TLS support)
  * Significant Side-Channel attack security improvements
  * Add a new ClientHello callback to provide the ability to adjust the SSL
  object at an early stage.
  * Add 'Maximum Fragment Length' TLS extension negotiation and support
  * A new STORE module, which implements a uniform and URI based reader of
   stores that can contain keys, certificates, CRLs and numerous other
  objects.
  * Move the display of configuration data to configdata.pm.
  * Allow GNU style "make variables" to be used with Configure.
  * Claim the namespaces OSSL and OPENSSL, represented as symbol prefixes
  * Rewrite of devcrypto engine
2023-05-07 18:29:10 +00:00
christos f4748aaa01 more checkpointing 2023-05-07 16:22:10 +00:00
christos 325dc460fc more engines and maps for them 2023-05-07 16:21:19 +00:00
christos 0d03387a80 make this link 2023-05-07 16:19:24 +00:00
christos 5583db7c1e move the generator script here. 2023-05-06 17:21:51 +00:00
christos 782713e6c1 checkpoint 2023-05-06 17:07:22 +00:00
christos f5e845b90d remove files from previous version 2023-04-18 20:10:43 +00:00
christos df9c8da8fe merge conflicts 2023-04-18 14:24:25 +00:00
christos 4724848cf0 import the latest NetBSD OpenSSL to the old directory. 2023-04-18 14:19:03 +00:00
riastradh 285e4be122 openssl: Omit local comment.
May be helpful explanation but it didn't make its way upstream,
whereas the file has moved and had other upstream changes, so let's
make the next merge less painful.

No functional change intended.
2023-03-31 06:05:51 +00:00
riastradh 0871060bc5 openssl: Remove local micro-optimization on AMD (but not Intel).
Upstream OpenSSL changed

	loop 1b

to

	dec %rcx
	jnz 1b

which has mostly the same semantics, in this change:

https://github.com/openssl/openssl/pull/4743

For some reason, in one of the OpenSSL updates, we ended up with a
local change to revert this.

The Intel and AMD optimization guides are silent on the LOOP
instruction, but Agner Fog's tables shows that while LOOP is one
cycle shorter than DEC;JNZ on AMD Zen microarchitectures, it is a
good half dozen cycles longer than DEC;JNZ on recent Intel
microarchitectures.

The history of the OpenSSL change suggests it was intended, and I
can't find any indication other than `merge conflicts' that we
intended to keep the LOOP version.  So let's reduce the local diff by
nixing it.
2023-03-29 13:07:46 +00:00
riastradh 0a26078547 openssl: Omit local indentation diff in mips bignum assembly.
Cute as it is to write the an instruction in a delay slot with an
extra space, it's not really useful to keep this around as a local
change since the substantive change was applied upstream years ago.
2023-03-29 10:29:09 +00:00
riastradh 64606f3c6f openssl: Omit needless sprintf->snprintf under OPENSSL_SYS_WIN32.
Much as I'm happy to eliminate sprintf, there's very little value to
maintaining a local change under an #ifdef that will never, ever be
taken on NetBSD.

Verified libcrypto.so does not sprout any references to sprintf as a
result.
2023-03-29 10:25:11 +00:00
riastradh 86d3010405 openssl: Omit needless #ifdef notyet around __atomic_is_lock_free.
At the time this was done, our gcc version did not have it, but now
it does, so let's reduce the local diff.
2023-03-29 10:21:27 +00:00
riastradh 59e2a3aa76 openssl: Omit needless #include <inttypes.h> in mem_clr.c.
This was needed back when the file was patched locally to cast a
pointer to intptr_t rather than to int, but that code is now gone and
the include is no longer necessary.  So let's reduce the local diff
by omitting this unnecessary change.
2023-03-29 10:19:39 +00:00
riastradh e34dbb0364 openssl: Revert local patch around fileno(stdin/stdout).
According to the commit history, this was introduced when gcc4.5
complained about using the return value of fileno without checking it
against -1.  gcc 10.4 no longer appears to object, so let's just nix
the local patch.
2023-03-29 10:18:50 +00:00
christos baa9d90001 sort; bump minor 2023-02-08 15:51:36 +00:00
christos 50c6b05ed6 add one more file. 2023-02-08 12:26:32 +00:00
christos be43b372e5 merge changes between openssl 1.1.1n and 1.1.1t 2023-02-07 22:25:29 +00:00
christos 6f6db51ea3 Import OpenSSL 1.1.1t
Changes between 1.1.1s and 1.1.1t [7 Feb 2023]

 *) Fixed X.400 address type confusion in X.509 GeneralName.

    There is a type confusion vulnerability relating to X.400 address processing
    inside an X.509 GeneralName. X.400 addresses were parsed as an ASN1_STRING
    but subsequently interpreted by GENERAL_NAME_cmp as an ASN1_TYPE. This
    vulnerability may allow an attacker who can provide a certificate chain and
    CRL (neither of which need have a valid signature) to pass arbitrary
    pointers to a memcmp call, creating a possible read primitive, subject to
    some constraints. Refer to the advisory for more information. Thanks to
    David Benjamin for discovering this issue. (CVE-2023-0286)

    This issue has been fixed by changing the public header file definition of
    GENERAL_NAME so that x400Address reflects the implementation. It was not
    possible for any existing application to successfully use the existing
    definition; however, if any application references the x400Address field
    (e.g. in dead code), note that the type of this field has changed. There is
    no ABI change.
    [Hugo Landau]

 *) Fixed Use-after-free following BIO_new_NDEF.

    The public API function BIO_new_NDEF is a helper function used for
    streaming ASN.1 data via a BIO. It is primarily used internally to OpenSSL
    to support the SMIME, CMS and PKCS7 streaming capabilities, but may also
    be called directly by end user applications.

    The function receives a BIO from the caller, prepends a new BIO_f_asn1
    filter BIO onto the front of it to form a BIO chain, and then returns
    the new head of the BIO chain to the caller. Under certain conditions,
    for example if a CMS recipient public key is invalid, the new filter BIO
    is freed and the function returns a NULL result indicating a failure.
    However, in this case, the BIO chain is not properly cleaned up and the
    BIO passed by the caller still retains internal pointers to the previously
    freed filter BIO. If the caller then goes on to call BIO_pop() on the BIO
    then a use-after-free will occur. This will most likely result in a crash.
    (CVE-2023-0215)
    [Viktor Dukhovni, Matt Caswell]

 *) Fixed Double free after calling PEM_read_bio_ex.

    The function PEM_read_bio_ex() reads a PEM file from a BIO and parses and
    decodes the "name" (e.g. "CERTIFICATE"), any header data and the payload
    data. If the function succeeds then the "name_out", "header" and "data"
    arguments are populated with pointers to buffers containing the relevant
    decoded data. The caller is responsible for freeing those buffers. It is
    possible to construct a PEM file that results in 0 bytes of payload data.
    In this case PEM_read_bio_ex() will return a failure code but will populate
    the header argument with a pointer to a buffer that has already been freed.
    If the caller also frees this buffer then a double free will occur. This
    will most likely lead to a crash.

    The functions PEM_read_bio() and PEM_read() are simple wrappers around
    PEM_read_bio_ex() and therefore these functions are also directly affected.

    These functions are also called indirectly by a number of other OpenSSL
    functions including PEM_X509_INFO_read_bio_ex() and
    SSL_CTX_use_serverinfo_file() which are also vulnerable. Some OpenSSL
    internal uses of these functions are not vulnerable because the caller does
    not free the header argument if PEM_read_bio_ex() returns a failure code.
    (CVE-2022-4450)
    [Kurt Roeckx, Matt Caswell]

 *) Fixed Timing Oracle in RSA Decryption.

    A timing based side channel exists in the OpenSSL RSA Decryption
    implementation which could be sufficient to recover a plaintext across
    a network in a Bleichenbacher style attack. To achieve a successful
    decryption an attacker would have to be able to send a very large number
    of trial messages for decryption. The vulnerability affects all RSA padding
    modes: PKCS#1 v1.5, RSA-OEAP and RSASVE.
    (CVE-2022-4304)
    [Dmitry Belyavsky, Hubert Kario]

Changes between 1.1.1r and 1.1.1s [1 Nov 2022]

 *) Fixed a regression introduced in 1.1.1r version not refreshing the
    certificate data to be signed before signing the certificate.
    [Gibeom Gwon]

Changes between 1.1.1q and 1.1.1r [11 Oct 2022]

 *) Fixed the linux-mips64 Configure target which was missing the
    SIXTY_FOUR_BIT bn_ops flag. This was causing heap corruption on that
    platform.
    [Adam Joseph]

 *) Fixed a strict aliasing problem in bn_nist. Clang-14 optimisation was
    causing incorrect results in some cases as a result.
    [Paul Dale]

 *) Fixed SSL_pending() and SSL_has_pending() with DTLS which were failing to
    report correct results in some cases
    [Matt Caswell]

 *) Fixed a regression introduced in 1.1.1o for re-signing certificates with
    different key sizes
    [Todd Short]

 *) Added the loongarch64 target
    [Shi Pujin]

 *) Fixed a DRBG seed propagation thread safety issue
    [Bernd Edlinger]

 *) Fixed a memory leak in tls13_generate_secret
    [Bernd Edlinger]

 *) Fixed reported performance degradation on aarch64. Restored the
    implementation prior to commit 2621751 ("aes/asm/aesv8-armx.pl: avoid
    32-bit lane assignment in CTR mode") for 64bit targets only, since it is
    reportedly 2-17% slower and the silicon errata only affects 32bit targets.
    The new algorithm is still used for 32 bit targets.
    [Bernd Edlinger]

 *) Added a missing header for memcmp that caused compilation failure on some
    platforms
    [Gregor Jasny]

Changes between 1.1.1p and 1.1.1q [5 Jul 2022]

 *) AES OCB mode for 32-bit x86 platforms using the AES-NI assembly optimised
    implementation would not encrypt the entirety of the data under some
    circumstances.  This could reveal sixteen bytes of data that was
    preexisting in the memory that wasn't written.  In the special case of
    "in place" encryption, sixteen bytes of the plaintext would be revealed.

    Since OpenSSL does not support OCB based cipher suites for TLS and DTLS,
    they are both unaffected.
    (CVE-2022-2097)
    [Alex Chernyakhovsky, David Benjamin, Alejandro Sedeño]

Changes between 1.1.1o and 1.1.1p [21 Jun 2022]

 *) In addition to the c_rehash shell command injection identified in
    CVE-2022-1292, further bugs where the c_rehash script does not
    properly sanitise shell metacharacters to prevent command injection have
    been fixed.

    When the CVE-2022-1292 was fixed it was not discovered that there
    are other places in the script where the file names of certificates
    being hashed were possibly passed to a command executed through the shell.

    This script is distributed by some operating systems in a manner where
    it is automatically executed.  On such operating systems, an attacker
    could execute arbitrary commands with the privileges of the script.

    Use of the c_rehash script is considered obsolete and should be replaced
    by the OpenSSL rehash command line tool.
    (CVE-2022-2068)
    [Daniel Fiala, Tomáš Mráz]

 *) When OpenSSL TLS client is connecting without any supported elliptic
    curves and TLS-1.3 protocol is disabled the connection will no longer fail
    if a ciphersuite that does not use a key exchange based on elliptic
    curves can be negotiated.
    [Tomáš Mráz]

Changes between 1.1.1n and 1.1.1o [3 May 2022]

 *) Fixed a bug in the c_rehash script which was not properly sanitising shell
    metacharacters to prevent command injection.  This script is distributed
    by some operating systems in a manner where it is automatically executed.
    On such operating systems, an attacker could execute arbitrary commands
    with the privileges of the script.

    Use of the c_rehash script is considered obsolete and should be replaced
    by the OpenSSL rehash command line tool.
    (CVE-2022-1292)
    [Tomáš Mráz]
2023-02-07 22:17:59 +00:00
christos c6a6dc283a Correct lost change in the merge (Anthony Mallet) 2022-12-01 22:57:37 +00:00