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

[Client] select the most secure User Identity Token if a server offers multiple ones #2611

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

romanett
Copy link
Contributor

@romanett romanett commented May 6, 2024

Proposed changes

This fix makes the client select the most secure UserIdentity Token if a server offers more than one.
Before the client just selected the first UserIdentity Token offered by the server.

Related Issues

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds functionality)
  • Test enhancement (non-breaking change to increase test coverage)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected, requires version increase of Nuget packages)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc.
  • I have signed the CLA.
  • I ran tests locally with my changes, all passed.
  • I fixed all failing tests in the CI pipelines.
  • I fixed all introduced issues with CodeQL and LGTM.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

Further comments

Copy link

codecov bot commented May 6, 2024

Codecov Report

Attention: Patch coverage is 94.11765% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 54.62%. Comparing base (663ed10) to head (5fb7a7f).

Files Patch % Lines
...Ua.Core/Stack/Configuration/EndpointDescription.cs 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2611      +/-   ##
==========================================
- Coverage   54.68%   54.62%   -0.07%     
==========================================
  Files         343      343              
  Lines       65216    65217       +1     
  Branches    13354    13354              
==========================================
- Hits        35664    35622      -42     
- Misses      25676    25712      +36     
- Partials     3876     3883       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@mregen mregen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor improvements inline, please check.
imho we should also determine the best security policy by this function instead of the server supplied values in the SelectBestendpoint helper. But that could be done in separate PR.


byte result = 0;
switch (policyUri)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit - I wonder which stringcomparison policy is used here...

Stack/Opc.Ua.Core/Schema/SecuredApplicationHelpers.cs Outdated Show resolved Hide resolved
@mregen
Copy link
Contributor

mregen commented May 6, 2024

one typo to go...

@romanett
Copy link
Contributor Author

romanett commented May 6, 2024

Also added calculated Security Level to the Endpoint Selection

@mregen mregen added this to the May Update milestone May 14, 2024
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.

OPC Foundation library doesnt select the most secured encryption algorithm to ActivateSessionRequest
2 participants