...
 
Commits (6)
    https://gitcode.net/openharmony/third_party_openssl/-/commit/70de68c4e4affcfb4ee2aed9157cda417522bfd1 Do not ignore empty associated data with AES-SIV mode 2023-07-18T09:31:36+08:00 Tomas Mraz tomas@openssl.org The AES-SIV mode allows for multiple associated data items authenticated separately with any of these being 0 length. The provided implementation ignores such empty associated data which is incorrect in regards to the RFC 5297 and is also a security issue because such empty associated data then become unauthenticated if an application expects to authenticate them. Fixes CVE-2023-2975 Reviewed-by: <span data-trailer="Reviewed-by:"><a href="mailto:matt@openssl.org" title="matt@openssl.org"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg3" style="text-decoration: none">N</a><a href="mailto:matt@openssl.org" title="matt@openssl.org">Matt Caswell</a> &lt;<a href="mailto:matt@openssl.org" title="matt@openssl.org">matt@openssl.org</a>&gt;</span> Reviewed-by: <span data-trailer="Reviewed-by:"><a href="mailto:pauli@openssl.org" title="pauli@openssl.org"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg3" style="text-decoration: none">N</a><a href="mailto:pauli@openssl.org" title="pauli@openssl.org">Paul Dale</a> &lt;<a href="mailto:pauli@openssl.org" title="pauli@openssl.org">pauli@openssl.org</a>&gt;</span> (Merged from <a href="https://github.com/openssl/openssl/pull/21384" rel="nofollow noreferrer noopener" target="_blank">https://github.com/openssl/openssl/pull/21384</a>) (cherry picked from commit c426c281cfc23ab182f7d7d7a35229e7db1494d9) Signed-off-by: <span data-trailer="Signed-off-by:"><a href="mailto:fengziteng2@huawei.com" title="fengziteng2@huawei.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg6" style="text-decoration: none">N</a><a href="mailto:fengziteng2@huawei.com" title="fengziteng2@huawei.com">code4lala</a> &lt;<a href="mailto:fengziteng2@huawei.com" title="fengziteng2@huawei.com">fengziteng2@huawei.com</a>&gt;</span> https://gitcode.net/openharmony/third_party_openssl/-/commit/87518c9f4f3be85725bca69ba097567ff99ac55d Add CHANGES.md and NEWS.md entries for CVE-2023-2975 2023-07-18T09:40:22+08:00 Tomas Mraz tomas@openssl.org Reviewed-by: <span data-trailer="Reviewed-by:"><a href="mailto:matt@openssl.org" title="matt@openssl.org"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg3" style="text-decoration: none">N</a><a href="mailto:matt@openssl.org" title="matt@openssl.org">Matt Caswell</a> &lt;<a href="mailto:matt@openssl.org" title="matt@openssl.org">matt@openssl.org</a>&gt;</span> Reviewed-by: <span data-trailer="Reviewed-by:"><a href="mailto:pauli@openssl.org" title="pauli@openssl.org"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg2" style="text-decoration: none">N</a><a href="mailto:pauli@openssl.org" title="pauli@openssl.org">Paul Dale</a> &lt;<a href="mailto:pauli@openssl.org" title="pauli@openssl.org">pauli@openssl.org</a>&gt;</span> (Merged from <a href="https://github.com/openssl/openssl/pull/21384" rel="nofollow noreferrer noopener" target="_blank">https://github.com/openssl/openssl/pull/21384</a>) (cherry picked from commit 1e398bec538978b9957e69bf9e12b3c626290bea) Signed-off-by: <span data-trailer="Signed-off-by:"><a href="mailto:fengziteng2@huawei.com" title="fengziteng2@huawei.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg1" style="text-decoration: none">N</a><a href="mailto:fengziteng2@huawei.com" title="fengziteng2@huawei.com">code4lala</a> &lt;<a href="mailto:fengziteng2@huawei.com" title="fengziteng2@huawei.com">fengziteng2@huawei.com</a>&gt;</span> https://gitcode.net/openharmony/third_party_openssl/-/commit/566ce903b69cd2ec717e4bf77e7e0b5529c1d021 !124 Fixes CVE-2023-2975 2023-07-18T12:41:05+00:00 openharmony_ci 120357966@qq.com Merge pull request !124 from code4lala/Fixes_CVE-2023-2975 https://gitcode.net/openharmony/third_party_openssl/-/commit/9a81b024114726454bb19860cc1f099e7e50fdfa Fix DH_check() excessive time with over sized modulus 2023-07-20T15:48:47+08:00 Matt Caswell matt@openssl.org The DH_check() function checks numerous aspects of the key or parameters that have been supplied. Some of those checks use the supplied modulus value even if it is excessively large. There is already a maximum DH modulus size (10,000 bits) over which OpenSSL will not generate or derive keys. DH_check() will however still perform various tests for validity on such a large modulus. We introduce a new maximum (32,768) over which DH_check() will just fail. An application that calls DH_check() and supplies a key or parameters obtained from an untrusted source could be vulnerable to a Denial of Service attack. The function DH_check() is itself called by a number of other OpenSSL functions. An application calling any of those other functions may similarly be affected. The other functions affected by this are DH_check_ex() and EVP_PKEY_param_check(). CVE-2023-3446 Reviewed-by: <span data-trailer="Reviewed-by:"><a href="mailto:pauli@openssl.org" title="pauli@openssl.org"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg4" style="text-decoration: none">N</a><a href="mailto:pauli@openssl.org" title="pauli@openssl.org">Paul Dale</a> &lt;<a href="mailto:pauli@openssl.org" title="pauli@openssl.org">pauli@openssl.org</a>&gt;</span> Reviewed-by: <span data-trailer="Reviewed-by:"><a href="mailto:tom.cosgrove@arm.com" title="tom.cosgrove@arm.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg5" style="text-decoration: none">N</a><a href="mailto:tom.cosgrove@arm.com" title="tom.cosgrove@arm.com">Tom Cosgrove</a> &lt;<a href="mailto:tom.cosgrove@arm.com" title="tom.cosgrove@arm.com">tom.cosgrove@arm.com</a>&gt;</span> Reviewed-by: <span data-trailer="Reviewed-by:"><a href="mailto:bernd.edlinger@hotmail.de" title="bernd.edlinger@hotmail.de"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg5" style="text-decoration: none">N</a><a href="mailto:bernd.edlinger@hotmail.de" title="bernd.edlinger@hotmail.de">Bernd Edlinger</a> &lt;<a href="mailto:bernd.edlinger@hotmail.de" title="bernd.edlinger@hotmail.de">bernd.edlinger@hotmail.de</a>&gt;</span> Reviewed-by: <span data-trailer="Reviewed-by:"><a href="mailto:tomas@openssl.org" title="tomas@openssl.org"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg2" style="text-decoration: none">N</a><a href="mailto:tomas@openssl.org" title="tomas@openssl.org">Tomas Mraz</a> &lt;<a href="mailto:tomas@openssl.org" title="tomas@openssl.org">tomas@openssl.org</a>&gt;</span> (Merged from <a href="https://github.com/openssl/openssl/pull/21451" rel="nofollow noreferrer noopener" target="_blank">https://github.com/openssl/openssl/pull/21451</a>) (cherry picked from commit 9e0094e2aa1b3428a12d5095132f133c078d3c3d) Signed-off-by: <span data-trailer="Signed-off-by:"><a href="mailto:fengziteng2@huawei.com" title="fengziteng2@huawei.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg5" style="text-decoration: none">N</a><a href="mailto:fengziteng2@huawei.com" title="fengziteng2@huawei.com">code4lala</a> &lt;<a href="mailto:fengziteng2@huawei.com" title="fengziteng2@huawei.com">fengziteng2@huawei.com</a>&gt;</span> https://gitcode.net/openharmony/third_party_openssl/-/commit/64928fc2c0a2a42e3ef5d6f1029a290180ed9025 Update CHANGES/NEWS for CVE-2023-3446 2023-07-20T15:52:20+08:00 Matt Caswell matt@openssl.org Reviewed-by: <span data-trailer="Reviewed-by:"><a href="mailto:pauli@openssl.org" title="pauli@openssl.org"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg6" style="text-decoration: none">N</a><a href="mailto:pauli@openssl.org" title="pauli@openssl.org">Paul Dale</a> &lt;<a href="mailto:pauli@openssl.org" title="pauli@openssl.org">pauli@openssl.org</a>&gt;</span> Reviewed-by: <span data-trailer="Reviewed-by:"><a href="mailto:tom.cosgrove@arm.com" title="tom.cosgrove@arm.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg2" style="text-decoration: none">N</a><a href="mailto:tom.cosgrove@arm.com" title="tom.cosgrove@arm.com">Tom Cosgrove</a> &lt;<a href="mailto:tom.cosgrove@arm.com" title="tom.cosgrove@arm.com">tom.cosgrove@arm.com</a>&gt;</span> Reviewed-by: <span data-trailer="Reviewed-by:"><a href="mailto:bernd.edlinger@hotmail.de" title="bernd.edlinger@hotmail.de"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg4" style="text-decoration: none">N</a><a href="mailto:bernd.edlinger@hotmail.de" title="bernd.edlinger@hotmail.de">Bernd Edlinger</a> &lt;<a href="mailto:bernd.edlinger@hotmail.de" title="bernd.edlinger@hotmail.de">bernd.edlinger@hotmail.de</a>&gt;</span> Reviewed-by: <span data-trailer="Reviewed-by:"><a href="mailto:tomas@openssl.org" title="tomas@openssl.org"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg1" style="text-decoration: none">N</a><a href="mailto:tomas@openssl.org" title="tomas@openssl.org">Tomas Mraz</a> &lt;<a href="mailto:tomas@openssl.org" title="tomas@openssl.org">tomas@openssl.org</a>&gt;</span> (Merged from <a href="https://github.com/openssl/openssl/pull/21451" rel="nofollow noreferrer noopener" target="_blank">https://github.com/openssl/openssl/pull/21451</a>) (cherry picked from commit 4ec53ad6e1791daafbe26bdbd539f2ba9172959a) Signed-off-by: <span data-trailer="Signed-off-by:"><a href="mailto:fengziteng2@huawei.com" title="fengziteng2@huawei.com"></a><a href="javascript:void(0)" class="avatar s16 avatar-inline identicon bg2" style="text-decoration: none">N</a><a href="mailto:fengziteng2@huawei.com" title="fengziteng2@huawei.com">code4lala</a> &lt;<a href="mailto:fengziteng2@huawei.com" title="fengziteng2@huawei.com">fengziteng2@huawei.com</a>&gt;</span> https://gitcode.net/openharmony/third_party_openssl/-/commit/2a14625b9e4189aca6b75ddc740b6d31a738820c !125 CVE-2023-3446 2023-07-26T02:44:12+00:00 openharmony_ci 120357966@qq.com Merge pull request !125 from code4lala/CVE-2023-3446
