src/network/nAuthentication.cpp File Reference

#include "nAuthentication.h"
#include "tMemManager.h"
#include "tToDo.h"
#include "tLocale.h"
#include "tRecorder.h"
#include "tSysTime.h"
#include "nNetwork.h"
#include "nNetObject.h"
#include "nSocket.h"
#include <memory>
#include <string>
#include <string.h>
#include <deque>

Include dependency graph for nAuthentication.cpp:

Go to the source code of this file.

Typedefs

typedef tNonMutex nMutex

Functions

static void FinishHandlePasswordRequest ()

Variables

static tString sn_AuthorityBlacklist
static tString sn_AuthorityWhitelist
tConfItemLine sn_AuthorityBlacklistConf ("AUTHORITY_BLACKLIST", sn_AuthorityBlacklist)
tConfItemLine sn_AuthorityWhitelistConf ("AUTHORITY_WHITELIST", sn_AuthorityWhitelist)
static
nAuthentication::UserPasswordCallback * 
S_UserPasswordCallback = NULL
static
nAuthentication::LoginResultCallback * 
S_LoginResultCallback = NULL
static nDescriptor nPasswordRequest (40,&nAuthentication::HandlePasswordRequest,"password_request")
static nDescriptor nPasswordAnswer (41,&nAuthentication::HandlePasswordAnswer,"password_answer")
static nKrawall::nPasswordRequest sn_request
static nKrawall::nPasswordAnswer sn_answer
static nKrawall::nSalt sn_salt
static int s_inUse = false


Typedef Documentation

typedef tNonMutex nMutex

Definition at line 58 of file nAuthentication.cpp.


Function Documentation

static void FinishHandlePasswordRequest (  )  [static]

Definition at line 99 of file nAuthentication.cpp.

References nKrawall::nPasswordAnswer::aborted, nKrawall::nPasswordAnswer::automatic, nKrawall::nScrambledPassword::Clear(), nPasswordAnswer, s_inUse, S_UserPasswordCallback, nKrawall::nPasswordAnswer::scrambled, nMessage::Send(), nKrawall::nPasswordAnswer::serverAddress, sn_GetAdr(), tNEW, nKrawall::nPasswordAnswer::username, and nKrawall::WriteScrambledPassword().

Referenced by nAuthentication::HandlePasswordRequest().

00100 {
00101     nKrawall::nScrambledPassword egg;
00102 
00103     // if the callback exists, get the scrambled password of the wanted user
00104     if (S_UserPasswordCallback)
00105         (*S_UserPasswordCallback)( sn_request, sn_answer );
00106 
00107     // scramble the salt with the server address
00108     sn_GetAdr( 0, sn_answer.serverAddress );
00109     sn_request.ScrambleSalt( sn_salt, sn_answer.serverAddress );
00110 
00111     // scramble it with the given salt
00112     sn_request.ScrambleWithSalt( nKrawall::nScrambleInfo(sn_answer.username), sn_answer.scrambled, sn_salt, egg);
00113 
00114     // destroy the original password
00115     sn_answer.scrambled.Clear();
00116 
00117     // and send it back
00118     nMessage *ret = tNEW(nMessage)(nPasswordAnswer);
00119     nKrawall::WriteScrambledPassword(egg, *ret);
00120     *ret << sn_answer.username;
00121     *ret << sn_answer.aborted;
00122     *ret << sn_answer.automatic;
00123     *ret << sn_answer.serverAddress;
00124     ret->Send(0);
00125 
00126     s_inUse = false;
00127 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

nDescriptor nPasswordAnswer(41,&nAuthentication::HandlePasswordAnswer,"password_answer") [static]

Referenced by FinishHandlePasswordRequest(), and nAuthentication::HandlePasswordRequest().

nDescriptor nPasswordRequest(40,&nAuthentication::HandlePasswordRequest,"password_request") [static]

Referenced by nAuthentication::HandlePasswordRequest().

int s_inUse = false [static]

Definition at line 96 of file nAuthentication.cpp.

Referenced by FinishHandlePasswordRequest(), and nAuthentication::HandlePasswordRequest().

nAuthentication::LoginResultCallback* S_LoginResultCallback = NULL [static]

Definition at line 73 of file nAuthentication.cpp.

nAuthentication::UserPasswordCallback* S_UserPasswordCallback = NULL [static]

Definition at line 72 of file nAuthentication.cpp.

Referenced by FinishHandlePasswordRequest().

nKrawall::nPasswordAnswer sn_answer [static]

Definition at line 94 of file nAuthentication.cpp.

tString sn_AuthorityBlacklist [static]

Definition at line 62 of file nAuthentication.cpp.

tConfItemLine sn_AuthorityBlacklistConf("AUTHORITY_BLACKLIST", sn_AuthorityBlacklist)

tString sn_AuthorityWhitelist [static]

Definition at line 62 of file nAuthentication.cpp.

tConfItemLine sn_AuthorityWhitelistConf("AUTHORITY_WHITELIST", sn_AuthorityWhitelist)

nKrawall::nPasswordRequest sn_request [static]

Definition at line 93 of file nAuthentication.cpp.

nKrawall::nSalt sn_salt [static]

Definition at line 95 of file nAuthentication.cpp.


Generated on Sat Mar 15 23:00:23 2008 for Armagetron Advanced by  doxygen 1.5.4