1
0
Fork 0
mirror of git://git.psyced.org/git/psyced synced 2024-08-15 03:25:10 +00:00

introducing TLS requirement for IRC users

This commit is contained in:
psyc://loupsycedyglgamf.onion/~lynX 2018-07-30 19:32:12 +02:00
parent 372e704a58
commit fbc563a94e
4 changed files with 28 additions and 2 deletions

View file

@ -38,6 +38,12 @@ createUser(nick) {
return named_clone(IRC_PATH "user", nick);
}
#ifndef _flag_enable_unencrypted_users
ignorance(a) {
if (ME) next_input_to(#'ignorance);
}
#endif
parse(a) {
::parse(a);
if (ME) next_input_to(#'parse);
@ -158,15 +164,26 @@ tls_logon(a) {
logon(failure) {
if (this_interactive()) set_prompt(""); // case of failure?
next_input_to(#'parse);
#if __EFUN_DEFINED__(tls_query_connection_state)
# ifdef _flag_enable_unencrypted_users
if (tls_query_connection_state(ME) == 0) {
// DONT ::logon if this is to be done by tls_logon
::logon(failure);
}
# else
if (probably_private(ME) <= PRIVACY_SURVEILLED) {
log_file("IRCPLAIN", "[%s] %O(%O)\n", ctime(),
query_ip_number(), query_ip_name());
w("_error_mandatory_encryption", "Your connection does not satisfy our privacy requirements. Please fix your configuration.");
next_input_to(#'ignorance);
write("\n"); // why is this needed?
return 1;
}
# endif
#else
::logon(failure);
#endif
next_input_to(#'parse);
#ifdef _flag_log_sockets_IRC
log_file("RAW_IRC", "\nnew connection %O from %O\n",
ME,