code review request: 6330275: Rework the PaddingTest regression test. (was Re: Fwd: jdk_security2 tests)

Stuart Marks stuart.marks at oracle.com
Fri Jul 8 06:13:25 UTC 2011


On 7/7/11 10:05 PM, Bradford Wetmore wrote:
> My only comment is in the diff section. I realize it's a FileInputStream and
> all the bytes should be obtained on a read, but I think you might want to
> consider the case of a short read for whatever reason. FileInputStream doesn't
> guarantee that all bytes will be returned, just "some". It might be better to
> read both files until EOF, then compare sizes/contents.

In this vein, it might be reasonable to consider using 
java.nio.file.Files.readAllBytes(), which takes a Path and returns a byte[]. 
Then simply call Arrays.equals() on the results.

s'marks


> Otherwise, looks fine.
>
> Brad
>
>
>
>
>
>
>
> On 6/22/2011 5:48 PM, Weijun Wang wrote:
>> http://cr.openjdk.java.net/~weijun/6330275/webrev.00/
>>
>> Thanks
>> Max
>>
>> On 06/23/2011 08:03 AM, Brad Wetmore wrote:
>>> No, feel free to take it.
>>>
>>> Brad
>>>
>>>
>>>
>>> On 6/21/2011 2:24 AM, Weijun Wang wrote:
>>>> Hi Brad
>>>>
>>>>
>>>>> # Timed out, Solaris 10 64bit sparcv9
>>>>> com/sun/crypto/provider/Cipher/DES/PaddingTest.java generic-all
>>>>>
>>>>> This test has not generated random numbers (all key material in byte[]
>>>>> constants) so there is no entropy pool issue. One special thing is that
>>>>> it calls the external diff command on two files but only prints out the
>>>>> result with no exception thrown when the files are different (6330275).
>>>>
>>>> I see you're RE for . Are you working on it now?
>>>>
>>>> Thanks
>>>> Max
>>>>



More information about the security-dev mailing list