-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Actually add support for SSL_get_server/peer_tmp_key (#1945)
Ruby has a dependency on `SSL_get_server_tmp_key` which we've exposed as a no-op in the past. Ruby has a couple of tests that expect the function to actually return a value however, which means we'll have to actually support this. The relevant information about the server key was saved in a `tmp` structure in `SSL3_STATE` (originally `ssl3_state_st` in OpenSSL). This `tmp` structure has been removed by upstream, with its contents moved either to `SSL_HANDSHAKE` or the state machine. `peer_key` seems to contain the relevant information we want and it's been moved to `SSL_HANDSHAKE` in this case. The issue is any information in `SSL_HANDSHAKE` is shed immediately after the connection has been established and the contents of `peer_key` is shed along with it. We may have to revert parts of a4c8ff0 to move the field back into SSL3_STATE so we can access the field. Laster versions of OpenSSL have changed this to an alias to `SSL_get_peer_tmp_key` which means you can retrieve the client’s key if you’re the server and vice versa. This causes `SSL_get_server_tmp_key` to have very confusing behavior where you actually retrieve the client's key when you're a server and Ruby already has tests somewhat dependent on the `SSL_get_peer_tmp_key` behavior. ### Testing: Test that tries retrieving a X25519 or EC_KEY based on the connection for each TLS version. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.
- Loading branch information
1 parent
25709ca
commit 8f1aae9
Showing
10 changed files
with
129 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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