|
|
|
@ -137,6 +137,7 @@ func main() {
|
|
|
|
|
flagSCRAMPinning := getopt.StringLong("scram-mech-pinning", 0, "", "Enforce the use of a certain SCRAM authentication mechanism.")
|
|
|
|
|
flagSSDPOff := getopt.BoolLong("ssdp-off", 0, "Disable XEP-0474: SASL SCRAM Downgrade Protection.")
|
|
|
|
|
flagSubject := getopt.StringLong("subject", 's', "", "Set message subject.")
|
|
|
|
|
flagFastOff := getopt.BoolLong("fast-off", 0, "Disable XEP-0484: Fast Authentication Streamlining Tokens.")
|
|
|
|
|
|
|
|
|
|
// Parse command line flags.
|
|
|
|
|
getopt.Parse()
|
|
|
|
@ -271,11 +272,13 @@ func main() {
|
|
|
|
|
fmt.Println(err)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fast, _ = getFastData(user, password)
|
|
|
|
|
// Reset FAST token and mechanism if expired.
|
|
|
|
|
if time.Now().After(fast.Expiry) {
|
|
|
|
|
fast.Token = ""
|
|
|
|
|
fast.Mechanism = ""
|
|
|
|
|
if !*flagFastOff {
|
|
|
|
|
fast, _ = getFastData(user, password)
|
|
|
|
|
// Reset FAST token and mechanism if expired.
|
|
|
|
|
if time.Now().After(fast.Expiry) {
|
|
|
|
|
fast.Token = ""
|
|
|
|
|
fast.Mechanism = ""
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Use ALPN
|
|
|
|
@ -321,6 +324,7 @@ func main() {
|
|
|
|
|
SSDP: !*flagSSDPOff,
|
|
|
|
|
UserAgentSW: resource,
|
|
|
|
|
UserAgentID: clientID,
|
|
|
|
|
Fast: !*flagFastOff,
|
|
|
|
|
FastToken: fast.Token,
|
|
|
|
|
FastMechanism: fast.Mechanism,
|
|
|
|
|
}
|
|
|
|
|