ua_transport_binary_secure.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #ifndef OPCUA_TRANSPORT_BINARY_SECURE_H_
  2. #define OPCUA_TRANSPORT_BINARY_SECURE_H_
  3. #include "ua_transport.h"
  4. #include "ua_transport_binary.h"
  5. #include "ua_stack_channel.h"
  6. #include "ua_stack_channel_manager.h"
  7. /*inputs for secure Channel which must be provided once
  8. endPointUrl
  9. securityPolicyUrl
  10. securityMode
  11. revisedLifetime
  12. */
  13. /*inputs for secure Channel Manager which must be provided once
  14. maxChannelCount
  15. */
  16. typedef struct {
  17. UA_UInt32 secureChannelId;
  18. UA_SymmetricAlgorithmSecurityHeader tokenId;
  19. UA_DateTime createdAt;
  20. UA_Int32 revisedLifetime;
  21. } SL_ChannelSecurityToken;
  22. /*
  23. typedef struct SL_Channel_T {
  24. UA_String secureChannelId;
  25. UA_TL_Connection1 tlConnection;
  26. Session *session; // equals UA_Null if no session is active
  27. UA_AsymmetricAlgorithmSecurityHeader remoteAsymAlgSettings;
  28. UA_AsymmetricAlgorithmSecurityHeader localAsymAlgSettings;
  29. UA_SequenceHeader sequenceHeader;
  30. UA_UInt32 securityMode;
  31. UA_ByteString remoteNonce;
  32. UA_ByteString localNonce;
  33. UA_UInt32 connectionState;
  34. SL_ChannelSecurityToken securityToken;
  35. } SL_secureChannel;
  36. */
  37. UA_Int32 SL_Process(const UA_ByteString* msg, UA_UInt32* pos);
  38. /**
  39. * @brief Wrapper function, to encapsulate handleRequest for openSecureChannel requests
  40. * @param channel A secure Channel structure, which receives the information for the new created secure channel
  41. * @param msg Message which holds the binary encoded request
  42. * @param pos Position in the message at which the request begins
  43. * @return Returns UA_SUCCESS if successful executed, UA_ERROR in any other case
  44. */
  45. UA_Int32 SL_ProcessOpenChannel(SL_Channel channel, const UA_ByteString* msg,
  46. UA_UInt32 *pos);
  47. UA_Int32 SL_ProcessCloseChannel(SL_Channel channel, const UA_ByteString* msg,
  48. UA_UInt32 *pos);
  49. #endif /* OPCUA_TRANSPORT_BINARY_SECURE_H_ */