<div dir="ltr">Hi Matt,<div><br></div><div>Thanks for the response. </div><div><br></div><div>But, this fix doesn't perform session resumption.  </div><div><br></div><div>Thanks,</div><div>Rajeswari.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 11, 2016 at 2:56 PM, Matt Caswell <span dir="ltr"><<a href="mailto:matt@openssl.org" target="_blank">matt@openssl.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
On 10/05/16 18:34, Rajeswari K wrote:<br>
> Hello openssl-dev team,<br>
><br>
> Having query regarding DTLS session resumption when configured SSL_CTX<br>
> with DTLS_ANY_VERSION.<br>
><br>
> When we select SSL_CTX with DTLS_ANY_VERSION, method will be of<br>
> DTLS_Server_method(), which will have ssl_ctx->version as 0xFEFD to<br>
> support both the versions (i.e. DTLS1.0 and DTLS1.2).<br>
><br>
> During handshake, we landed on to version DTLS1.0.i.e.<br>
> s->session->version holds 0xFEFF.<br>
><br>
> In order to perform session resumption, we derived new SSL structure<br>
> from global ssl_ctx using SSL_new() and tried performing ssl handshake.<br>
><br>
> With the below logic,<br>
> else {<br>
>         i = ssl_get_prev_session(s, p, j, d + n);<br>
>         /*<br>
>          * Only resume if the session's version matches the negotiated<br>
>          * version.<br>
>          * RFC 5246 does not provide much useful advice on resumption<br>
>          * with a different protocol version. It doesn't forbid it but<br>
>          * the sanity of such behaviour would be questionable.<br>
>          * In practice, clients do not accept a version mismatch and<br>
>          * will abort the handshake with an error.<br>
>          */<br>
>         if (i == 1 && s->version == s->session->ssl_version) { /* previous<br>
>                                                                 * session */<br>
>             s->hit = 1;<br>
>         } else if (i == -1)<br>
>             goto err;<br>
>         else {                  /* i == 0 */<br>
><br>
>             if (!ssl_get_new_session(s, 1))<br>
>                 goto err;<br>
>         }<br>
><br>
> Since s->version is with 0xFEFD and s->session->ssl_version is 0xFEFF,<br>
> we always try for new session and wont land on to session resumption<br>
> though client has sent the  session_id.<br>
><br>
> Is this intended behaviour? Please clarify.<br>
<br>
<br>
</div></div>No. This appears to be a bug introduced by commit 03d14f588734 in<br>
November 2014.<br>
<br>
The real problem though is that the DTLS version negotiation is<br>
happening too late - after session resumption. Interestingly this only<br>
seems to be a problem in 1.0.2. In 1.1.0 this is working correctly (the<br>
version negotiation logic has been substantially rewritten in the new<br>
version).<br>
<br>
Please could you try out the attached patch? Let me know how you get on.<br>
<br>
Thanks<br>
<span class="HOEnZb"><font color="#888888"><br>
Matt<br>
</font></span><br>--<br>
openssl-dev mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-dev" rel="noreferrer" target="_blank">https://mta.openssl.org/mailman/listinfo/openssl-dev</a><br>
<br></blockquote></div><br></div>