dtls_get_message changes for state machine move Create a dtls_get_message function similar to the old dtls1_get_message but in the format required for the new state machine code. The old function will eventually be deleted in later commits. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
diff --git a/ssl/statem.c b/ssl/statem.c index 2ebe2a6..f1df6a3 100644 --- a/ssl/statem.c +++ b/ssl/statem.c
@@ -464,7 +464,14 @@ 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 */