<div dir="ltr"><div><br></div>> SSL_shutdown() never returned -1 prior to 0.9.8m version despite man page.<div><br></div><div>Ah, I didn't check that far back.<br><br>I'll take this opportunity to remind everyone who might read this that support for all versions of OpenSSL before 1.0.1 ceases at the end of this month. </div><div><br></div><div><a href="https://openssl.org/policies/releasestrat.html">https://openssl.org/policies/releasestrat.html</a></div><div><br><div><br></div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 2, 2015 at 11:39 PM, Igor Sysoev <span dir="ltr"><<a href="mailto:igor@sysoev.ru" target="_blank">igor@sysoev.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><span class="">On 03 Dec 2015, at 10:28, Judson Wilson <<a href="mailto:wilson.judson@gmail.com" target="_blank">wilson.judson@gmail.com</a>> wrote:<br></span><div><span class=""><br><blockquote type="cite"><div dir="ltr">On inspecting some code for academic reasons, I noticed that ngx_ssl_shutdown() looks like it might be using SSL_shutdown() incorrectly?<br><br>I haven't actually "used" the code, and have not tested it or seen any symptoms.<div><br></div><div><br></div><div>The first hint of a problem is the following comment:<br><br><div> /* SSL_shutdown() never returns -1, on error it returns 0 */</div></div><div><br></div><div>which does not match the OpenSSL man page very well, or the OpenSSL function ssl3_shutdown() definition.</div></div></blockquote><div><br></div></span><div>SSL_shutdown() never returned -1 prior to 0.9.8m version despite man page.</div></div><span class=""><div><br><blockquote type="cite"><div dir="ltr"><div>Second, it appears that with the way SSL_set_shutdown() is being used to stuff flags into the SSL state, SSL_shutdown() should be called until it returns 1, which may take multiple calls, even if there isn't a WANT_READ or WANT_WRITE condition upon returning -1 (or 0?). Generally one call is used to send a close_notify, which returns 0 (assuming SSL_set_shutdown hasn't stuffed in <span style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace;font-size:12px;line-height:16.8px;white-space:pre-wrap">SSL_RECEIVED_SHUTDOWN)</span>, and further calls wont return 1 until it receives close_notify.</div><div><br></div><div>Quite possibly I am missing some assumptions, which would make good comments in the code.</div><div><br></div><div>I hope this is useful.</div></div></blockquote></div><br></span><div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">Now code and the comment should be changed, thank you.</div><span class=""><font color="#888888"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><br><br>-- <br>Igor Sysoev<br><a href="http://nginx.com" target="_blank">http://nginx.com</a></div></font></span></div></div>
</div>
<br></div><br>_______________________________________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx-devel</a><br></blockquote></div><br></div></div></div></div>