Skip to content

Commit

Permalink
fix(pubsub): fix order of SecurityHeader and ExtendedNetworkMessageHe…
Browse files Browse the repository at this point in the history
…ader (#5979)

In the PubSub specification the SecurityHeader is before the
ExtendedNetworkMessageHeader, thus the headers must be decoded in this
order.
  • Loading branch information
keba-estr committed Sep 6, 2023
1 parent 57ba890 commit b8ac9e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pubsub/ua_pubsub_networkmessage.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,14 +803,14 @@ UA_NetworkMessage_decodeHeaders(const UA_ByteString *src, size_t *offset, UA_Net
UA_CHECK_STATUS(rv, return rv);
}

rv = UA_ExtendedNetworkMessageHeader_decodeBinary(src, offset, dst);
UA_CHECK_STATUS(rv, return rv);

if (dst->securityEnabled) {
rv = UA_SecurityHeader_decodeBinary(src, offset, dst);
UA_CHECK_STATUS(rv, return rv);
}

rv = UA_ExtendedNetworkMessageHeader_decodeBinary(src, offset, dst);
UA_CHECK_STATUS(rv, return rv);

return UA_STATUSCODE_GOOD;
}

Expand Down

0 comments on commit b8ac9e7

Please sign in to comment.