-
Notifications
You must be signed in to change notification settings - Fork 177
ssl: add SSLSocket#peer_signature_digest_name, #peer_signature_name, #group_name #908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2213,6 +2213,47 @@ def test_export_keying_material | |
end | ||
end | ||
|
||
def test_peer_signature_digest_name | ||
start_server do |port| | ||
cli_ctx = OpenSSL::SSL::SSLContext.new | ||
server_connect(port, cli_ctx) do |ssl| | ||
# Observing the "SHA256" for OpenSSL and "SHA512" for LibreSSL. | ||
assert_match(/^SHA/, ssl.peer_signature_digest_name) | ||
ssl.puts "abc"; ssl.gets | ||
end | ||
end | ||
end | ||
|
||
def test_peer_signature_name | ||
# SSL_get0_peer_signature_name() not supported | ||
return unless openssl?(3, 5, 0) | ||
|
||
start_server do |port| | ||
cli_ctx = OpenSSL::SSL::SSLContext.new | ||
server_connect(port, cli_ctx) do |ssl| | ||
assert_equal('rsa_pss_rsae_sha256', ssl.peer_signature_name) | ||
ssl.puts "abc"; ssl.gets | ||
end | ||
end | ||
end | ||
|
||
def test_group_name | ||
# SSL_get0_group_name() not supported | ||
return unless openssl?(3, 2, 0) | ||
|
||
start_server do |port| | ||
cli_ctx = OpenSSL::SSL::SSLContext.new | ||
server_connect(port, cli_ctx) do |ssl| | ||
if openssl?(3, 5, 0) | ||
assert_equal('X25519MLKEM768', ssl.group_name) | ||
else | ||
assert_equal('x25519', ssl.group_name) | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note I am investigating which commit between the OpenSSL 3.5 and 3.4 made this change in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think you can force one with |
||
ssl.puts "abc"; ssl.gets | ||
end | ||
end | ||
end | ||
|
||
private | ||
|
||
def server_connect(port, ctx = nil) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new2
is a soft-deprecated macro for this function.