Freeciv-3.3
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "fcintl.h"
#include "log.h"
#include "md5.h"
#include "registry.h"
#include "shared.h"
#include "support.h"
#include "connection.h"
#include "packets.h"
#include "luascript_types.h"
#include "connecthand.h"
#include "fcdb.h"
#include "notify.h"
#include "sernet.h"
#include "srv_main.h"
#include "script_fcdb.h"
#include "auth.h"
Go to the source code of this file.
Macros | |
#define | GUEST_NAME "guest" |
#define | MIN_PASSWORD_LEN 6 /* minimum length of password */ |
#define | MIN_PASSWORD_CAPS 0 /* minimum number of capital letters required */ |
#define | MIN_PASSWORD_NUMS 0 /* minimum number of numbers required */ |
#define | MAX_AUTH_TRIES 3 |
#define | MAX_WAIT_TIME 300 /* max time we'll wait on a password */ |
Functions | |
static bool | is_guest_name (const char *name) |
static void | get_unique_guest_name (char *name) |
static bool | is_good_password (const char *password, char *msg) |
bool | auth_user (struct connection *pconn, char *username) |
bool | auth_handle_reply (struct connection *pconn, char *password) |
void | auth_process_status (struct connection *pconn) |
const char * | auth_get_username (struct connection *pconn) |
const char * | auth_get_ipaddr (struct connection *pconn) |
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 358 of file auth.c.
Referenced by api_auth_get_ipaddr().
const char * auth_get_username | ( | struct connection * | pconn | ) |
Get username for connection
Definition at line 348 of file auth.c.
Referenced by api_auth_get_username().
bool auth_handle_reply | ( | struct connection * | pconn, |
char * | password | ||
) |
Receives a password from a client and verifies it.
Definition at line 156 of file auth.c.
Referenced by server_packet_input().
void auth_process_status | ( | struct connection * | pconn | ) |
Checks on where in the authentication process we are.
Definition at line 207 of file auth.c.
Referenced by server_sniff_all_input().
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 73 of file auth.c.
Referenced by handle_login_request().
Return a unique guest name WARNING: do not pass pconn->username to this function: it won't return!
Definition at line 266 of file auth.c.
Referenced by auth_user().
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 301 of file auth.c.
Referenced by auth_handle_reply().
See if the name qualifies as a guest login name
Definition at line 257 of file auth.c.
Referenced by auth_user(), and get_unique_guest_name().
Definition at line 60 of file auth.c.
Referenced by auth_handle_reply().