1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-21 22:02:06 +01:00

[sasl] Rename getChannelBindingName() to getGs2CbindFlag()

As this returns the value of the SCRAM gs2-cbind-flag.
This commit is contained in:
Florian Schmaus 2020-07-02 13:07:17 +02:00
parent 0eeb89409a
commit 91337150e7
2 changed files with 11 additions and 5 deletions

View file

@ -1,6 +1,6 @@
/**
*
* Copyright 2014-2019 Florian Schmaus
* Copyright 2014-2020 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -227,7 +227,7 @@ public abstract class ScramMechanism extends SASLMechanism {
authzidPortion = "a=" + authorizationId;
}
String cbName = getChannelBindingName();
String cbName = getGs2CbindFlag();
assert StringUtils.isNotEmpty(cbName);
return cbName + ',' + authzidPortion + ",";
@ -244,7 +244,13 @@ public abstract class ScramMechanism extends SASLMechanism {
return ByteUtils.concat(gs2Header, cbindData);
}
protected String getChannelBindingName() {
/**
* Get the SCRAM GSS-API Channel Binding Flag value.
*
* @return the gs2-cbind-flag value.
* @see <a href="https://tools.ietf.org/html/rfc5802#section-6">RFC 5802 § 6.</a>
*/
protected String getGs2CbindFlag() {
// Check if we are using TLS and if a "-PLUS" variant of this mechanism is enabled. Assuming that the "-PLUS"
// variants always have precedence before the non-"-PLUS" variants this means that the server did not announce
// the "-PLUS" variant, as otherwise we would have tried it.

View file

@ -1,6 +1,6 @@
/**
*
* Copyright 2016-2019 Florian Schmaus
* Copyright 2016-2020 Florian Schmaus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -43,7 +43,7 @@ public abstract class ScramPlusMechanism extends ScramMechanism {
}
@Override
protected String getChannelBindingName() {
protected String getGs2CbindFlag() {
return "p=tls-server-end-point";
}