A simple library to support serving https.
Dependents: oldheating gps motorhome heating
tls/tls-connection.h@5:ee5489ee1117, 2019-08-28 (annotated)
- Committer:
- andrewboyson
- Date:
- Wed Aug 28 07:10:59 2019 +0000
- Revision:
- 5:ee5489ee1117
- Child:
- 6:819c17738dc2
Added connection status
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andrewboyson | 5:ee5489ee1117 | 1 | #include "sha256.h" |
andrewboyson | 5:ee5489ee1117 | 2 | |
andrewboyson | 5:ee5489ee1117 | 3 | #define DO_WAIT_CLIENT_HELLO 0 |
andrewboyson | 5:ee5489ee1117 | 4 | #define DO_SEND_SERVER_HELLO 1 |
andrewboyson | 5:ee5489ee1117 | 5 | #define DO_WAIT_CLIENT_CHANGE 2 |
andrewboyson | 5:ee5489ee1117 | 6 | #define DO_WAIT_DECRYPT_MASTER_SECRET 3 |
andrewboyson | 5:ee5489ee1117 | 7 | #define DO_SEND_SERVER_CHANGE 4 |
andrewboyson | 5:ee5489ee1117 | 8 | #define DO_APPLICATION 5 |
andrewboyson | 5:ee5489ee1117 | 9 | #define DO_SEND_ALERT_ILLEGAL_PARAMETER 6 |
andrewboyson | 5:ee5489ee1117 | 10 | #define DO_SEND_ALERT_INTERNAL_ERROR 7 |
andrewboyson | 5:ee5489ee1117 | 11 | |
andrewboyson | 5:ee5489ee1117 | 12 | struct TlsConnection |
andrewboyson | 5:ee5489ee1117 | 13 | { |
andrewboyson | 5:ee5489ee1117 | 14 | int id; //An id of zero means the record is empty |
andrewboyson | 5:ee5489ee1117 | 15 | uint32_t lastUsed; |
andrewboyson | 5:ee5489ee1117 | 16 | int toDo; |
andrewboyson | 5:ee5489ee1117 | 17 | int session; |
andrewboyson | 5:ee5489ee1117 | 18 | struct Sha256State handshakeHash; |
andrewboyson | 5:ee5489ee1117 | 19 | }; |
andrewboyson | 5:ee5489ee1117 | 20 | |
andrewboyson | 5:ee5489ee1117 | 21 | extern struct TlsConnection* TlsConnectionNew (int connectionId); //Never fails so never returns NULL |
andrewboyson | 5:ee5489ee1117 | 22 | extern struct TlsConnection* TlsConnectionOrNull(int connectionId); |
andrewboyson | 5:ee5489ee1117 | 23 | extern void TlsConnectionReset (int connectionId); |