Skip to content

Commit

Permalink
HDFS-17668 Treat null SASL negotiated QOP as auth in DataTransferSasl… (
Browse files Browse the repository at this point in the history
  • Loading branch information
stoty authored Dec 3, 2024
1 parent 964e089 commit 464d7d9
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,15 @@ public static void checkSaslComplete(SaslParticipant sasl,
String negotiatedQop = sasl.getNegotiatedQop();
LOG.debug("{}: Verifying QOP: requested = {}, negotiated = {}",
sasl, requestedQop, negotiatedQop);
if (negotiatedQop != null && !requestedQop.contains(negotiatedQop)) {
// Treat null negotiated QOP as "auth" for the purpose of verification
// Code elsewhere does the same implicitly
if(negotiatedQop == null) {
negotiatedQop = "auth";
}
if (!requestedQop.contains(negotiatedQop)) {
throw new IOException(String.format("SASL handshake completed, but " +
"channel does not have acceptable quality of protection, " +
"requested = %s, negotiated = %s", requestedQop, negotiatedQop));
"requested = %s, negotiated(effective) = %s", requestedQop, negotiatedQop));
}
}

Expand Down

0 comments on commit 464d7d9

Please sign in to comment.