@@ -33,7 +33,6 @@ class InternalSecurityAccessor(conf: KyuubiConf, val isServer: Boolean) {
3333 val cryptoKeyAlgorithm = conf.get(ENGINE_SECURITY_CRYPTO_KEY_ALGORITHM )
3434 val cryptoCipher = conf.get(ENGINE_SECURITY_CRYPTO_CIPHER_TRANSFORMATION )
3535
36- private val random = new SecureRandom ()
3736 private val tokenMaxLifeTime : Long = conf.get(ENGINE_SECURITY_TOKEN_MAX_LIFETIME )
3837 private val provider : EngineSecuritySecretProvider = EngineSecuritySecretProvider .create(conf)
3938 private val (secretKeySpec, encryptor, decryptor) =
@@ -65,7 +64,7 @@ class InternalSecurityAccessor(conf: KyuubiConf, val isServer: Boolean) {
6564
6665 private [authentication] def encrypt (value : String ): String = synchronized {
6766 val nonce = new Array [Byte ](cryptoIvLength)
68- random.nextBytes(nonce)
67+ InternalSecurityAccessor . random.nextBytes(nonce)
6968 encryptor.init(Cipher .ENCRYPT_MODE , secretKeySpec, new IvParameterSpec (nonce))
7069 byteArrayToHexString(nonce ++ encryptor.doFinal(value.getBytes))
7170 }
@@ -114,6 +113,7 @@ class InternalSecurityAccessor(conf: KyuubiConf, val isServer: Boolean) {
114113
115114object InternalSecurityAccessor extends Logging {
116115 @ volatile private var _engineSecurityAccessor : InternalSecurityAccessor = _
116+ private val random : SecureRandom = new SecureRandom ()
117117
118118 def initialize (conf : KyuubiConf , isServer : Boolean ): Unit = {
119119 if (_engineSecurityAccessor == null ) {
0 commit comments