<div dir="ltr"><div>Awesome thanks :) I'll try it.<br></div>Yes I have the feeling I'm the first user of stapling with DTLS<br></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>--<br>Julien Vermillard</div></div></div></div>
<br><div class="gmail_quote">On Tue, Aug 30, 2016 at 4:26 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"><span class=""><br>
<br>
On 29/08/16 17:37, Julien Vermillard wrote:<br>
</span><span class="">> I patched s_server to send a fake OCSP content (4 bytes).<br>
> I suppose the server will just push that to the client and the client<br>
> should fail complaining it's not a correct OCSP response.<br>
> But the server crash with:<br>
> ssl/statem/statem_dtls.c:127: OpenSSL internal error: assertion failed:<br>
> s->init_num == (int)s->d1->w_msg_hdr.msg_len + DTLS1_HM_HEADER_LENGTH<br>
><br>
> Command line used:<br>
><br>
> ./openssl s_server -dtls1_2 -port 5684  -cipher<br>
> ECDHE-ECDSA-AES256-CCM8:ECDHE-<wbr>ECDSA-AES128-CCM8:PSK-AES256-<wbr>CCM8:PSK-AES128-CCM8<br>
> -CAfile ca.pem -cert server.pem -key server.key -chainCAfile bundle.pem<br>
> -status -status_verbose -mtu 1200<br>
><br>
> and<br>
> ./openssl s_client -dtls1_2 -port 5684 -psk 73656372657450534b -host<br>
> localhost -cipher<br>
> ECDHE-ECDSA-AES256-CCM8:ECDHE-<wbr>ECDSA-AES128-CCM8:PSK-AES256-<wbr>CCM8:PSK-AES128-CCM8<br>
> -CAfile ca.pem -verify_hostname "IMEI:1234567890" -cert client.pem -key<br>
> client.key -chainCAfile bundle-client.pem -status<br>
><br>
><br>
> I attached also the test certificate and keys.<br>
<br>
</span>Actually, even the unpatched s_server has this problem. AFAICT this has<br>
never worked for DTLS. I'm quite surprised no one has noticed before!<br>
Even 1.0.2 has this problem (although the symptoms are different)...and<br>
probably 1.0.1 although I haven't checked.<br>
<br>
I have a fix here:<br>
<br>
<a href="https://github.com/openssl/openssl/pull/1516" rel="noreferrer" target="_blank">https://github.com/openssl/<wbr>openssl/pull/1516</a><br>
<br>
Only the first commit with the changes to ssl/statem/statem_srvr.c are<br>
the fix itself. Everything else in the second commit is about adding a<br>
test for this.<br>
<br>
Matt<br>
<span class=""><br>
><br>
> --<br>
> Julien Vermillard<br>
><br>
> On Mon, Aug 29, 2016 at 6:17 PM, Julien Vermillard<br>
</span><span class="">> <<a href="mailto:jvermillard@gmail.com">jvermillard@gmail.com</a> <mailto:<a href="mailto:jvermillard@gmail.com">jvermillard@gmail.com</a>><wbr>> wrote:<br>
><br>
>     It's a mix of C and Go, so it's really not minimal, but I'll try to<br>
>     modify s_server to see if I can reproduce it.<br>
><br>
>     --<br>
>     Julien Vermillard<br>
><br>
>     On Mon, Aug 29, 2016 at 6:13 PM, Matt Caswell <<a href="mailto:matt@openssl.org">matt@openssl.org</a><br>
</span><span class="">>     <mailto:<a href="mailto:matt@openssl.org">matt@openssl.org</a>>> wrote:<br>
><br>
><br>
><br>
>         On 29/08/16 17:08, Julien Vermillard wrote:<br>
>         > I have a DTLS 1.2 server based on last master (commit<br>
>         > d196305aa0de1fc38837c27cb1ea6e<wbr>60af9dd98d)<br>
>         > I try to add ocsp stapling support (based on code in s_server.c).<br>
>         ><br>
>         > Basicaly in my callback I set the OCSP response by:<br>
>         ><br>
>         ><br>
>         >     if (SSL_set_tlsext_status_ocsp_<wbr>resp(s,dataPtr,respLen) == 0) {<br>
>         >         return SSL_TLSEXT_ERR_NOACK;<br>
>         >     } else {<br>
>         >         return SSL_TLSEXT_ERR_OK;<br>
>         >     }<br>
>         ><br>
>         > but if my server manage to get an OCSP response it crash with this message:<br>
>         ><br>
>         > ssl/statem/statem_dtls.c:127: OpenSSL internal error: assertion failed:<br>
>         > s->init_num == (int)s->d1->w_msg_hdr.msg_len + DTLS1_HM_HEADER_LENGTH<br>
>         ><br>
>         > Any clue?<br>
><br>
>         Do you have some minimal reproducer?<br>
><br>
>         Matt<br>
><br>
>         --<br>
>         openssl-users mailing list<br>
>         To unsubscribe:<br>
>         <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/<wbr>mailman/listinfo/openssl-users</a><br>
</span>>         <<a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/<wbr>mailman/listinfo/openssl-users</a><wbr>><br>
<div class="HOEnZb"><div class="h5">><br>
><br>
><br>
><br>
><br>
--<br>
openssl-users mailing list<br>
To unsubscribe: <a href="https://mta.openssl.org/mailman/listinfo/openssl-users" rel="noreferrer" target="_blank">https://mta.openssl.org/<wbr>mailman/listinfo/openssl-users</a><br>
</div></div></blockquote></div><br></div>