From 4d12ea4971e46faced747f809b393d1545a0ebf2 Mon Sep 17 00:00:00 2001 From: hzero1996 Date: Fri, 24 Feb 2023 14:24:29 +0800 Subject: [PATCH] backport some patches --- ...S-support-to-the-large-app-data-test.patch | 76 ++++++++ backport-Add-a-test-for-large-app-data.patch | 166 ++++++++++++++++++ ...r-allocation-allows-for-the-Explicit.patch | 41 +++++ ..._asn1-to-properly-report-some-errors.patch | 41 +++++ backport-Fix-BIO_f_cipher-flushing.patch | 54 ++++++ ...rlf_copy-to-properly-report-an-error.patch | 45 +++++ ...Fix-a-memory-leak-in-rsa_priv_encode.patch | 31 ++++ ...on-how-much-encryption-growth-we-can.patch | 71 ++++++++ openssl.spec | 13 +- 9 files changed, 537 insertions(+), 1 deletion(-) create mode 100644 backport-Add-DTLS-support-to-the-large-app-data-test.patch create mode 100644 backport-Add-a-test-for-large-app-data.patch create mode 100644 backport-Ensure-our-buffer-allocation-allows-for-the-Explicit.patch create mode 100644 backport-Fix-BIO_f_asn1-to-properly-report-some-errors.patch create mode 100644 backport-Fix-BIO_f_cipher-flushing.patch create mode 100644 backport-Fix-SMIME_crlf_copy-to-properly-report-an-error.patch create mode 100644 backport-Fix-a-memory-leak-in-rsa_priv_encode.patch create mode 100644 backport-Fix-the-ceiling-on-how-much-encryption-growth-we-can.patch diff --git a/backport-Add-DTLS-support-to-the-large-app-data-test.patch b/backport-Add-DTLS-support-to-the-large-app-data-test.patch new file mode 100644 index 0000000..9abf862 --- /dev/null +++ b/backport-Add-DTLS-support-to-the-large-app-data-test.patch @@ -0,0 +1,76 @@ +From adc3cfe452daa0fe51b8059929b2dafdc42737e4 Mon Sep 17 00:00:00 2001 +From: Matt Caswell +Date: Fri, 20 Jan 2023 14:08:42 +0000 +Subject: [PATCH] Add DTLS support to the large app data test + +Reviewed-by: Paul Dale +Reviewed-by: Tomas Mraz +Reviewed-by: Hugo Landau +(Merged from https://github.com/openssl/openssl/pull/20087) +--- + test/sslapitest.c | 28 +++++++++++++++++++++++++--- + 1 file changed, 25 insertions(+), 3 deletions(-) + +diff --git a/test/sslapitest.c b/test/sslapitest.c +index 10bbb1eb92..9864daabf1 100644 +--- a/test/sslapitest.c ++++ b/test/sslapitest.c +@@ -809,6 +809,8 @@ static int test_large_app_data(int tst) + int testresult = 0, prot; + unsigned char *msg, *buf = NULL; + size_t written, readbytes; ++ const SSL_METHOD *smeth = TLS_server_method(); ++ const SSL_METHOD *cmeth = TLS_client_method(); + + switch (tst >> 2) { + case 0: +@@ -851,6 +853,26 @@ static int test_large_app_data(int tst) + return 1; + #endif + ++ case 5: ++#ifndef OPENSSL_NO_DTLS1_2 ++ prot = DTLS1_2_VERSION; ++ smeth = DTLS_server_method(); ++ cmeth = DTLS_client_method(); ++ break; ++#else ++ return 1; ++#endif ++ ++ case 6: ++#ifndef OPENSSL_NO_DTLS1 ++ prot = DTLS1_VERSION; ++ smeth = DTLS_server_method(); ++ cmeth = DTLS_client_method(); ++ break; ++#else ++ return 1; ++#endif ++ + default: + /* Shouldn't happen */ + return 0; +@@ -867,8 +889,8 @@ static int test_large_app_data(int tst) + /* Set whole buffer to all bits set */ + memset(buf, 0xff, SSL3_RT_MAX_PLAIN_LENGTH + 1); + +- if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(), +- prot, prot, &sctx, &cctx, cert, privkey))) ++ if (!TEST_true(create_ssl_ctx_pair(smeth, cmeth, prot, prot, &sctx, &cctx, ++ cert, privkey))) + goto end; + + if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, +@@ -7304,7 +7326,7 @@ int setup_tests(void) + #ifndef OPENSSL_NO_DTLS + ADD_TEST(test_large_message_dtls); + #endif +- ADD_ALL_TESTS(test_large_app_data, 20); ++ ADD_ALL_TESTS(test_large_app_data, 28); + #ifndef OPENSSL_NO_OCSP + ADD_TEST(test_tlsext_status_type); + #endif +-- +2.36.1 + diff --git a/backport-Add-a-test-for-large-app-data.patch b/backport-Add-a-test-for-large-app-data.patch new file mode 100644 index 0000000..febf1e5 --- /dev/null +++ b/backport-Add-a-test-for-large-app-data.patch @@ -0,0 +1,166 @@ +From b958ecf27c5cdbcfab6e27777aca8a9fcd82e7af Mon Sep 17 00:00:00 2001 +From: Matt Caswell +Date: Thu, 19 Jan 2023 10:52:45 +0000 +Subject: [PATCH] Add a test for large app data + +Test that sending large app data records works correctly. + +Reviewed-by: Paul Dale +Reviewed-by: Tomas Mraz +Reviewed-by: Hugo Landau +(Merged from https://github.com/openssl/openssl/pull/20087) +--- + test/sslapitest.c | 130 ++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 130 insertions(+) + +diff --git a/test/sslapitest.c b/test/sslapitest.c +index 685c28d934..10bbb1eb92 100644 +--- a/test/sslapitest.c ++++ b/test/sslapitest.c +@@ -794,6 +794,135 @@ static int test_large_message_dtls(void) + } + #endif + ++/* ++ * Test we can successfully send the maximum amount of application data. We ++ * test each protocol version individually, each with and without EtM enabled. ++ * TLSv1.3 doesn't use EtM so technically it is redundant to test both but it is ++ * simpler this way. We also test all combinations with and without the ++ * SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS option which affects the size of the ++ * underlying buffer. ++ */ ++static int test_large_app_data(int tst) ++{ ++ SSL_CTX *cctx = NULL, *sctx = NULL; ++ SSL *clientssl = NULL, *serverssl = NULL; ++ int testresult = 0, prot; ++ unsigned char *msg, *buf = NULL; ++ size_t written, readbytes; ++ ++ switch (tst >> 2) { ++ case 0: ++#ifndef OPENSSL_NO_TLS1_3 ++ prot = TLS1_3_VERSION; ++ break; ++#else ++ return 1; ++#endif ++ ++ case 1: ++#ifndef OPENSSL_NO_TLS1_2 ++ prot = TLS1_2_VERSION; ++ break; ++#else ++ return 1; ++#endif ++ ++ case 2: ++#ifndef OPENSSL_NO_TLS1_1 ++ prot = TLS1_1_VERSION; ++ break; ++#else ++ return 1; ++#endif ++ ++ case 3: ++#ifndef OPENSSL_NO_TLS1 ++ prot = TLS1_VERSION; ++ break; ++#else ++ return 1; ++#endif ++ ++ case 4: ++#ifndef OPENSSL_NO_SSL3 ++ prot = SSL3_VERSION; ++ break; ++#else ++ return 1; ++#endif ++ ++ default: ++ /* Shouldn't happen */ ++ return 0; ++ } ++ ++ /* Maximal sized message of zeros */ ++ msg = OPENSSL_zalloc(SSL3_RT_MAX_PLAIN_LENGTH); ++ if (!TEST_ptr(msg)) ++ goto end; ++ ++ buf = OPENSSL_malloc(SSL3_RT_MAX_PLAIN_LENGTH + 1); ++ if (!TEST_ptr(buf)) ++ goto end; ++ /* Set whole buffer to all bits set */ ++ memset(buf, 0xff, SSL3_RT_MAX_PLAIN_LENGTH + 1); ++ ++ if (!TEST_true(create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(), ++ prot, prot, &sctx, &cctx, cert, privkey))) ++ goto end; ++ ++ if (!TEST_true(create_ssl_objects(sctx, cctx, &serverssl, ++ &clientssl, NULL, NULL))) ++ goto end; ++ ++ if ((tst & 1) != 0) { ++ /* Setting this option gives us a minimally sized underlying buffer */ ++ if (!TEST_true(SSL_set_options(serverssl, ++ SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS)) ++ || !TEST_true(SSL_set_options(clientssl, ++ SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS))) ++ goto end; ++ } ++ ++ if ((tst & 2) != 0) { ++ /* ++ * Setting this option means the MAC is added before encryption ++ * giving us a larger record for the encryption process ++ */ ++ if (!TEST_true(SSL_set_options(serverssl, SSL_OP_NO_ENCRYPT_THEN_MAC)) ++ || !TEST_true(SSL_set_options(clientssl, ++ SSL_OP_NO_ENCRYPT_THEN_MAC))) ++ goto end; ++ } ++ ++ if (!TEST_true(create_ssl_connection(serverssl, clientssl, SSL_ERROR_NONE))) ++ goto end; ++ ++ if (!TEST_true(SSL_write_ex(clientssl, msg, SSL3_RT_MAX_PLAIN_LENGTH, ++ &written)) ++ || !TEST_size_t_eq(written, SSL3_RT_MAX_PLAIN_LENGTH)) ++ goto end; ++ ++ /* We provide a buffer slightly larger than what we are actually expecting */ ++ if (!TEST_true(SSL_read_ex(serverssl, buf, SSL3_RT_MAX_PLAIN_LENGTH + 1, ++ &readbytes))) ++ goto end; ++ ++ if (!TEST_mem_eq(msg, written, buf, readbytes)) ++ goto end; ++ ++ testresult = 1; ++end: ++ OPENSSL_free(msg); ++ OPENSSL_free(buf); ++ SSL_free(serverssl); ++ SSL_free(clientssl); ++ SSL_CTX_free(sctx); ++ SSL_CTX_free(cctx); ++ return testresult; ++} ++ ++ + #ifndef OPENSSL_NO_OCSP + static int ocsp_server_cb(SSL *s, void *arg) + { +@@ -7175,6 +7304,7 @@ int setup_tests(void) + #ifndef OPENSSL_NO_DTLS + ADD_TEST(test_large_message_dtls); + #endif ++ ADD_ALL_TESTS(test_large_app_data, 20); + #ifndef OPENSSL_NO_OCSP + ADD_TEST(test_tlsext_status_type); + #endif +-- +2.36.1 + diff --git a/backport-Ensure-our-buffer-allocation-allows-for-the-Explicit.patch b/backport-Ensure-our-buffer-allocation-allows-for-the-Explicit.patch new file mode 100644 index 0000000..69c5c17 --- /dev/null +++ b/backport-Ensure-our-buffer-allocation-allows-for-the-Explicit.patch @@ -0,0 +1,41 @@ +From 4b5ec7c560717ac90b4b05b123e6fe8ab9e20b41 Mon Sep 17 00:00:00 2001 +From: Matt Caswell +Date: Thu, 19 Jan 2023 11:59:44 +0000 +Subject: [PATCH] Ensure our buffer allocation allows for the Explicit IV + +Some ciphers/protocol versions have an explicit IV. We need to make sure we +have sufficient room for it in the underlying buffer. + +Reviewed-by: Paul Dale +Reviewed-by: Tomas Mraz +Reviewed-by: Hugo Landau +(Merged from https://github.com/openssl/openssl/pull/20087) +--- + ssl/record/ssl3_buffer.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/ssl/record/ssl3_buffer.c b/ssl/record/ssl3_buffer.c +index b9ba25e0c3..5f40046f57 100644 +--- a/ssl/record/ssl3_buffer.c ++++ b/ssl/record/ssl3_buffer.c +@@ -97,11 +97,16 @@ int ssl3_setup_write_buffer(SSL *s, size_t numwpipes, size_t len) + #endif + + len = ssl_get_max_send_fragment(s) +- + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD + headerlen + align; ++ + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD + headerlen + align ++ + SSL_RT_MAX_CIPHER_BLOCK_SIZE /* Explicit IV allowance */; + #ifndef OPENSSL_NO_COMP + if (ssl_allow_compression(s)) + len += SSL3_RT_MAX_COMPRESSED_OVERHEAD; + #endif ++ /* ++ * We don't need to add an allowance for eivlen here since empty ++ * fragments only occur when we don't have an explicit IV ++ */ + if (!(s->options & SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS)) + len += headerlen + align + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD; + } +-- +2.36.1 + diff --git a/backport-Fix-BIO_f_asn1-to-properly-report-some-errors.patch b/backport-Fix-BIO_f_asn1-to-properly-report-some-errors.patch new file mode 100644 index 0000000..e0be7d9 --- /dev/null +++ b/backport-Fix-BIO_f_asn1-to-properly-report-some-errors.patch @@ -0,0 +1,41 @@ +From e913b911e04a6b276deb7d7553694ae2c1a563cc Mon Sep 17 00:00:00 2001 +From: Matt Caswell +Date: Tue, 6 Dec 2022 14:35:53 +0000 +Subject: [PATCH] Fix BIO_f_asn1() to properly report some errors + +Some things that may go wrong in asn1_bio_write() are serious errors +that should be reported as -1, rather than 0 (which just means "we wrote +no data"). + +Reviewed-by: Hugo Landau +Reviewed-by: Tomas Mraz +(Merged from https://github.com/openssl/openssl/pull/19920) +--- + crypto/asn1/bio_asn1.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/crypto/asn1/bio_asn1.c b/crypto/asn1/bio_asn1.c +index 914d77c866..17b0d1aa6c 100644 +--- a/crypto/asn1/bio_asn1.c ++++ b/crypto/asn1/bio_asn1.c +@@ -172,7 +172,7 @@ static int asn1_bio_write(BIO *b, const char *in, int inl) + case ASN1_STATE_START: + if (!asn1_bio_setup_ex(b, ctx, ctx->prefix, + ASN1_STATE_PRE_COPY, ASN1_STATE_HEADER)) +- return 0; ++ return -1; + break; + + /* Copy any pre data first */ +@@ -189,7 +189,7 @@ static int asn1_bio_write(BIO *b, const char *in, int inl) + case ASN1_STATE_HEADER: + ctx->buflen = ASN1_object_size(0, inl, ctx->asn1_tag) - inl; + if (!ossl_assert(ctx->buflen <= ctx->bufsize)) +- return 0; ++ return -1; + p = ctx->buf; + ASN1_put_object(&p, 0, inl, ctx->asn1_tag, ctx->asn1_class); + ctx->copylen = inl; +-- +2.36.1 + diff --git a/backport-Fix-BIO_f_cipher-flushing.patch b/backport-Fix-BIO_f_cipher-flushing.patch new file mode 100644 index 0000000..8b83dd2 --- /dev/null +++ b/backport-Fix-BIO_f_cipher-flushing.patch @@ -0,0 +1,54 @@ +From 6446cb444c2a4fd8a12ccafe9329b1b1b268460d Mon Sep 17 00:00:00 2001 +From: Matt Caswell +Date: Tue, 6 Dec 2022 14:18:53 +0000 +Subject: [PATCH] Fix BIO_f_cipher() flushing + +If an error occurs during a flush on a BIO_f_cipher() then in some cases +we could get into an infinite loop. We add a check to make sure we are +making progress during flush and exit if not. + +This issue was reported by Octavio Galland who also demonstrated an +infinite loop in CMS encryption as a result of this bug. + +The security team has assessed this issue as not a CVE. This occurs on +*encryption* only which is typically processing trusted data. We are not +aware of a way to trigger this with untrusted data. + +Reviewed-by: Hugo Landau +Reviewed-by: Tomas Mraz +(Merged from https://github.com/openssl/openssl/pull/19920) +--- + crypto/evp/bio_enc.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/crypto/evp/bio_enc.c b/crypto/evp/bio_enc.c +index 6639061eae..9afce7c084 100644 +--- a/crypto/evp/bio_enc.c ++++ b/crypto/evp/bio_enc.c +@@ -299,6 +299,7 @@ static long enc_ctrl(BIO *b, int cmd, long num, void *ptr) + int i; + EVP_CIPHER_CTX **c_ctx; + BIO *next; ++ int pend; + + ctx = BIO_get_data(b); + next = BIO_next(b); +@@ -334,8 +335,14 @@ static long enc_ctrl(BIO *b, int cmd, long num, void *ptr) + /* do a final write */ + again: + while (ctx->buf_len != ctx->buf_off) { ++ pend = ctx->buf_len - ctx->buf_off; + i = enc_write(b, NULL, 0); +- if (i < 0) ++ /* ++ * i should never be > 0 here because we didn't ask to write any ++ * new data. We stop if we get an error or we failed to make any ++ * progress writing pending data. ++ */ ++ if (i < 0 || (ctx->buf_len - ctx->buf_off) == pend) + return i; + } + +-- +2.36.1 + diff --git a/backport-Fix-SMIME_crlf_copy-to-properly-report-an-error.patch b/backport-Fix-SMIME_crlf_copy-to-properly-report-an-error.patch new file mode 100644 index 0000000..a8a21b4 --- /dev/null +++ b/backport-Fix-SMIME_crlf_copy-to-properly-report-an-error.patch @@ -0,0 +1,45 @@ +From 1354191dac44f9ac04c38fd9fb56287f00039b82 Mon Sep 17 00:00:00 2001 +From: Matt Caswell +Date: Tue, 6 Dec 2022 14:21:23 +0000 +Subject: [PATCH] Fix SMIME_crlf_copy() to properly report an error + +If the BIO unexpectedly fails to flush then SMIME_crlf_copy() was not +correctly reporting the error. We modify it to properly propagate the +error condition. + +Reviewed-by: Hugo Landau +Reviewed-by: Tomas Mraz +(Merged from https://github.com/openssl/openssl/pull/19920) +--- + crypto/asn1/asn_mime.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/crypto/asn1/asn_mime.c b/crypto/asn1/asn_mime.c +index 38735cd86f..36853612b6 100644 +--- a/crypto/asn1/asn_mime.c ++++ b/crypto/asn1/asn_mime.c +@@ -489,6 +489,7 @@ int SMIME_crlf_copy(BIO *in, BIO *out, int flags) + char eol; + int len; + char linebuf[MAX_SMLEN]; ++ int ret; + /* + * Buffer output so we don't write one line at a time. This is useful + * when streaming as we don't end up with one OCTET STRING per line. +@@ -523,9 +524,12 @@ int SMIME_crlf_copy(BIO *in, BIO *out, int flags) + BIO_write(out, "\r\n", 2); + } + } +- (void)BIO_flush(out); ++ ret = BIO_flush(out); + BIO_pop(out); + BIO_free(bf); ++ if (ret <= 0) ++ return 0; ++ + return 1; + } + +-- +2.36.1 + diff --git a/backport-Fix-a-memory-leak-in-rsa_priv_encode.patch b/backport-Fix-a-memory-leak-in-rsa_priv_encode.patch new file mode 100644 index 0000000..6ef9d2e --- /dev/null +++ b/backport-Fix-a-memory-leak-in-rsa_priv_encode.patch @@ -0,0 +1,31 @@ +From 68cec7e9d31fdf05b82a627a82398d8cfb0b915c Mon Sep 17 00:00:00 2001 +From: Bernd Edlinger +Date: Wed, 16 Nov 2022 12:32:06 +0100 +Subject: [PATCH] Fix a memory leak in rsa_priv_encode + +If PKCS8_pkey_set0 fails, the memory in rk need to be clear freed +otherwise it is owned by the PKCS8_PRIV_KEY_INFO. + +Reviewed-by: Hugo Landau +Reviewed-by: Todd Short +Reviewed-by: Paul Dale +(Merged from https://github.com/openssl/openssl/pull/19694) +--- + crypto/rsa/rsa_ameth.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/crypto/rsa/rsa_ameth.c b/crypto/rsa/rsa_ameth.c +index fb045544a8..2c9c46ea53 100644 +--- a/crypto/rsa/rsa_ameth.c ++++ b/crypto/rsa/rsa_ameth.c +@@ -172,6 +172,7 @@ static int rsa_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) + strtype, str, rk, rklen)) { + RSAerr(RSA_F_RSA_PRIV_ENCODE, ERR_R_MALLOC_FAILURE); + ASN1_STRING_free(str); ++ OPENSSL_clear_free(rk, rklen); + return 0; + } + +-- +2.36.1 + diff --git a/backport-Fix-the-ceiling-on-how-much-encryption-growth-we-can.patch b/backport-Fix-the-ceiling-on-how-much-encryption-growth-we-can.patch new file mode 100644 index 0000000..77e4c3d --- /dev/null +++ b/backport-Fix-the-ceiling-on-how-much-encryption-growth-we-can.patch @@ -0,0 +1,71 @@ +From 31efcf2c872f8f4d09ad5209ccbf1ada73436775 Mon Sep 17 00:00:00 2001 +From: Matt Caswell +Date: Thu, 27 Oct 2022 14:14:53 +0100 +Subject: [PATCH] Fix the ceiling on how much encryption growth we can have + +Stitched ciphersuites can grow by more during encryption than the code +allowed for. We fix the calculation and add an assert to check we go it +right. + +Also if we are adding the MAC independently of the cipher algorithm then +the encryption growth will not include that MAC so we should remove it +from the amount of bytes that we reserve for that growth. Otherwise we +might exceed our buffer size and the WPACKET_reserve operation will +fail. + +Note that this is not a security issue. Even though we can overflow the +amount of bytes reserved in the WPACKET for the encryption, the underlying +buffer is still big enough. + +Reviewed-by: Tomas Mraz +Reviewed-by: Hugo Landau +(Merged from https://github.com/openssl/openssl/pull/19585) +--- + ssl/record/rec_layer_s3.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +diff --git a/ssl/record/rec_layer_s3.c b/ssl/record/rec_layer_s3.c +index fe4abd6723..1db1712a09 100644 +--- a/ssl/record/rec_layer_s3.c ++++ b/ssl/record/rec_layer_s3.c +@@ -16,6 +16,7 @@ + #include + #include "record_local.h" + #include "../packet_local.h" ++#include "internal/cryptlib.h" + + #if defined(OPENSSL_SMALL_FOOTPRINT) || \ + !( defined(AESNI_ASM) && ( \ +@@ -983,11 +984,14 @@ int do_ssl3_write(SSL *s, int type, const unsigned char *buf, + } + + /* +- * Reserve some bytes for any growth that may occur during encryption. +- * This will be at most one cipher block or the tag length if using +- * AEAD. SSL_RT_MAX_CIPHER_BLOCK_SIZE covers either case. +- */ +- if (!WPACKET_reserve_bytes(thispkt, SSL_RT_MAX_CIPHER_BLOCK_SIZE, ++ * Reserve some bytes for any growth that may occur during encryption. If ++ * we are adding the MAC independently of the cipher algorithm, then the ++ * max encrypted overhead does not need to include an allocation for that ++ * MAC ++ */ ++ if (!WPACKET_reserve_bytes(thispkt, ++ SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD ++ - mac_size, + NULL) + /* + * We also need next the amount of bytes written to this +@@ -1037,6 +1041,9 @@ int do_ssl3_write(SSL *s, int type, const unsigned char *buf, + + /* Allocate bytes for the encryption overhead */ + if (!WPACKET_get_length(thispkt, &origlen) ++ /* Check we allowed enough room for the encryption growth */ ++ || !ossl_assert(origlen + SSL3_RT_SEND_MAX_ENCRYPTED_OVERHEAD ++ - mac_size >= thiswr->length) + /* Encryption should never shrink the data! */ + || origlen > thiswr->length + || (thiswr->length > origlen +-- +2.36.1 + diff --git a/openssl.spec b/openssl.spec index ff47341..20ee9c0 100644 --- a/openssl.spec +++ b/openssl.spec @@ -2,7 +2,7 @@ Name: openssl Epoch: 1 Version: 1.1.1m -Release: 17 +Release: 18 Summary: Cryptography and SSL/TLS Toolkit License: OpenSSL and SSLeay URL: https://www.openssl.org/ @@ -106,6 +106,14 @@ Patch95: backport-Moving-notify-check-after-the-no-time-check.patch Patch96: backport-Convert-serverinfo-in-SSL_CTX_use_serverinfo-to-v2.patch Patch97: backport-X509-x509_req.c-Set-modified-flag-when-X509_req_info.patch Patch98: backport-ssl_cipher_process_rulestr-don-t-read-outside-rule_s.patch +Patch99: backport-Fix-BIO_f_asn1-to-properly-report-some-errors.patch +Patch100: backport-Fix-BIO_f_cipher-flushing.patch +Patch101: backport-Fix-SMIME_crlf_copy-to-properly-report-an-error.patch +Patch102: backport-Fix-a-memory-leak-in-rsa_priv_encode.patch +Patch103: backport-Fix-the-ceiling-on-how-much-encryption-growth-we-can.patch +Patch104: backport-Ensure-our-buffer-allocation-allows-for-the-Explicit.patch +Patch105: backport-Add-a-test-for-large-app-data.patch +Patch106: backport-Add-DTLS-support-to-the-large-app-data-test.patch BuildRequires: gcc perl make lksctp-tools-devel coreutils util-linux zlib-devel @@ -309,6 +317,9 @@ make test || : %ldconfig_scriptlets libs %changelog +* Fri Feb 24 2023 wangcheng - 1:1.1.1m-18 +- backport some patches + * Tue Feb 21 2023 steven - 1:1.1.1m-17 - backport some patches -- Gitee