Merge and addapt Secure channel enhancements to new master code#3567
Merge and addapt Secure channel enhancements to new master code#3567mrsuciu wants to merge 53 commits intoOPCFoundation:masterfrom
Conversation
Update version from 1.5.378-preview to 1.5.378
…nnel-enhancements-2025-11
…, and correcting ECC_brainpoolP384r1/Basic128Rsa15 IV, signature, padding, and nonce parameters.
…n encrypting user tokens; this prevents null payloads from causing BadIdentityTokenInvalid.
…ding to overwrite next fields (signature)
…estores ServerNonce and reconstructs ECC ephemeral key Nonce from bytes and policy
…ies() for all six ECC certificate types (nistP256, nistP384, brainpoolP256r1, brainpoolP384r1, curve25519, curve448) to SecurityConfiguration. Added Sign and SignAndEncrypt endpoints for the four ECC AesGcm/ChaChaPoly policy pairs (nistP256, nistP384, brainpoolP256r1, brainpoolP384r1) to ServerFixture.
…nd (instead of relying on Endpoints being preloaded by earlier tests), which avoids false ignores when running tests directlyy
| } | ||
| } | ||
|
|
||
| ITransportChannel activeChannel = TransportChannel; |
There was a problem hiding this comment.
we should add an enhancement Issue to get all this SecurityPolicy Specific stuff out of the main session class into a helper IMO. all signing/ encrypting / additional headers should be separate. But not required in this PR. Also the User Token handling / selection.
| @@ -499,10 +494,19 @@ X509Certificate2Collection clientCertificateChain | |||
| // sign the client nonce (if provided). | |||
| if (parsedClientCertificate != null && clientNonce != null) | |||
There was a problem hiding this comment.
all this logic should inclduing the Additional header not be in the StandardServer class, instead we should do it in a helper living in the Session folder of the Server.
| // create server nonce. | ||
| var serverNonceObject = Nonce.CreateNonce( | ||
| context.ChannelContext.EndpointDescription.SecurityPolicyUri); | ||
| var serverNonceObject = Nonce.CreateNonce(0); |
There was a problem hiding this comment.
isnt the nonce length dependent on the security policy?
| } | ||
|
|
||
| /// <summary> | ||
| /// Verifies a ECDsa signature. |
There was a problem hiding this comment.
| /// Verifies a ECDsa signature. | |
| /// Verifies a signature. |
|
|
||
| if (oscRequestSignature != null && SecurityPolicy.SecureChannelEnhancements) | ||
| { | ||
| // copy osc request signature if provided before verifying. |
There was a problem hiding this comment.
osc is OpenSecureChannel?
| .AddEccSignPolicies() | ||
| .AddEccSignAndEncryptPolicies(); | ||
| .AddEccSignAndEncryptPolicies() | ||
| .AddPolicy(MessageSecurityMode.Sign, SecurityPolicies.ECC_nistP256_AesGcm) |
There was a problem hiding this comment.
we should do a new helper
| @@ -130,8 +130,28 @@ public async Task LoadConfigurationAsync(string pkiRoot = null) | |||
| .AddPolicy(MessageSecurityMode.SignAndEncrypt, SecurityPolicies.Basic256) | |||
| .AddSignPolicies() | |||
| .AddSignAndEncryptPolicies() | |||
| .AddPolicy(MessageSecurityMode.Sign, SecurityPolicies.RSA_DH_AesGcm) | |||
There was a problem hiding this comment.
we should do a new helper
…bility supports them
Proposed changes
Merge and addapt Secure channel enhancements to new master code
Related Issues
Types of changes
What types of changes does your code introduce?
Put an
xin the boxes that apply. You can also fill these out after creating the PR.Checklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...