NetBurner 3.5.6
PDF Version
SslClientSession.h
1/*NB_REVISION*/
2
3/*NB_COPYRIGHT*/
4
5#ifndef _SSL_SESSION_ID_H_
6#define _SSL_SESSION_ID_H_
7
8#include <predef.h>
9#ifdef NB_SSL_SUPPORTED
10
11#include <buffers.h>
12#include <tcp.h>
13#include <netinterface.h>
14
15#include <crypto/wolfssl/ssl.h>
16#include <crypto/NetBurner/SslSocket.h>
17
18// Used for session resumption with session ID's
19class SslClientSession
20{
21 struct ticketAlloc {
22 int allocSz;
23 int ticketLen;
24 uint8_t ticket;
25 };
26
27 struct nameAlloc {
28
29 };
30 public:
31 ~SslClientSession();
32
33 inline void SetSession(IPADDR &ip, int port, WOLFSSL_SESSION *session, int ticketLen);
34 void ClearSession();
35
36
37 IPADDR m_ipAddr = IPADDR::NullIP();
38 int m_port = 0;
39 OS_CRIT m_Crit; // Critical seciton to keep wolf multithread safe
40 WOLFSSL_SESSION *m_session = nullptr;
41#ifdef HAVE_SESSION_TICKET
42 ticketAlloc *ticket;
43#endif
44};
45
46WOLFSSL_SESSION *FindSession(IPADDR &ipAddr, int port);
47bool SaveSession(IPADDR &ipAddr, int port, WOLFSSL_SESSION *session, int ticketLen);
48void ClearSession(IPADDR &ipAddr, int port);
49
50#endif /* NB_SSL_SUPPORTED */
51#endif // _SSL_SESSION_ID_H_
Used to hold and manipulate IPv4 and IPv6 addresses in dual stack mode.
Definition ipv6_addr.h:41
static IPADDR6 NullIP()
Static function to return a null IPADDR6 object.