Repository navigation
[WIP] Openssl 111 features - #11900
Closed
bernd-edlinger wants to merge 78 commits into
Closed
bernd-edlinger wants to merge 78 commits into
bernd-edlinger wants to merge 78 commits into
Conversation
bernd-edlinger
force-pushed
the
openssl-111-features
branch
4 times, most recently
from
May 25, 2020 21:16
91b364d to
7de3879
Compare
bernd-edlinger
force-pushed
the
openssl-111-features
branch
from
May 29, 2020 15:15
4b2b6a4 to
941a114
Compare
2 tasks
bernd-edlinger
force-pushed
the
openssl-111-features
branch
2 times, most recently
from
June 7, 2020 15:08
4fc29cf to
a578a17
Compare
bernd-edlinger
force-pushed
the
openssl-111-features
branch
from
June 13, 2020 09:32
ccf1dfd to
79981d4
Compare
bernd-edlinger
force-pushed
the
openssl-111-features
branch
from
January 31, 2021 15:18
79981d4 to
7dc34e3
Compare
Member
Author
|
Some openssl speed results follow :-) This PR: 1.1.1 : master: |
bernd-edlinger
force-pushed
the
openssl-111-features
branch
from
February 4, 2021 15:40
2520ccb to
d25c445
Compare
bernd-edlinger
force-pushed
the
openssl-111-features
branch
from
June 3, 2021 07:39
d25c445 to
657625e
Compare
bernd-edlinger
force-pushed
the
openssl-111-features
branch
from
June 10, 2021 14:53
657625e to
3062317
Compare
bernd-edlinger
force-pushed
the
openssl-111-features
branch
from
August 20, 2021 20:53
3062317 to
3662f4d
Compare
bernd-edlinger
force-pushed
the
openssl-111-features
branch
from
August 22, 2021 20:42
7ded67e to
28edc03
Compare
paulidale
previously approved these changes
Aug 23, 2021
bernd-edlinger
force-pushed
the
openssl-111-features
branch
7 times, most recently
from
August 25, 2021 15:52
e2598db to
32f8869
Compare
Fixes openssl#20693 Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Tom Cosgrove <[email protected]> (Merged from openssl#20708) (cherry picked from commit efbff4d)
Fixes openssl#20268 Values such as q=1 or priv=0 caused infinite loops when calling DSA_sign() without these changes. There are other cases where bad domain parameters may have caused infinite loops where the retry counter has been added. The simpler case of priv=0 also hits this case. q=1 caused an infinite loop in the setup. The max retry value has been set to an arbitrary value of 8 (it is unlikely to ever do a single retry for valid values). The minimum q bits was set to an arbitrary value of 128 (160 is still used for legacy reasons when using 512 bit keys). Thanks @guidovranken for detecting this, and @davidben for his insightful analysis. Reviewed-by: Matt Caswell <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from openssl#20384) (cherry picked from commit 3a4e09a)
Similiar checks to the DSA code have been added for ECDSA also. This should not be a problem when using named groups. Reviewed-by: Matt Caswell <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from openssl#20384) (cherry picked from commit 5f820bd) (cherry picked from commit 2022b9e)
Similiar to the issue found in PR openssl#20553 for DSA_sign(). ECDSA_sign() leaked memory if the signature was NULL when i2d_ECDSA_SIG was called. Note that this does not affect the higher level EVP functions as they correctly handle NULL. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20554) (cherry picked from commit 4befe81) (cherry picked from commit 680b4be)
Related to openssl#20268 DSA_sign() assumes that the signature passed in is related to DSA_size(). If q is negative then DSA_size() actually fails and returns 0. A test that tries to allocate the signature buffer using DSA_size() and then pass it to DSA_sign() will then either. (1) Have a signature buffer of NULL. In this case it was leaking data returned via i2d_DSA_SIG. (2) Cause a seg fault because we created a buffer that was not large enough to hold the signature. As it already checked zero we also now check for negative values also. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Todd Short <[email protected]> (Merged from openssl#20553) (cherry picked from commit 9559ad0) (cherry picked from commit ce90b5e)
macos-10.15 is no longer working, add macos-12 instead.
"./config -DSSL3_ALIGN_PAYLOAD=0" used to work before 1.1.1 but is now broken. This patch fixes it again.
Clang 16 will be released shortly (beginning of March). Signed-off-by: Sam James <[email protected]> Reviewed-by: Hugo Landau <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from openssl#20346) (cherry picked from commit 6de73f5)
This doubles the performance of curve448 with certain fully 64-bit capable compilers.
This saves one unnecessary AES key derivation per RAND_bytes call.
The ECB cipher is already set up here, and quite simple to use if exactly one AES block output is needed. This saves one additioal AES_set_encrypt_key call if RAND_bytes is used to derive exactly 16 bytes.
The additional data value in rand_unix.c is 24 bytes on x86_64-linux-gnu, due to structure alignment, while the raw data values contain only 20 bytes. Unfortunately this makes the ctr_df function use another AES encyption round. However the padding bytes are just filled with zero bytes and do not add any security at all. Therefore we use the raw data values, and not a C structure with additional alignment bytes. This makes the size of the additional data value usually 4 bytes smaller, and saves another 3 AES encryption operations each time the RAND_bytes function is called.
TLS pipelining provides the ability for libssl to read or write multiple records in parallel. It requires special ciphers to do this, and there are currently no built-in ciphers that provide this capability. However, the dasync engine does have such a cipher, so we add a test for this capability using that engine. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Hugo Landau <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from openssl#20208) (cherry picked from commit 24c7d36)
…lled The pipeline input/output buf arrays must remain accessible to the EVP_CIPHER_CTX until EVP_Cipher is subsequently called. This fixes an asan error discovered by the newly added pipeline test. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Hugo Landau <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from openssl#20208) (cherry picked from commit df9c7ce)
During read pipelining we must ensure that the buffer is sufficiently large to read enough data to fill our pipelines. We also remove some code that moved data to the start of the packet if we can. This was unnecessary because of later code which would end up moving it anyway. The earlier move was also incorrect in the case that |clearold| was 0. This would cause the read pipelining code to fail with sufficiently large records. Fixes openssl#20197 Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Hugo Landau <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from openssl#20208) (cherry picked from commit 1d06598)
We shouldn't be putting more data into a pipeline than the value of split_send_fragment. This is a backport of a fix which was included in a much larger commit in master (c618679) related to moving the pipelining code into the new record layer that exists there. Reviewed-by: Tomas Mraz <[email protected]> Reviewed-by: Hugo Landau <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from openssl#20208) (cherry picked from commit 2c4b1c7)
With short messages the last pipeline buffer may be empty, which happens in the pipelining test case. Therefore the BIO_write returns 0, which is treated as an error. Instead of treating that as a good result, avoid the call to BIO_write completely.
when using write pipelines it is possible that there is not enough data to fill all write buffers. In that case it is pssible that empty write buffers are left at the end. However RECORD_LAYER_write_pending did not handle that case properly. That may cause data loss after a partial write, due to the wrong result, because ssl3_write_pending will not be called, and thus the pending data will be lost. Fixes: openssl#21461
Test various scenarios for a write retry occuring during a handshake. Reviewed-by: Dmitry Belyavskiy <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from openssl#21435) (cherry picked from commit d6179e6)
A BIO is documented to return -1 on write retry - but sometimes they return 0. ssl3_do_write() was incorrectly handling a 0 response. Fixes openssl#21422 Reviewed-by: Dmitry Belyavskiy <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from openssl#21435) (cherry picked from commit 034ea1d)
When an early error happens in the test_pipelining function and idx == 5 the error handling would try to call OPENSSL_free(msg), but msg is at that time just a string constant in read-only memory, so a crash would be the result. Fixed that by using fragsize as an indication when to free msg. Reviewed-by: Tom Cosgrove <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl#21512) (cherry picked from commit 06a0d40)
Signed-off-by: Sam James <[email protected]> Reviewed-by: Tom Cosgrove <[email protected]> Reviewed-by: Paul Dale <[email protected]> (Merged from openssl#20961) (cherry picked from commit 5d16169)
for consistency with commit ee60a49 ("Bump actions/checkout from 2 to 4")
In the error handling case the memory in vb->users_pwd was accidentally not released. Reviewed-by: Paul Dale <[email protected]> Reviewed-by: Matt Caswell <[email protected]> Reviewed-by: Tomas Mraz <[email protected]> (Merged from openssl#21981) (cherry picked from commit 68e95f7)
when used in conjunction with -out and -modulus options. Fixes openssl#21403
Member
|
@bernd-edlinger Given the 1.1.1 EOL I am going to close this PR. People can still get the patches from: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This contains 1.1.1 features I have
#2986
#6516
#11525
#11577
#11666
#11780
#11782
#11846
#11895
#11934
#11956
#11995
#12079