A simple library to support serving https.

Dependents:   oldheating gps motorhome heating

Revision:
13:0a80b49a5e78
Parent:
12:2c342345b3db
Child:
14:03a0b8fd6ddc
--- a/tls/tls-request.c	Thu Sep 26 07:19:09 2019 +0000
+++ b/tls/tls-request.c	Fri Sep 27 11:31:18 2019 +0000
@@ -177,17 +177,17 @@
         int r = -1;
         switch (handshakeType)
         {
-            case TLS_HANDSHAKE_ClientHello:
+            case TLS_HANDSHAKE_CLIENT_HELLO:
                 r = handleClientHello(handshakeLength, p, pConnection);
                 pConnection->toDo = r ? DO_SEND_ALERT_ILLEGAL_PARAMETER : DO_SEND_SERVER_HELLO;
                 break;
                 
-            case TLS_HANDSHAKE_ClientKeyExchange:
+            case TLS_HANDSHAKE_CLIENT_KEY_EXCHANGE:
                 r = handleClientKeyExchange(handshakeLength, p, pConnection);
                 pConnection->toDo = r ? DO_SEND_ALERT_ILLEGAL_PARAMETER : DO_WAIT_DECRYPT_MASTER_SECRET;
                 break;
                 
-            case TLS_HANDSHAKE_Finished:
+            case TLS_HANDSHAKE_FINISHED:
                 r = handleClientFinished(handshakeLength, p, pConnection);
                 pConnection->toDo = r ? DO_SEND_ALERT_ILLEGAL_PARAMETER :  DO_SEND_SERVER_CHANGE;
                 break;
@@ -220,14 +220,7 @@
     if (contentType < 20 || contentType > 24) return overallLen;
     if (versionH    != 3                    ) return overallLen;
     if (overallLen  > available             ) return overallLen;
-    
-    struct TlsSession* pSession = TlsSessionOrNull(pConnection->sessionId);
-    if (!pSession)
-    {
-        LogTimeF("handleContent - invalid session %u\r\n", pConnection->sessionId);
-        return overallLen;
-    }
-    
+        
     if (pConnection->clientEncrypted)
     {
         //Decrypt the message
@@ -267,7 +260,7 @@
     
     switch (contentType)
     {
-        case TLS_CONTENT_TYPE_Handshake:
+        case TLS_CONTENT_TYPE_HANDSHAKE:
             handleHandshake(length, pBuffer, pConnection);
             break;
 
@@ -279,7 +272,7 @@
             handleAlert(length, pBuffer);
             break;
 
-        case TLS_CONTENT_TYPE_Application:
+        case TLS_CONTENT_TYPE_APPLICATION:
             handleApplication(length, pBuffer, pConnection);
             pConnection->toDo = DO_APPLICATION;
             break;