Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/15172#discussion_r84770349
--- Diff:
common/network-common/src/main/java/org/apache/spark/network/sasl/SaslClientBootstrap.java
---
@@ -88,7 +90,35 @@ public void doBootstrap(TransportClient client, Channel
channel) {
throw new RuntimeException(
new SaslException("Encryption requests by negotiated
non-encrypted connection."));
}
- SaslEncryption.addToChannel(channel, saslClient,
conf.maxSaslEncryptedBlockSize());
+
+ if (conf.saslEncryptionAesEnabled()) {
+ // Generate a request config message to send to server.
+ AesConfigMessage reqConfigMessage =
AesCipher.requestConfigMessage(conf);
+ ByteBuffer buf = reqConfigMessage.encodeMessage();
+
+ ByteBuffer response = client.sendRpcSync(buf,
conf.saslRTTimeoutMs());
+
+ // Decrypt the config message.
+ ByteBuffer decrypted = ByteBuffer.wrap(
+ saslClient.unwrap(response.array(), 0,
response.array().length));
+
+ AesConfigMessage configMessage =
AesConfigMessage.decodeMessage(decrypted);
+
+ // Exchange the key and IV
+ configMessage.setParameters(
--- End diff --
Why is this call necessary? Shouldn't these fields have been populated by
the `decodeMessage` call above?
---
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]