mirror of
https://github.com/hexchat/hexchat.git
synced 2024-11-08 12:12:39 +01:00
parent
778047bc65
commit
b8645bfbf2
@ -1929,7 +1929,24 @@ inbound_sasl_authenticate (server *serv, char *data)
|
||||
return;
|
||||
}
|
||||
|
||||
/* long SASL passwords must be split into 400-byte chunks
|
||||
https://ircv3.net/specs/extensions/sasl-3.1#the-authenticate-command */
|
||||
size_t pass_len = strlen (pass);
|
||||
if (pass_len <= 400)
|
||||
tcp_sendf (serv, "AUTHENTICATE %s\r\n", pass);
|
||||
else
|
||||
{
|
||||
size_t sent = 0;
|
||||
while (sent < pass_len)
|
||||
{
|
||||
char *pass_chunk = g_strndup (pass + sent, 400);
|
||||
tcp_sendf (serv, "AUTHENTICATE %s\r\n", pass_chunk);
|
||||
sent += 400;
|
||||
g_free (pass_chunk);
|
||||
}
|
||||
}
|
||||
if (pass_len % 400 == 0)
|
||||
tcp_sendf (serv, "AUTHENTICATE +\r\n");
|
||||
g_free (pass);
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user