Make DTLS behave like TLS when negotiating version: record layer has
DTLS 1.0, message version is 1.2.
Tolerate different version numbers if version hasn't been negotiated
yet.
* we haven't decided which version to use yet send back using
* version 1.0 header: otherwise some clients will ignore it.
*/
- if (s->state == DTLS1_ST_SW_HELLO_VERIFY_REQUEST_B
- && s->method->version == DTLS_ANY_VERSION
- && s->client_version == DTLS1_VERSION)
+ if (s->method->version == DTLS_ANY_VERSION)
{
*(p++)=DTLS1_VERSION>>8;
*(p++)=DTLS1_VERSION&0xff;
/* Hello verify request and/or server hello version may not
* match so set first packet if we're negotiating version.
*/
- if (s->method->version == DTLS_ANY_VERSION)
+ if (SSL_IS_DTLS(s))
s->first_packet = 1;
n=s->method->ssl_get_message(s,