Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
gh-136306: Add support for SSL groups#136307
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes from1 commit
662d66e
9acb2c3
03072c4
187ff2e
452bdec
9b4066b
a6ad433
aecc96b
05c75a5
304c223
b516200
e0fdd25
35a3ae0
e0baf56
c5a1146
5e626a6
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
- Loading branch information
Uh oh!
There was an error while loading.Please reload this page.
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -964,22 +964,15 @@ def test_get_ciphers(self): | ||
def test_set_groups(self): | ||
ctx = ssl.create_default_context() | ||
self.assertIsNone(ctx.set_groups('P-256:X25519')) | ||
picnixz marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
self.assertRaises(ssl.SSLError, ctx.set_groups, 'P-256:xxx') | ||
@unittest.skipUnless(CAN_GET_AVAILABLE_OPENSSL_GROUPS, | ||
"OpenSSL version doesn't support getting groups") | ||
def test_get_groups(self): | ||
ctx = ssl.create_default_context() | ||
# By default, only return official IANA names. | ||
self.assertNotIn('P-256', ctx.get_groups()) | ||
picnixz marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
self.assertIn('P-256', ctx.get_groups(include_aliases=True)) | ||
def test_options(self): | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -3462,7 +3462,7 @@ _ssl__SSLContext_get_groups_impl(PySSLContext *self, int include_aliases) | ||
#if OPENSSL_VERSION_NUMBER >= 0x30500000L | ||
STACK_OF(OPENSSL_CSTRING) *groups = NULL; | ||
const char *group; | ||
int i, num; | ||
PyObject *item, *result = NULL; | ||
// This "groups" object is dynamically allocated, but the strings inside | ||
@@ -3492,7 +3492,7 @@ _ssl__SSLContext_get_groups_impl(PySSLContext *self, int include_aliases) | ||
// Group names are plain ASCII, so there's no chance of a decoding | ||
picnixz marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
// error here. However, an allocation failure could occur when | ||
// constructing the Unicode version of the names. | ||
item =PyUnicode_DecodeASCII(group, strlen(group), "strict"); | ||
if (item == NULL) { | ||
_setSSLError(get_state_ctx(self), "Can't allocate group name", 0, __FILE__, __LINE__); | ||
goto error; | ||