Skip to content

Commit

Permalink
HDFS-17679 Use saslClient#hasInitialResponse() instead of heuristics …
Browse files Browse the repository at this point in the history
…in SaslParticipant#createFirstMessage() (#7201)
  • Loading branch information
stoty authored Dec 6, 2024
1 parent 2c2beb7 commit 86d8fa6
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,13 @@ private SaslParticipant(SaslClient saslClient) {
}

byte[] createFirstMessage() throws SaslException {
return SaslMechanismFactory.isDefaultMechanism(MECHANISM_ARRAY[0]) ? EMPTY_BYTE_ARRAY
: evaluateChallengeOrResponse(EMPTY_BYTE_ARRAY);
if (saslClient != null) {
return saslClient.hasInitialResponse()
? saslClient.evaluateChallenge(EMPTY_BYTE_ARRAY)
: EMPTY_BYTE_ARRAY;
}
throw new IllegalStateException(
"createFirstMessage must only be called for clients");
}

/**
Expand Down

0 comments on commit 86d8fa6

Please sign in to comment.