3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-10 22:19:31 +01:00
This commit is contained in:
Shivaram Lingamneni 2019-12-25 12:43:02 -05:00
parent f05c6ae6e0
commit c8ccf94936

View File

@ -469,6 +469,17 @@ func authExternalHandler(server *Server, client *Client, mechanism string, value
return false return false
} }
// EXTERNAL doesn't carry an authentication ID (this is determined from the
// certificate), but does carry an optional authorization ID.
if len(value) != 0 {
authcid := client.Account()
cfAuthzid, err := CasefoldName(string(value))
if err != nil || cfAuthzid != authcid {
rb.Add(nil, server.name, ERR_SASLFAIL, client.Nick(), client.t("SASL authentication failed: authcid and authzid should be the same"))
return false
}
}
sendSuccessfulAccountAuth(client, rb, false, true) sendSuccessfulAccountAuth(client, rb, false, true)
return false return false
} }