dtls_get_message changes for state machine move
[openssl.git] / ssl / statem.c
index 2ebe2a644badec86b6b84d4ae1a40b22cb8ba9ef..f1df6a30daebe3273aab67d3113f32ed492fe15b 100644 (file)
@@ -464,7 +464,14 @@ static enum SUB_STATE_RETURN read_state_machine(SSL *s) {
         case READ_STATE_HEADER:
             s->init_num = 0;
             /* Get the state the peer wants to move to */
-            ret = tls_get_message_header(s, &mt);
+            if (SSL_IS_DTLS(s)) {
+                /*
+                 * In DTLS we get the whole message in one go - header and body
+                 */
+                ret = dtls_get_message(s, &mt, &len);
+            } else {
+                ret = tls_get_message_header(s, &mt);
+            }
 
             if (ret == 0) {
                 /* Could be non-blocking IO */