|
Squid Web Cache master
|
#include "squid.h"#include "auth/basic/RADIUS/radius-util.h"#include "auth/basic/RADIUS/radius.h"#include "base/Random.h"#include "compat/netdb.h"#include "compat/select.h"#include "compat/socket.h"#include "compat/unistd.h"#include "helper/protocol_defines.h"#include "md5.h"#include <cctype>#include <cerrno>#include <cstring>#include <ctime>Go to the source code of this file.
Macros | |
| #define | MAXPWNAM 254 |
| #define | MAXPASS 254 |
| #define | MAXLINE 254 |
Functions | |
| static void | md5_calc (uint8_t out[16], void *in, size_t len) |
| static int | timeval_diff (const struct timeval *a, const struct timeval *b) |
| static int | time_since (const struct timeval *when) |
| static int | result_recv (char *buffer, int length) |
| static void | random_vector (char *aVector) |
| static int | rad_auth_config (const char *cfname) |
| static void | urldecode (char *dst, const char *src, int size) |
| static void | authenticate (int socket_fd, const char *username, const char *passwd) |
| int | main (int argc, char **argv) |
Variables | |
| static int | i_send_buffer [2048] |
| static int | i_recv_buffer [2048] |
| static char * | send_buffer = (char *) i_send_buffer |
| static char * | recv_buffer = (char *) i_recv_buffer |
| static int | sockfd |
| static u_char | request_id |
| static char | vector [AUTH_VECTOR_LEN] |
| static char | secretkey [MAXPASS+1] = "" |
| static char | server [MAXLINE] = "" |
| static char | identifier [MAXLINE] = "" |
| static char | svc_name [MAXLINE] = "radius" |
| static int | nasport = 111 |
| static int | nasporttype = 0 |
| static uint32_t | nas_ipaddr |
| static uint32_t | auth_ipaddr |
| static int | retries = 10 |
| char | progname [] = "basic_radius_auth" |
| #define MAXLINE 254 |
Definition at line 90 of file basic_radius_auth.cc.
| #define MAXPASS 254 |
Definition at line 89 of file basic_radius_auth.cc.
| #define MAXPWNAM 254 |
Definition at line 88 of file basic_radius_auth.cc.
|
static |
Definition at line 271 of file basic_radius_auth.cc.
References AUTH_HDR_LEN, AUTH_VECTOR_LEN, pw_auth_hdr::code, pw_auth_hdr::data, i_recv_buffer, pw_auth_hdr::id, identifier, pw_auth_hdr::length, MAXPASS, MAXPWNAM, md5_calc(), nas_ipaddr, nasport, nasporttype, progname, PW_AUTHENTICATION_REQUEST, PW_NAS_ID, PW_NAS_IP_ADDRESS, PW_NAS_PORT_ID, PW_NAS_PORT_TYPE, PW_PASSWORD, PW_USER_NAME, random_vector(), recv_buffer, request_id, result_recv(), retries, secretkey, send_buffer, SEND_ERR, SEND_OK, time_since(), vector, pw_auth_hdr::vector, xrecvfrom(), xselect(), xsend(), and xstrerr().
Referenced by main(), and Auth::UserRequest::tryToAuthenticateAndSetAuthUser().
Definition at line 459 of file basic_radius_auth.cc.
References auth_ipaddr, authenticate(), debug_enabled, get_ipaddr(), getopt(), HELPER_INPUT_BUFFER, identifier, MAXPASS, MAXPWNAM, nas_ipaddr, optarg, PW_AUTH_UDP_PORT, rad_auth_config(), retries, secretkey, SEND_ERR, server, sockfd, svc_name, urldecode(), Win32SockCleanup(), xclose(), xconnect(), xgetservbyname(), xgetsockname(), xsocket(), and xstrerr().
|
static |
Definition at line 146 of file basic_radius_auth.cc.
References SquidMD5Final(), SquidMD5Init(), and SquidMD5Update().
Referenced by authenticate(), and result_recv().
|
static |
Definition at line 216 of file basic_radius_auth.cc.
References identifier, MAXLINE, retries, secretkey, server, and svc_name.
Referenced by main().
|
static |
Definition at line 199 of file basic_radius_auth.cc.
References AUTH_VECTOR_LEN, and RandomSeed32().
Referenced by authenticate().
Definition at line 158 of file basic_radius_auth.cc.
References AUTH_VECTOR_LEN, pw_auth_hdr::code, debug(), pw_auth_hdr::id, pw_auth_hdr::length, md5_calc(), PW_AUTHENTICATION_ACK, request_id, secretkey, vector, and pw_auth_hdr::vector.
Referenced by authenticate().
|
static |
Definition at line 135 of file basic_radius_auth.cc.
References timeval_diff().
Referenced by authenticate().
|
static |
Definition at line 126 of file basic_radius_auth.cc.
Referenced by time_since().
|
static |
|
static |
Definition at line 108 of file basic_radius_auth.cc.
Referenced by main().
|
static |
Definition at line 95 of file basic_radius_auth.cc.
Referenced by authenticate().
|
static |
Definition at line 94 of file basic_radius_auth.cc.
|
static |
Definition at line 103 of file basic_radius_auth.cc.
Referenced by authenticate(), main(), rad_auth_config(), and time_Inst().
|
static |
Definition at line 107 of file basic_radius_auth.cc.
Referenced by authenticate(), and main().
|
static |
Definition at line 105 of file basic_radius_auth.cc.
Referenced by authenticate().
|
static |
Definition at line 106 of file basic_radius_auth.cc.
Referenced by authenticate().
| char progname[] = "basic_radius_auth" |
Definition at line 111 of file basic_radius_auth.cc.
Referenced by authenticate(), Helper::Client::openSessions(), and statefulhelper::openSessions().
|
static |
Definition at line 97 of file basic_radius_auth.cc.
Referenced by authenticate().
|
static |
Definition at line 99 of file basic_radius_auth.cc.
Referenced by authenticate(), and result_recv().
|
static |
Definition at line 109 of file basic_radius_auth.cc.
Referenced by authenticate(), main(), Snmp::Session::pack(), rad_auth_config(), Snmp::Session::unpack(), and Ipc::UdsSender::wrote().
|
static |
Definition at line 101 of file basic_radius_auth.cc.
Referenced by authenticate(), main(), rad_auth_config(), and result_recv().
|
static |
Definition at line 96 of file basic_radius_auth.cc.
Referenced by authenticate().
|
static |
Definition at line 102 of file basic_radius_auth.cc.
Referenced by PeerSelector::addSelection(), GetAvgStat(), Ip::Qos::getTosFromServer(), Ftp::Server::handlePasvReply(), Ftp::Server::handleReply(), idnsGrokReply(), idnsShutdownAndFreeState(), idnsStats(), main(), Http::One::Server::noteTakeServerConnectionControl(), rad_auth_config(), HierarchyLogEntry::resetPeerNotes(), snmp_netDnsFn(), ssl_verify_cb(), Security::PeerConnector::sslCrtvdHandleReply(), and FwdState::syncHierNote().
|
static |
Definition at line 98 of file basic_radius_auth.cc.
Referenced by main().
|
static |
Definition at line 104 of file basic_radius_auth.cc.
Referenced by main(), and rad_auth_config().
|
static |
Definition at line 100 of file basic_radius_auth.cc.
Referenced by authenticate(), Rock::SwapDir::getOptionTree(), and result_recv().