6363import org .apache .hadoop .security .token .SecretManager ;
6464import org .apache .hadoop .security .token .Token ;
6565import org .apache .hadoop .util .Lists ;
66- import org .apache .hadoop .util .StringUtils ;
6766import org .slf4j .Logger ;
6867import org .slf4j .LoggerFactory ;
6968
@@ -85,8 +84,6 @@ public class SaslDataTransferClient {
8584 private static final Logger LOG = LoggerFactory .getLogger (
8685 SaslDataTransferClient .class );
8786
88- private static final byte [] EMPTY_BYTE_ARRAY = {};
89-
9087 private final Configuration conf ;
9188 private final AtomicBoolean fallbackToSimpleAuth ;
9289 private final SaslPropertiesResolver saslPropsResolver ;
@@ -522,29 +519,25 @@ private IOStreamPair doSaslHandshake(InetAddress addr,
522519 // In which case there will be no encrypted secret sent from NN.
523520 BlockTokenIdentifier blockTokenIdentifier =
524521 accessToken .decodeIdentifier ();
525- final byte [] first = sasl .evaluateChallengeOrResponse (EMPTY_BYTE_ARRAY );
526- if (LOG .isDebugEnabled ()) {
527- LOG .info ("first: {}" , first == null ? null : first .length == 0 ? "<empty>"
528- : StringUtils .byteToHexString (first ));
529- }
530522 if (blockTokenIdentifier != null ) {
531523 byte [] handshakeSecret =
532524 accessToken .decodeIdentifier ().getHandshakeMsg ();
533525 if (handshakeSecret == null || handshakeSecret .length == 0 ) {
534526 LOG .debug ("Handshake secret is null, "
535527 + "sending without handshake secret." );
536- sendSaslMessage (out , first );
528+ sendSaslMessage (out , new byte [ 0 ] );
537529 } else {
538530 LOG .debug ("Sending handshake secret." );
539531 BlockTokenIdentifier identifier = new BlockTokenIdentifier ();
540532 identifier .readFields (new DataInputStream (
541533 new ByteArrayInputStream (accessToken .getIdentifier ())));
542534 String bpid = identifier .getBlockPoolId ();
543- sendSaslMessageHandshakeSecret (out , first , handshakeSecret , bpid );
535+ sendSaslMessageHandshakeSecret (out , new byte [0 ],
536+ handshakeSecret , bpid );
544537 }
545538 } else {
546539 LOG .debug ("Block token id is null, sending without handshake secret." );
547- sendSaslMessage (out , first );
540+ sendSaslMessage (out , new byte [ 0 ] );
548541 }
549542
550543 // step 1
@@ -572,7 +565,6 @@ private IOStreamPair doSaslHandshake(InetAddress addr,
572565 cipherOptions .add (option );
573566 }
574567 }
575- LOG .debug ("{}: cipherOptions={}" , sasl , cipherOptions );
576568 sendSaslMessageAndNegotiationCipherOptions (out , localResponse ,
577569 cipherOptions );
578570
0 commit comments