<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<br>
<div class="moz-cite-prefix">On 06/30/2015 06:04 PM, Xuelei Fan
wrote:<br>
</div>
<blockquote cite="mid:55933C87.9040000@oracle.com" type="cite">
<pre wrap="">On 7/1/2015 6:39 AM, Jamil Nimeh wrote:
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java
==================================================================
line 713/714, 730/731 throws SSLHandshakeException for extension
constructor in server side. That's unlikely to happen, I think. I was
wondering, if CertificateStatus cannot be constructed, the server may
not want to send the message, rather than terminate the connection
immediately.
</pre>
</blockquote>
<pre wrap="">I think you're right. While the exception is unlikely, I'd like to have
the HandshakeMessage throw the exception if something bad happens. I do
however, agree that we shouldn't make it a fatal error. I'll catch the
exception in ServerHandshaker, log it, and just not send the message as
you suggested since that is legal. OK?
</pre>
</blockquote>
<pre wrap="">I have not read the server side implementation. I would like firstly
check whether the message should be delivered, and than new the
instance. Exception catching is not performance friendly, and looks a
little bit not-straightforward. I think you may want a static method
for the validity checking in CertificateStatus class, instead.</pre>
</blockquote>
As it is written today, the ServerHandshaker will only create a new
CertificateStatus instance if the following is true:<br>
<ul>
<li>Stapling has already been activated in the server (meaning
that the client requested it and the server has the feature
enabled)</li>
<li>A "get" operation was done from the StatusResponseManager and
at least one OCSP response was returned. In other words, if no
responses can be brought back from the SRM, then there's no
point in even asserting status_request[_v2] in the ServerHello.</li>
</ul>
<p>I don't see the advantage of making a static method that does
what is already accomplished in two lines of code in
ServerHandshaker (873-4).<br>
</p>
<blockquote cite="mid:55933C87.9040000@oracle.com" type="cite">
<pre wrap="">
It's OK to throw exception if something bad happens. For easy reading,
please have a comment that it is unlikely to happen if you keep the
throw exception blocks.</pre>
</blockquote>
Okay, I can definitely do that. There are some cases where I think
we need to throw an exception, particularly on the constructor from
a HandshakeInStream. That's a case where we want the client to
Alert if the server asserts some weird/unsupported/illegal type or
does something like type = ocsp and a zero length response (also
illegal according to the spec). Zero length responses are OK for
ocsp_multi, though.<br>
<br>
</body>
</html>