A simple library to support serving https.

Dependents:   oldheating gps motorhome heating

tls/tls-session.h

Committer:
andrewboyson
Date:
2019-09-07
Revision:
8:5e66a6b4b38c
Parent:
6:819c17738dc2
Child:
10:e269fd7b9500

File content as of revision 8:5e66a6b4b38c:

#include <stdint.h>

#include "sha256.h"

#define TLS_SESSION_NONE    0
#define TLS_SESSION_STARTED 1
#define TLS_SESSION_VALID   2

#define TLS_KEY_SIZE_MASTER 48

struct TlsSession
{
    uint32_t            lastUsed;
    uint8_t             state;
    
    int                 slotPriKeyDecryption;
    uint8_t             masterSecret  [TLS_KEY_SIZE_MASTER];
};

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);