A simple library to support serving https.

Dependents:   oldheating gps motorhome heating

tls/tls-session.h

Committer:
andrewboyson
Date:
2019-08-28
Revision:
5:ee5489ee1117
Parent:
4:6a1d887f1cad
Child:
6:819c17738dc2

File content as of revision 5:ee5489ee1117:

#include <stdint.h>

#include "sha256.h"

#define TLS_SESSION_STATE_NONE    0
#define TLS_SESSION_STATE_STARTED 1
#define TLS_SESSION_STATE_VALID   2

struct TlsSession
{
    uint32_t            lastUsed;
    uint8_t             state;
    int                 slotPriKeyDecryption;
    uint8_t             clientRandom [32];
    uint8_t             serverRandom [32];
    uint8_t             masterSecret [48];
};

extern struct TlsSession* TlsSessionGetOldest(void); //Never fails so never returns NULL
extern struct TlsSession* TlsSessionOrNull(int sessionIndex); //Returns NULL if not found
extern int                TlsSessionGetIndex(struct TlsSession* pSession);