A simple library to support serving https.

Dependents:   oldheating gps motorhome heating

tls/tls-session.h

Committer:
andrewboyson
Date:
2019-08-20
Revision:
4:6a1d887f1cad
Parent:
2:82268409e83f
Child:
5:ee5489ee1117

File content as of revision 4:6a1d887f1cad:

#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);
extern struct TlsSession* TlsSessionGetFromIndex(int sessionIndex);
extern int                TlsSessionGetIndex(struct TlsSession* pSession);