feat(tls): use pyOpenSSL for export_keying_material#772
Open
gijzelaerr wants to merge 1 commit into
Open
Conversation
CPython's ssl module does not expose export_keying_material on SSLObject/SSLSocket, which blocks password legitimation on TLS- connected PLCs (the OMS exporter secret cannot be derived). Add a _BioTLS wrapper that prefers pyOpenSSL when available — it supports export_keying_material via its Connection object with memory BIOs. Falls back to stdlib ssl (oms_secret=None) when pyOpenSSL is not installed. pyOpenSSL added to the s7commplus optional dependency group. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
cant confirm it working no change to master it seems: |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_BioTLSwrapper class that prefers pyOpenSSL when available, falls back to stdlib sslConnectionobject supportsexport_keying_material()(RFC 5705), which CPython'sssl.SSLObjectdoes nots7commplusoptional dependency groupoms_secret=None)Context
Confirmed by @ale-rinaldi in #718: CPython 3.13/3.14
ssl.SSLObjectlacksexport_keying_material, sooms_secretis alwaysNoneand password legitimation is dead code. @Erik1000's S7-1512SP-1 (#760) connects over TLS 1.3 but can't authenticate because of this.Test plan
_BioTLS)pip install "python-snap7[s7commplus] @ git+...@feat/pyopenssl-keying-material"🤖 Generated with Claude Code