A simple library to support serving https.

Dependents:   oldheating gps motorhome heating

Committer:
andrewboyson
Date:
Wed Apr 01 12:48:52 2020 +0000
Revision:
24:cb43290fc439
Parent:
14:03a0b8fd6ddc
Added check so that if the client closes the TCP connection before the TLS connection is established then respond that we have finished and the TCP connection is to be closed.

Who changed what in which revision?

UserRevisionLine numberNew 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 6:819c17738dc2 5 #define TLS_KEY_SIZE_MASTER 48
andrewboyson 6:819c17738dc2 6
andrewboyson 2:82268409e83f 7 struct TlsSession
andrewboyson 2:82268409e83f 8 {
andrewboyson 10:e269fd7b9500 9 uint32_t id;
andrewboyson 10:e269fd7b9500 10 uint32_t lastUsed;
andrewboyson 10:e269fd7b9500 11 bool valid;
andrewboyson 6:819c17738dc2 12
andrewboyson 10:e269fd7b9500 13 uint8_t masterSecret [TLS_KEY_SIZE_MASTER];
andrewboyson 2:82268409e83f 14 };
andrewboyson 2:82268409e83f 15
andrewboyson 10:e269fd7b9500 16 extern struct TlsSession* TlsSessionNew (void); //Never fails so never returns NULL
andrewboyson 10:e269fd7b9500 17 extern struct TlsSession* TlsSessionOrNull(uint32_t id); //Returns NULL if not found
andrewboyson 10:e269fd7b9500 18 extern void TlsSessionReset (uint32_t id);