Title: Check consistency of OpenSSL data headers · Issue #132745 · python/cpython · GitHub
Open Graph Title: Check consistency of OpenSSL data headers · Issue #132745 · python/cpython
X Title: Check consistency of OpenSSL data headers · Issue #132745 · python/cpython
Description: Feature or enhancement Proposal: OpenSSL mnemonics may change in minor releases and/or they may have clashes. Clashes are annoying because we cannot build 1-to-1 hash tables out of it while inconsistencies mean that error messages would ...
Open Graph Description: Feature or enhancement Proposal: OpenSSL mnemonics may change in minor releases and/or they may have clashes. Clashes are annoying because we cannot build 1-to-1 hash tables out of it while inconsi...
X Description: Feature or enhancement Proposal: OpenSSL mnemonics may change in minor releases and/or they may have clashes. Clashes are annoying because we cannot build 1-to-1 hash tables out of it while inconsi...
Opengraph URL: https://github.com/python/cpython/issues/132745
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Check consistency of OpenSSL data headers","articleBody":"# Feature or enhancement\n\n### Proposal:\n\nOpenSSL mnemonics may change in minor releases and/or they may have clashes. Clashes are annoying because we cannot build 1-to-1 hash tables out of it while inconsistencies mean that error messages would be incorrectly rendered. Note that only error reporting is affected but not error handling as code paths are using the macros defined by OpenSSL (so it doesn't matter which version we're using, as soon as they are available)\n\nI want to create a tool that checks the OpenSSL mnemonics themselves to see if there are duplicates for instance, as well as a tool that bisects whether the latest OpenSSL version has changed its mnemonics. Currently, `_ssl.c` contains this:\n\n```c\n/* Include generated data (error codes) */\n/* See make_ssl_data.h for notes on adding a new version. */\n#if (OPENSSL_VERSION_NUMBER \u003e= 0x30100000L)\n#include \"_ssl_data_34.h\"\n#elif (OPENSSL_VERSION_NUMBER \u003e= 0x30000000L)\n#include \"_ssl_data_300.h\"\n#elif (OPENSSL_VERSION_NUMBER \u003e= 0x10101000L)\n#include \"_ssl_data_111.h\"\n#else\n#error Unsupported OpenSSL version\n#endif\n```\n\nIn other words, we make the assumption that error codes from OpenSSL 3.1.x up to now have not been changed, but this is not necessarily correct (if new codes are added, it's fine, but if mnemonics are renumbered, it's not: this happened in 3.4.0 -\u003e 3.4.1).\n\nIn addition, the reason why 3.4.1 mnemonics changed is because there were mismatched values (see https://github.com/openssl/openssl/issues/26388). The tool would then be doing the following:\n\n- check whether OpenSSL mnemonics are valid after pulling them; namely check that we don't have mismatched values or clashing values.\n- compute the diff between the latest known mnemonics and the pulled mnemonics. If there are more entries, we can use the same file; otherwise a new file must be created.\n\nTo ease development, I also suggest a separate `_ssl_data.h` file, also automatically generated, and that would be responsible to hold the above code snippet. It's easier than adding more and more lines to `_ssl.c` in the future. I also suggest moving the `_ssl_data_*` files into a dedicated folder as we may have more and more files in the future. \n\n### Has this already been discussed elsewhere?\n\nThis is a minor feature, which does not need previous discussion elsewhere\n\n### Links to previous discussion of this feature:\n\n_No response_","author":{"url":"https://github.com/picnixz","@type":"Person","name":"picnixz"},"datePublished":"2025-04-20T10:33:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/132745/cpython/issues/132745"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bbff070e-8747-ab4f-8c46-ac83ff0def97 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D1B2:2BBD61:2479BEF:301F0AD:696B161E |
| html-safe-nonce | 5315536d70afa352f8b3f0afed294a29782d18cae842d9d0d4bd608201620057 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMUIyOjJCQkQ2MToyNDc5QkVGOjMwMUYwQUQ6Njk2QjE2MUUiLCJ2aXNpdG9yX2lkIjoiMjA0MjYzMTQxMjAzNTI5NDc1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 635fe2f7f9f092f74a0c5a10c950fe875b226efed2fbc4538e939ea55e5846bd |
| hovercard-subject-tag | issue:3006942239 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/132745/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d54d5add8c4605107267ceefc2bcbb17e3d4e99b0d088d4a9a1ea2528a62eed5/python/cpython/issues/132745 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d54d5add8c4605107267ceefc2bcbb17e3d4e99b0d088d4a9a1ea2528a62eed5/python/cpython/issues/132745 |
| og:image:alt | Feature or enhancement Proposal: OpenSSL mnemonics may change in minor releases and/or they may have clashes. Clashes are annoying because we cannot build 1-to-1 hash tables out of it while inconsi... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | picnixz |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width