......@@ -28,6 +28,45 @@ breaking changes, and mappings for the large list of deprecated functions.
[Migration guide]: https://github.com/openssl/openssl/tree/master/doc/man7/migration_guide.pod
* Fix DH_check() excessive time with over sized modulus
The function DH_check() performs various checks on DH parameters. One of
those checks confirms that the modulus ("p" parameter) is not too large.
Trying to use a very large modulus is slow and OpenSSL will not normally use
a modulus which is over 10,000 bits in length.
However the DH_check() function checks numerous aspects of the key or
parameters that have been supplied. Some of those checks use the supplied
modulus value even if it has already been found to be too large.
A new limit has been added to DH_check of 32,768 bits. Supplying a
key/parameters with a modulus over this size will simply cause DH_check() to
fail.
([CVE-2023-3446])
*Matt Caswell*
* Do not ignore empty associated data entries with AES-SIV.
The AES-SIV algorithm allows for authentication of multiple associated
data entries along with the encryption. To authenticate empty data the
application has to call `EVP_EncryptUpdate()` (or `EVP_CipherUpdate()`)
with NULL pointer as the output buffer and 0 as the input buffer length.
The AES-SIV implementation in OpenSSL just returns success for such call
instead of performing the associated data authentication operation.
The empty data thus will not be authenticated. ([CVE-2023-2975])
Thanks to Juerg Wullschleger (Google) for discovering the issue.
The fix changes the authentication tag value and the ciphertext for
applications that use empty associated data entries with AES-SIV.
To decrypt data encrypted with previous versions of OpenSSL the application
has to skip calls to `EVP_DecryptUpdate()` for empty associated data
entries.
*Tomas Mraz*
* Mitigate for the time it takes for `OBJ_obj2txt` to translate gigantic
OBJECT IDENTIFIER sub-identifiers to canonical numeric text form.
......@@ -19475,6 +19514,8 @@ ndif
<!-- Links -->
[CVE-2023-3446]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-3446
[CVE-2023-2975]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-2975
[CVE-2023-2650]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-2650
[CVE-2023-0466]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0466
[CVE-2023-1255]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-1255
......
......@@ -17,6 +17,8 @@ OpenSSL Releases
OpenSSL 3.0
-----------
* Fix DH_check() excessive time with over sized modulus ([CVE-2023-3446])
* Do not ignore empty associated data entries with AES-SIV ([CVE-2023-2975])
* Mitigate for very slow `OBJ_obj2txt()` performance with gigantic OBJECT
IDENTIFIER sub-identities. ([CVE-2023-2650])
* Fixed documentation of X509_VERIFY_PARAM_add0_policy() ([CVE-2023-0466])
......@@ -1424,6 +1426,8 @@ OpenSSL 0.9.x
<!-- Links -->
[CVE-2023-3446]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-3446
[CVE-2023-2975]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-2975
[CVE-2023-2650]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-2650
[CVE-2023-0466]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-0466
[CVE-2023-1255]: https://www.openssl.org/news/vulnerabilities.html#CVE-2023-1255
......
......@@ -152,6 +152,12 @@ int DH_check(const DH *dh, int *ret)
if (nid != NID_undef)
return 1;
/* Don't do any checks at all with an excessively large modulus */
if (BN_num_bits(dh->params.p) > OPENSSL_DH_CHECK_MAX_MODULUS_BITS) {
ERR_raise(ERR_LIB_DH, DH_R_MODULUS_TOO_LARGE);
return 0;
}
if (!DH_check_params(dh, ret))
return 0;
......
......@@ -89,7 +89,11 @@ int EVP_PKEY_CTX_get0_dh_kdf_ukm(EVP_PKEY_CTX *ctx, unsigned char **ukm);
# include <openssl/dherr.h>
# ifndef OPENSSL_DH_MAX_MODULUS_BITS
# define OPENSSL_DH_MAX_MODULUS_BITS 10000
# define OPENSSL_DH_MAX_MODULUS_BITS 10000
# endif
# ifndef OPENSSL_DH_CHECK_MAX_MODULUS_BITS
# define OPENSSL_DH_CHECK_MAX_MODULUS_BITS 32768
# endif
# define OPENSSL_DH_FIPS_MIN_MODULUS_BITS 1024
......
......@@ -120,14 +120,18 @@ static int siv_cipher(void *vctx, unsigned char *out, size_t *outl,
if (!ossl_prov_is_running())
return 0;
if (inl == 0) {
*outl = 0;
return 1;
}
/* Ignore just empty encryption/decryption call and not AAD. */
if (out != NULL) {
if (inl == 0) {
if (outl != NULL)
*outl = 0;
return 1;
}
if (outsize < inl) {
ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
return 0;
if (outsize < inl) {
ERR_raise(ERR_LIB_PROV, PROV_R_OUTPUT_BUFFER_TOO_SMALL);
return 0;
}
}
if (ctx->hw->cipher(ctx, out, in, inl) <= 0)
......