A simple library to support serving https.
Dependents: oldheating gps motorhome heating
tls/tls-session.h@8:5e66a6b4b38c, 2019-09-07 (annotated)
- Committer:
- andrewboyson
- Date:
- Sat Sep 07 18:56:01 2019 +0000
- Revision:
- 8:5e66a6b4b38c
- Parent:
- 6:819c17738dc2
- Child:
- 10:e269fd7b9500
Got TLS working as far as being able to verify finished message itself and to verify the MAC on the finished and the subsequent alert message.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andrewboyson | 2:82268409e83f | 1 | #include <stdint.h> |
andrewboyson | 2:82268409e83f | 2 | |
andrewboyson | 4:6a1d887f1cad | 3 | #include "sha256.h" |
andrewboyson | 4:6a1d887f1cad | 4 | |
andrewboyson | 8:5e66a6b4b38c | 5 | #define TLS_SESSION_NONE 0 |
andrewboyson | 8:5e66a6b4b38c | 6 | #define TLS_SESSION_STARTED 1 |
andrewboyson | 8:5e66a6b4b38c | 7 | #define TLS_SESSION_VALID 2 |
andrewboyson | 2:82268409e83f | 8 | |
andrewboyson | 6:819c17738dc2 | 9 | #define TLS_KEY_SIZE_MASTER 48 |
andrewboyson | 6:819c17738dc2 | 10 | |
andrewboyson | 2:82268409e83f | 11 | struct TlsSession |
andrewboyson | 2:82268409e83f | 12 | { |
andrewboyson | 4:6a1d887f1cad | 13 | uint32_t lastUsed; |
andrewboyson | 4:6a1d887f1cad | 14 | uint8_t state; |
andrewboyson | 6:819c17738dc2 | 15 | |
andrewboyson | 4:6a1d887f1cad | 16 | int slotPriKeyDecryption; |
andrewboyson | 6:819c17738dc2 | 17 | uint8_t masterSecret [TLS_KEY_SIZE_MASTER]; |
andrewboyson | 2:82268409e83f | 18 | }; |
andrewboyson | 2:82268409e83f | 19 | |
andrewboyson | 6:819c17738dc2 | 20 | extern struct TlsSession* TlsSessionGetOldest(void); //Never fails so never returns NULL |
andrewboyson | 6:819c17738dc2 | 21 | extern struct TlsSession* TlsSessionOrNull (int sessionIndex); //Returns NULL if not found |
andrewboyson | 6:819c17738dc2 | 22 | extern int TlsSessionGetIndex (struct TlsSession* pSession); |