![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include "fcintl.h"#include "log.h"#include "shared.h"#include "support.h"#include "connection.h"#include "packets.h"#include "luascript_types.h"#include "connecthand.h"#include "notify.h"#include "srv_main.h"#include "script_fcdb.h"#include "auth.h"
Include dependency graph for auth.cpp:Go to the source code of this file.
Macros | |
| #define | GUEST_NAME "guest" |
| #define | MIN_PASSWORD_LEN 6 |
| #define | MAX_AUTH_TRIES 3 |
| #define | MAX_WAIT_TIME 300 |
Functions | |
| static bool | is_guest_name (const char *name) |
| See if the name qualifies as a guest login name. More... | |
| static void | get_unique_guest_name (char *name) |
| Return a unique guest name WARNING: do not pass pconn->username to this function: it won't return! More... | |
| static bool | is_good_password (const char *password, char *msg) |
| Verifies that a password is valid. More... | |
| bool | auth_user (struct connection *pconn, char *username) |
| Handle authentication of a user; called by handle_login_request() if authentication is enabled. More... | |
| bool | auth_handle_reply (struct connection *pconn, char *password) |
| Receives a password from a client and verifies it. More... | |
| void | auth_process_status (struct connection *pconn) |
| Checks on where in the authentication process we are. More... | |
| const char * | auth_get_username (struct connection *pconn) |
| Get username for connection. More... | |
| const char * | auth_get_ipaddr (struct connection *pconn) |
| Get connection ip address. More... | |
Variables | |
| static const int | auth_fail_wait [] = {1, 1, 2, 3} |
| const char* auth_get_ipaddr | ( | struct connection * | pconn | ) |
Get connection ip address.
Definition at line 328 of file auth.cpp.
Referenced by script_fcdb_register_functions().
| const char* auth_get_username | ( | struct connection * | pconn | ) |
Get username for connection.
Definition at line 317 of file auth.cpp.
Referenced by script_fcdb_register_functions().
| bool auth_handle_reply | ( | struct connection * | pconn, |
| char * | password | ||
| ) |
Receives a password from a client and verifies it.
Definition at line 147 of file auth.cpp.
Referenced by server_packet_input().
| void auth_process_status | ( | struct connection * | pconn | ) |
Checks on where in the authentication process we are.
Definition at line 197 of file auth.cpp.
Referenced by freeciv::server::pulse().
| bool auth_user | ( | struct connection * | pconn, |
| char * | username | ||
| ) |
Handle authentication of a user; called by handle_login_request() if authentication is enabled.
If the connection is rejected right away, return FALSE, otherwise this function will return TRUE.
Definition at line 56 of file auth.cpp.
Referenced by handle_login_request().
|
static |
Return a unique guest name WARNING: do not pass pconn->username to this function: it won't return!
Definition at line 256 of file auth.cpp.
Referenced by auth_user().
|
static |
Verifies that a password is valid.
Does some [very] rudimentary safety checks. TODO: do we want to frown on non-printing characters? Fill the msg (length MAX_LEN_MSG) with any worthwhile information that the client ought to know.
Definition at line 291 of file auth.cpp.
Referenced by auth_handle_reply().
|
static |
See if the name qualifies as a guest login name.
Definition at line 247 of file auth.cpp.
Referenced by auth_user(), and get_unique_guest_name().
|
static |
Definition at line 43 of file auth.cpp.
Referenced by auth_handle_reply().