Skip to content
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

Fixes to symmetric decryption #377

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

einarmo
Copy link
Contributor

@einarmo einarmo commented Aug 21, 2024

Remove padding when decrypting symmetric messages.

Also fixes a pair of minor issues:

  • We stored the session ID before actually validating that we got a valid session. This stuff can still be improved, but this at least fixes an obvious hole.
  • 2^13 is 8192, not 8196, this is also what the standard uses.

Should fix #373

@DOhlsson
Copy link

I tried running with the code in this branch but got the error I posted about here

@DOhlsson
Copy link

I tried running with the code in this branch but got the error I posted about here

That was an unrelated issue. This PR solves the actual problem I was having.

@svanharmelen
Copy link
Contributor

I've spend a day or two debugging what felt like random error messages when making browse requests to a reasonably big (so with a few nodes with many, many children) OPC server. Here are two examples:

"Failed to fill whole buffer":
image

"String exceeds decoding limits" (while the actual strings are all less then 30 bytes long):
image

I noticed that the issue only occurred when the message was split into multiple chunks, so I've had a closer look at all the chunker logic. By the time I was done reading the specifications and a few HEX dumps of all the bytes coming in and being reconstructed to a singe message, I too came to the conclusion that the padding info was not being removed.

Luckily I decided to check for open issues and PRs once more (now I knew what to look for) before creating a PR myself and found this PR 😏

@locka99 it seems you are pretty busy lately, but this is actually a pretty nasty bug. So if/when you have a minute it would be great if you can have a quick look and/or merge this PR. Also "hello again 👋🏻" as I've been away from this project for quite a while, but I'm back at it for a new project which should keep me busy for years to come 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Opcua client fails to connect to Prosys Simulation Server configured with multiple endpoints
4 participants