[security-dev 00952]: Re: code review request 6853793: OutOfMemoryError in sun.security.provider.certpath.OCSPChecker.check

Xuelei Fan Xuelei.Fan at Sun.COM
Thu Jul 2 11:41:08 UTC 2009


Max (Weijun) Wang wrote:
>
> This code change is very trivial. But, is there any test for OCSP and 
> HTTP timestamping? I think with Michael's HttpServer class in JDK 6, 
> maybe you can see if it's easy to add one or two tests.
>
It is not hard to setup a http server, it is hard to sign a valid 
ocsp/timestamping response for we does not have similar APIs, it does 
not worthy new APIs.

As I know, there are OCSP tests, I just wrote one weeks ago, which 
connects to alive OCSP server.

Thanks for the review.

Xuelei
> Thanks
> Max
>
> On Jul 2, 2009, at 6:39 PM, Xuelei Fan wrote:
>
>> Much better! The webrev updated.
>>
>> Thanks,
>> Xuelei
>>
>> Weijun Wang wrote:
>>> I understand what the code means. It either reads contentLength 
>>> bytes of
>>> data, or, if it's -1, reads until EOF.
>>>
>>> However, I guess it would look simpler if you use only one while(read):
>>>
>>>  if (contentLength == -1) {
>>>     resp = new byte[contentLength];
>>>  } else {
>>>     resp = new byte[2048];
>>>     contentLength = Integer.MAX_VALUE;
>>>  }
>>>  while (total < contentLength) {
>>>     count = in.read(resp, total, resp.len-total)
>>>     if (count < 0) break;
>>>     total += count;
>>>     if (total almost exceeds resp len) {
>>>         resp = Arrays.copyOf(resp, resp.len*2);
>>>     }
>>>  }
>>>
>>> Also, I guess the response should be truncated back to total after the
>>> reading is complete.
>>>
>>>  response = Arrays.copyOf(response, total);
>>>
>>> Thanks
>>> Max
>>>
>>> Xuelei Fan wrote:
>>>
>>>> Hi,
>>>>
>>>> bug desc: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6853793
>>>> webrv: http://cr.openjdk.java.net/~xuelei/6853793/webrev/
>>>>
>>>> no new regression test, trivial changes, hard to write a new test.
>>>>
>>>> Thanks,
>>>> Xuelei
>>>>
>>
>




More information about the security-dev mailing list