Skip to content

Commit

Permalink
fix(client): Select Endpoint only if it also has a matching UserToken…
Browse files Browse the repository at this point in the history
…Policy
  • Loading branch information
jpfr committed Oct 3, 2024
1 parent 0ccb615 commit 9023b2b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/client/ua_client_connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -928,9 +928,9 @@ responseGetEndpoints(UA_Client *client, void *userdata,
continue;
}

/* We have found a matching endpoint.
* But maybe not a amtching user token policy. */
bestEndpointIndex = i;
/* We have found a matching endpoint. But maybe not a matching user
* token policy. Only update bestTokenIndex when we also have the use
* token policy. */

/* Compare the available UserTokenPolicies */
for(size_t j = 0; j < endpoint->userIdentityTokensSize; ++j) {
Expand Down Expand Up @@ -1006,6 +1006,7 @@ responseGetEndpoints(UA_Client *client, void *userdata,

/* Update tracking */
bestEndpointLevel = endpoint->securityLevel;
bestEndpointIndex = i;
bestTokenIndex = j;

/* Stop search for the UserTokenPolicy. But we go on searching for
Expand Down

0 comments on commit 9023b2b

Please sign in to comment.