Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8880#discussion_r76101343
  
    --- Diff: core/src/main/scala/org/apache/spark/SecurityManager.scala ---
    @@ -551,4 +555,20 @@ private[spark] object SecurityManager {
     
       // key used to store the spark secret in the Hadoop UGI
       val SECRET_LOOKUP_KEY = "sparkCookie"
    +
    +  /**
    +   * Setup the cryptographic key used by IO encryption in credentials. The 
key is generated using
    +   * [[KeyGenerator]]. The algorithm and key length is specified by the 
[[SparkConf]].
    +   */
    +  def initIOEncryptionKey(conf: SparkConf, credentials: Credentials): Unit 
= {
    +    if (credentials.getSecretKey(SPARK_IO_TOKEN) == null) {
    +      val keyLen = conf.get(SPARK_IO_ENCRYPTION_KEY_SIZE_BITS)
    +      val IOKeyGenAlgorithm = 
conf.get(SPARK_IO_ENCRYPTION_KEYGEN_ALGORITHM)
    +      val keyGen = KeyGenerator.getInstance(IOKeyGenAlgorithm)
    +      keyGen.init(keyLen)
    +
    +      val IOKey = keyGen.generateKey()
    --- End diff --
    
    nit: `ioKey`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to