ENT-11678: Mark Corda SecureRandom as thread safe

This avoids a mutex contention as the JDK assumes it’s not thread safe.
This commit is contained in:
Shams Asari 2024-03-20 10:49:08 +00:00
parent 4f4a6fbcf0
commit 1356cbf10e

View File

@ -15,7 +15,7 @@ import java.security.SecureRandomSpi
import kotlin.system.exitProcess import kotlin.system.exitProcess
class PlatformSecureRandomService(provider: Provider) class PlatformSecureRandomService(provider: Provider)
: Provider.Service(provider, "SecureRandom", ALGORITHM, PlatformSecureRandomSpi::class.java.name, null, null) { : Provider.Service(provider, "SecureRandom", ALGORITHM, PlatformSecureRandomSpi::class.java.name, null, mapOf("ThreadSafe" to "true")) {
companion object { companion object {
const val ALGORITHM = "CordaPRNG" const val ALGORITHM = "CordaPRNG"