Re: RFR 8157404: Unable to read certain PKCS12 keystores from SequenceInputStream

2019-04-01 Thread Xuelei Fan
Looks fine to me. Thanks, Xuelei On 4/1/2019 7:53 AM, Weijun Wang wrote: Webrev updated at https://cr.openjdk.java.net/~weijun/8157404/webrev.01/ On Apr 1, 2019, at 10:16 PM, Xuelei Fan wrote: On 3/30/2019 6:32 AM, Weijun Wang wrote: On Mar 27, 2019, at 11:48 PM, Xuelei Fan wrote:

Re: RFR 8157404: Unable to read certain PKCS12 keystores from SequenceInputStream

2019-04-01 Thread Weijun Wang
Webrev updated at https://cr.openjdk.java.net/~weijun/8157404/webrev.01/ > On Apr 1, 2019, at 10:16 PM, Xuelei Fan wrote: > > On 3/30/2019 6:32 AM, Weijun Wang wrote: >>> On Mar 27, 2019, at 11:48 PM, Xuelei Fan wrote: >>> >>> DerIndefLenConverter.convertStream(). >>> >>> Is it a concern

Re: RFR 8157404: Unable to read certain PKCS12 keystores from SequenceInputStream

2019-03-30 Thread Weijun Wang
> On Mar 27, 2019, at 11:48 PM, Xuelei Fan wrote: > > DerIndefLenConverter.convertStream(). > > Is it a concern that this method read too much? For example, the DER bytes of > the target object is 256 bytes, but read 1024 bytes from the input stream. > And then the next DER or other

Re: RFR 8157404: Unable to read certain PKCS12 keystores from SequenceInputStream

2019-03-27 Thread Xuelei Fan
DerIndefLenConverter.convertStream(). Is it a concern that this method read too much? For example, the DER bytes of the target object is 256 bytes, but read 1024 bytes from the input stream. And then the next DER or other object in the inputstream may not be able to properly parsed. BTW,

Re: RFR 8157404: Unable to read certain PKCS12 keystores from SequenceInputStream

2019-03-24 Thread Weijun Wang
Ping again. No new test added. Thanks, Max > On Mar 5, 2019, at 11:06 AM, Weijun Wang wrote: > > Please take a review at > > https://cr.openjdk.java.net/~weijun/8157404/webrev.00/ > > When Java finds out data is not enough while resolving a BER, it reads in > more data and try converting

RFR 8157404: Unable to read certain PKCS12 keystores from SequenceInputStream

2019-03-04 Thread Weijun Wang
Please take a review at https://cr.openjdk.java.net/~weijun/8157404/webrev.00/ When Java finds out data is not enough while resolving a BER, it reads in more data and try converting again. Please note that calling available() again after readNBytes is not reliable because it might return

Re: RFR 8157404: Unable to read certain PKCS12 keystores from SequenceInputStream

2016-08-30 Thread Weijun Wang
Yes, that's why I said it's not implemented correctly, but it has worked fine until this bug appears. --Max On 8/31/2016 9:44, Bernd Eckenfels wrote: Hello, readBytes read all bytes of a specified length. If the length is not known it is not usefull to use. Besides it is also not usefull to

Re: RFR 8157404: Unable to read certain PKCS12 keystores from SequenceInputStream

2016-08-30 Thread Bernd Eckenfels
Hello, readBytes read all bytes of a specified length. If the length is not known it is not usefull to use. Besides it is also not usefull to only read available() bytes, as the nmber of bytes read might be up to all kinds of factors (including io request and tcp segment boundaries). It is not

Re: RFR 8157404: Unable to read certain PKCS12 keystores from SequenceInputStream

2016-08-30 Thread Weijun Wang
On 8/31/2016 0:46, Svetlana Nikandrova wrote: Hi Max, thank you for your replay. Please see inline. On 30.08.2016 5:43, Weijun Wang wrote: readAllBytes() wants to real *all* data. If this is during a long time communication, and the peer sends a BER using indefinite length, and then wait

Re: RFR 8157404: Unable to read certain PKCS12 keystores from SequenceInputStream

2016-08-30 Thread Svetlana Nikandrova
Hi Max, thank you for your replay. Please see inline. On 30.08.2016 5:43, Weijun Wang wrote: readAllBytes() wants to real *all* data. If this is during a long time communication, and the peer sends a BER using indefinite length, and then wait for the next round of dialog without closing the

Re: RFR 8157404: Unable to read certain PKCS12 keystores from SequenceInputStream

2016-08-29 Thread Weijun Wang
readAllBytes() wants to real *all* data. If this is during a long time communication, and the peer sends a BER using indefinite length, and then wait for the next round of dialog without closing the stream, will readAllBytes() hang? Is it possible to create a new method readAllAvailables()

Re: RFR 8157404: Unable to read certain PKCS12 keystores from SequenceInputStream

2016-08-29 Thread Artem Smotrakov
Hi Svetlana, It looks fine, but I am not an official reviewer. "keystorePath" in readTest() can be a static field. I also meant that one test with SequenceInputStream seems to be enough, so you could just add a new test case to ReadP12Test.java. But it's fine. I am not sure how

Re: RFR 8157404: Unable to read certain PKCS12 keystores from SequenceInputStream

2016-08-26 Thread Artem Smotrakov
Hi Svetlana, DerValue class may be implicitly used in different areas (x509, SSL/TLS, keystores, maybe krb5, etc). Please make sure that tests from jdk_security pass. I'll leave the main review to someone who is more knowledgeable in this area, here are a couple of comments: - Please