SSP21-CPP
CryptoLayerConfig.h
1 
2 #ifndef SSP21_CRYPTOLAYERCONFIG_H
3 #define SSP21_CRYPTOLAYERCONFIG_H
4 
5 #include <cstdint>
6 
7 #include "ssp21/crypto/Constants.h"
8 
9 namespace ssp21
10 {
11 
13  {
14  SessionConfig() {}
15 
16  explicit SessionConfig(uint32_t ttl_pad_ms) : ttl_pad_ms(ttl_pad_ms) {}
17 
18  // the TTL padding added to the current session time of every message
19  uint32_t ttl_pad_ms = consts::crypto::default_ttl_pad_ms;
20  };
21 
23  {
24  // The maximum size of the payload data
25  uint16_t max_payload_size = consts::link::max_config_payload_size;
26  };
27 
29  {
30  CryptoLayerConfig config;
31  SessionConfig session;
32  };
33 
35  {
36  /// The maximum tx or rx nonce value that the initiator will request in the handshake
37  uint16_t max_nonce_value = consts::crypto::initiator::default_max_nonce;
38 
39  /// The maximum session time that the initiator will request in the handshake
40  uint32_t max_session_time_ms = consts::crypto::initiator::default_max_session_time_ms;
41  };
42 
44  {
45  // TODO - Add a copy constructor that applies reasonable limits/relationships to some of these values
46  struct Params
47  {
48  /// How long the initiator will will for responses
49  exe4cpp::duration_t response_timeout = consts::crypto::initiator::default_response_timeout;
50 
51  /// How long the initiator will wait before retrying a failed timeout
52  exe4cpp::duration_t retry_timeout = consts::crypto::initiator::default_retry_timeout;
53 
54  /// The initiator will begin renegotiating when the session time reaches this value
55  uint32_t session_time_renegotiation_trigger_ms = consts::crypto::initiator::default_session_time_renegotiation_trigger_ms;
56 
57  /// The initiator will begin renegotiating when either nonce value reaches this trigger level
58  uint16_t nonce_renegotiation_trigger_value = consts::crypto::initiator::default_nonce_renegotiation_trigger;
59  };
60 
61  Params params;
62  SessionLimits session_limits;
63  CryptoLayerConfig config;
64  SessionConfig session;
65  };
66 
67 }
68 
69 #endif
SSP21-cpp main namespace.
Definition: BufferTypes.h:12
uint16_t nonce_renegotiation_trigger_value
The initiator will begin renegotiating when either nonce value reaches this trigger level.
exe4cpp::duration_t response_timeout
How long the initiator will will for responses.
uint32_t max_session_time_ms
The maximum session time that the initiator will request in the handshake.
uint16_t max_nonce_value
The maximum tx or rx nonce value that the initiator will request in the handshake.
uint32_t session_time_renegotiation_trigger_ms
The initiator will begin renegotiating when the session time reaches this value.
exe4cpp::duration_t retry_timeout
How long the initiator will wait before retrying a failed timeout.