Commit ed19b1a4 authored by Brian Carlstrom's avatar Brian Carlstrom
Browse files

SecureRandom should be thread safe

Random is documented to be thread safe and our implementation appears
to be. However, the SecureRandom subclass implementation was not. This
was quite reproducible with the javax.net.ssl unit tests when run on a
multicore device, but not seen on a uniprocessor.

Details:

   Actual bug fix by adding synchronized to engine* methods

	luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1PRNG_SecureRandomImpl.java

   New testSecureRandomThreadSafety based on generateSeed errors in javax.net.ssl tests.

	luni/src/test/java/tests/security/SecureRandomTest.java

   Removing dalvik.annotation.* from assorted SecureRandom tests.

	luni/src/test/java/org/apache/harmony/security/tests/java/security/SecureRandom2Test.java
	luni/src/test/java/org/apache/harmony/security/tests/java/security/SecureRandomSpiTest.java
	luni/src/test/java/tests/java/security/SecureRandomTest.java
	luni/src/test/java/tests/security/SecureRandomTest.java

Change-Id: I5e8ece4c0836b02277d7cac1b9b2f60b3c4a7755
parent a3ee3c88
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment