Skip to content

Commit

Permalink
Empty policyURI fallback on SecureChannel SecurityPolicyURI (#669)
Browse files Browse the repository at this point in the history
  • Loading branch information
us3r64 authored Aug 29, 2023
1 parent 47bf562 commit 10b83a7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions uasc/secure_channel_crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,13 @@ func (s *SecureChannel) EncryptUserPassword(policyURI, password string, cert, no
}

// NewUserTokenSignature issues a new signature for the client to send in ActivateSessionRequest
// The security policy for the SecureChannel is used if policyURI value is null or empty
// https://reference.opcfoundation.org/Core/Part4/v104/docs/7.37
func (s *SecureChannel) NewUserTokenSignature(policyURI string, cert, nonce []byte) ([]byte, string, error) {
if policyURI == "" {
policyURI = s.cfg.SecurityPolicyURI
}

if policyURI == ua.SecurityPolicyURINone {
return nil, "", nil
}
Expand Down

0 comments on commit 10b83a7

Please sign in to comment.