A simple library to support serving https.

Dependents:   oldheating gps motorhome heating

Revision:
14:03a0b8fd6ddc
Parent:
10:e269fd7b9500
Child:
17:93feb2a51d58
--- a/tls/tls-connection.h	Fri Sep 27 11:31:18 2019 +0000
+++ b/tls/tls-connection.h	Wed Oct 02 20:26:04 2019 +0000
@@ -4,13 +4,14 @@
 #include "sha256.h"
 
 #define DO_WAIT_CLIENT_HELLO                0
-#define DO_SEND_SERVER_HELLO                1
-#define DO_WAIT_CLIENT_CHANGE               2
-#define DO_WAIT_DECRYPT_MASTER_SECRET       3
-#define DO_SEND_SERVER_CHANGE               4
-#define DO_APPLICATION                      5
-#define DO_SEND_ALERT_ILLEGAL_PARAMETER     6
-#define DO_SEND_ALERT_INTERNAL_ERROR        7
+#define DO_SEND_SERVER_HELLO_NEW            1
+#define DO_SEND_SERVER_HELLO_RESUME         2
+#define DO_WAIT_CLIENT_CHANGE               3
+#define DO_WAIT_DECRYPT_MASTER_SECRET       4
+#define DO_SEND_SERVER_CHANGE               5
+#define DO_APPLICATION                      6
+#define DO_SEND_ALERT_ILLEGAL_PARAMETER     7
+#define DO_SEND_ALERT_INTERNAL_ERROR        8
 
 #define TLS_RANDOM_SIZE 32
 #define TLS_VERIFY_SIZE 64
@@ -25,6 +26,7 @@
     uint32_t           lastUsed;
     int                toDo;
     uint32_t           sessionId;
+    bool               resume;
     struct Sha256State handshakeSha;
     bool               clientEncrypted;
     bool               serverEncrypted;
@@ -37,6 +39,7 @@
     uint32_t           clientPositionInStreamOffset;
     uint32_t           serverPositionInStreamOffset;
     
+    int                slotPriKeyDecryption;
     uint8_t            clientMacKey  [TLS_KEY_SIZE_MAC  ];
     uint8_t            serverMacKey  [TLS_KEY_SIZE_MAC  ];
     uint8_t            clientWriteKey[TLS_KEY_SIZE_WRITE];