Skip to content

gh-109945: Enable spec of multiple curves/groups for TLS #119244

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
gh-109945 fix openssl<3 tests
Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
  • Loading branch information
planetf1 committed Jul 17, 2024
commit 8459b6626ac8a5e0d4efc24079a7dbb4513a6cc9
7 changes: 5 additions & 2 deletions Lib/test/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1375,12 +1375,15 @@ def test_set_ecdh_curve(self):
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
ctx.set_ecdh_curve("prime256v1")
ctx.set_ecdh_curve(b"prime256v1")
ctx.set_ecdh_curve("prime256v1:brainpoolP384r1")
ctx.set_ecdh_curve(b"prime256v1:brainpoolP384r1")
# Only OpenSSL 3 and above supported for multiple curves
if (IS_OPENSSL_3_0_0 >= 3):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IS_OPENSSL_3_0_0 is a boolean, meaning this branch will always fail?

ctx.set_ecdh_curve("prime256v1:brainpoolP384r1")
ctx.set_ecdh_curve(b"prime256v1:brainpoolP384r1")
self.assertRaises(TypeError, ctx.set_ecdh_curve)
self.assertRaises(TypeError, ctx.set_ecdh_curve, None)
self.assertRaises(ValueError, ctx.set_ecdh_curve, "foo")
self.assertRaises(ValueError, ctx.set_ecdh_curve, b"foo")
# Multiple bad curves should cause error for any OpenSSL version
self.assertRaises(ValueError, ctx.set_ecdh_curve, "foo:bar")
self.assertRaises(ValueError, ctx.set_ecdh_curve, b"foo:bar")
self.assertRaises(ValueError, ctx.set_ecdh_curve, "prime256v1:bar")
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy