Skip to content

Reset server MAC after TransformFinalBlock on .NET FW - #1830

Open
scott-xu wants to merge 1 commit into
sshnet:developfrom
scott-xu:fix/initialize-mac-netframework
Open

Reset server MAC after TransformFinalBlock on .NET FW#1830
scott-xu wants to merge 1 commit into
sshnet:developfrom
scott-xu:fix/initialize-mac-netframework

Conversation

@scott-xu

Copy link
Copy Markdown
Collaborator

Call _serverMac.Initialize() after TransformFinalBlock when running on .NET Framework. This ensures the MAC is properly reset, addressing differences in cryptographic API behavior across different versions of mscorlib.dll.

Close #1829

Comment thread src/Renci.SshNet/Session.cs Outdated
@scott-xu
scott-xu force-pushed the fix/initialize-mac-netframework branch from b407a2d to f8d1e3b 比较 August 24, 2026 13:14
Add `#if NETFRAMEWORK` block to call `_serverMac.Initialize()` after `TransformFinalBlock` in `ReceiveMessage`. Ensures MAC is reset for reuse, addressing issues on older .NET Framework builds (e.g., mscorlib.dll 4.8.4110.0).
@scott-xu
scott-xu force-pushed the fix/initialize-mac-netframework branch from f8d1e3b to b0a4569 比较 August 24, 2026 13:18
注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

None yet

项目

None yet

Development

Successfully merging this pull request may close these issues.

MAC error / CryptographicException on .NET Framework in 2026.0.0: _serverMac is reused across packets without Initialize()

2 participants