You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Adding resumption using session tickets
* Addressed feedback comments
* Addressed feedback: Update to Session ID cache lookup logic, cleaned integration tests and few other changes
* Addressed feedback and updated s2n_ticket_key to store intro timestamp instead of expiry time
* Addressed Feedback: Removed S2N_RECEIVED_VALID_TICKET status
* Added intro time to STK addition API
* Addressed feedback
* Renamed valid and semi-valid key to encrypt-decrypt and decrpt key respectively, and addressed other feedback
* Updated s2n_conn_set_handshake_type_proof in SAWScript tests
* Addressed feedback
* Added missing break statement and addressed feedback
* Addressed feedback
* Updated max key hashes
Copy file name to clipboardExpand all lines: bin/s2nc.c
+14-3Lines changed: 14 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,9 @@ void usage()
63
63
fprintf(stderr, " -i,--insecure\n");
64
64
fprintf(stderr, " Turns off certification validation altogether.\n");
65
65
fprintf(stderr, " -r,--reconnect\n");
66
-
fprintf(stderr, " Drop and re-make the connection with the same Session-ID\n");
66
+
fprintf(stderr, " Drop and re-make the connection using Session ticket. If session ticket is disabled, then re-make the connection using Session-ID \n");
67
+
fprintf(stderr, " -T,--no-session-ticket \n");
68
+
fprintf(stderr, " Disable session ticket for resumption.\n");
67
69
fprintf(stderr, " -D,--dynamic\n");
68
70
fprintf(stderr, " Set dynamic record resize threshold\n");
69
71
fprintf(stderr, " -t,--timeout\n");
@@ -223,6 +225,7 @@ int main(int argc, char *const *argv)
**s2n_connection_get_curve** returns a string indicating the elliptic curve used during ECDHE key exchange. The string "NONE" is returned if no curve has was used.
int s2n_connection_is_session_resumed(struct s2n_connection *conn);
1150
1153
```
1151
1154
1152
-
- **session** session will contain serialized session related information needed to resume handshake.
1155
+
- **lifetime_in_secs** lifetime of the cached session state required to resume a handshake
1156
+
- **session** session will contain serialized session related information needed to resume handshake either using session id or session ticket.
1153
1157
- **length** length of the serialized session state.
1154
1158
- **max_length** Max number of bytes to copy into the **session** buffer.
1155
1159
1156
-
**s2n_connection_set_session** de-serializes the session state and updates the connection accrodingly.
1160
+
**s2n_config_set_session_state_lifetime** sets the lifetime of the cached session state. The default value is 15 hours.
1161
+
1162
+
**s2n_connection_set_session** de-serializes the session state and updates the connection accordingly.
1163
+
1164
+
**s2n_connection_get_session** serializes the session state from connection and copies into the **session** buffer and returns the number of bytes that were copied. If the first byte in **session** is 1, then the next 2 bytes will contain the session ticket length, followed by session ticket and session state. If the first byte in **session** is 0, then the next byte will contain session id length, followed by session id and session state.
1157
1165
1158
-
**s2n_connection_get_session** serializes the session state from connection and copies into the **session** buffer and returns the number of bytes that were copied.
1166
+
**s2n_connection_get_session_ticket_lifetime_hint** returns the session ticket lifetime hint in seconds from the server or -1 when session ticket was not used for resumption.
1159
1167
1160
-
**s2n_connection_get_session_length** returns number of bytes needed to store serailized session state; it can be used to allocate the **session** buffer.
1168
+
**s2n_connection_get_session_length** returns number of bytes needed to store serialized session state; it can be used to allocate the **session** buffer.
1161
1169
1162
1170
**s2n_connection_get_session_id_length** returns session id length from the connection.
1163
1171
1164
1172
**s2n_connection_is_session_resumed** checks if the handshake is abbreviated or not.
1165
1173
1174
+
### Session Ticket Specific calls
1175
+
1176
+
```c
1177
+
int s2n_config_set_session_tickets_onoff(struct s2n_config *config, uint8_t enabled);
1178
+
int s2n_config_set_ticket_encrypt_decrypt_key_lifetime(struct s2n_config *config, uint64_t lifetime_in_secs);
1179
+
int s2n_config_set_ticket_decrypt_key_lifetime(struct s2n_config *config, uint64_t lifetime_in_secs);
-**enabled** when set to 0 will disable session resumption using session ticket
1184
+
-**name** name of the session ticket key that should be randomly generated to avoid collisions
1185
+
-**name_len** length of session ticket key name
1186
+
-**key** key used to perform encryption/decryption of session ticket
1187
+
-**key_len** length of the session ticket key
1188
+
-**intro_time_in_seconds_from_epoch** time at which the session ticket key is introduced. If this is 0, then intro_time_in_seconds_from_epoch is set to now.
1189
+
1190
+
**s2n_config_set_session_tickets_onoff** enables and disables session resumption using session ticket
1191
+
1192
+
**s2n_config_set_ticket_encrypt_decrypt_key_lifetime** sets how long a session ticket key will be in a state where it can be used for both encryption and decryption of tickets on the server side. The default value is 2 hours.
1193
+
1194
+
**s2n_config_set_ticket_decrypt_key_lifetime** sets how long a session ticket key will be in a state where it can used just for decryption of already assigned tickets on the server side. Once decrypted, the session will resume and the server will issue a new session ticket encrypted using a key in encrypt-decrypt state. The default value is 13 hours.
1195
+
1196
+
**s2n_config_add_ticket_crypto_key** adds session ticket key on the server side. It would be ideal to add new keys after every (encrypt_decrypt_key_lifetime_in_nanos/2) nanos because
1197
+
this will allow for gradual and linear transition of a key from encrypt-decrypt state to decrypt-only state.
0 commit comments