extern volatile const time_t stgTime;
+void InitEncrypt(BLOWFISH_CTX * ctx, const string & password);
+void Decrypt(BLOWFISH_CTX * ctx, char * dst, const char * src, int len8);
+void Encrypt(BLOWFISH_CTX * ctx, char * dst, const char * src, int len8);
+
//-----------------------------------------------------------------------------
class IA_CREATOR
{
: nonstop(false),
isRunningRun(false),
isRunningRunTimeouter(false),
+ users(NULL),
+ stgSettings(NULL),
+ listenSocket(-1),
WriteServLog(GetStgLogger()),
enabledDirs(0xFFffFFff),
onDelUserNotifier(*this)
STG_LOCKER lock(&mutex, __FILE__, __LINE__);
// ôÕÔ ÓÏÂÒÁÎÙ ÏÂÒÁÂÏÔÞÉËÉ ÒÁÚÎÙÈ ÐÁËÅÔÏ×
int pn = -1;
-int packetLen;
const int offset = LOGIN_LEN + 2 + 6; // LOGIN_LEN + sizeOfMagic + sizeOfVer;
IA_USER * iaUser = NULL;
pn = pi->second;
}
-packetLen = *(int*)buff;
-
if ((*user)->property.disabled.Get())
{
SendError(sip, sport, protoVer, "õÞÅÔÎÁÑ ÚÁÐÉÓØ ÚÁÂÌÏËÉÒÏ×ÁÎÁ");
return res;
}
//-----------------------------------------------------------------------------
-void AUTH_IA::InitEncrypt(BLOWFISH_CTX * ctx, const string & password)
-{
-unsigned char keyL[PASSWD_LEN]; // ðÁÒÏÌØ ÄÌÑ ÛÉÆÒÏ×ËÉ
-memset(keyL, 0, PASSWD_LEN);
-strncpy((char *)keyL, password.c_str(), PASSWD_LEN);
-Blowfish_Init(ctx, keyL, PASSWD_LEN);
-}
-//-----------------------------------------------------------------------------
-void AUTH_IA::Decrypt(BLOWFISH_CTX * ctx, char * dst, const char * src, int len8)
-{
-// len8 - ÄÌÉÎÁ × 8-ÍÉ ÂÁÊÔÏ×ÙÈ ÂÌÏËÁÈ
-
-for (int i = 0; i < len8; i++)
- DecodeString(dst + i * 8, src + i * 8, ctx);
-}
-//-----------------------------------------------------------------------------
-void AUTH_IA::Encrypt(BLOWFISH_CTX * ctx, char * dst, const char * src, int len8)
-{
-// len8 - ÄÌÉÎÁ × 8-ÍÉ ÂÁÊÔÏ×ÙÈ ÂÌÏËÁÈ
-
-for (int i = 0; i < len8; i++)
- EncodeString(dst + i * 8, src + i * 8, ctx);
-}
-//-----------------------------------------------------------------------------
int AUTH_IA::SendMessage(const STG_MSG & msg, uint32_t ip) const
{
STG_LOCKER lock(&mutex, __FILE__, __LINE__);
return true;
}
+//-----------------------------------------------------------------------------
+inline
+void InitEncrypt(BLOWFISH_CTX * ctx, const string & password)
+{
+unsigned char keyL[PASSWD_LEN]; // ðÁÒÏÌØ ÄÌÑ ÛÉÆÒÏ×ËÉ
+memset(keyL, 0, PASSWD_LEN);
+strncpy((char *)keyL, password.c_str(), PASSWD_LEN);
+Blowfish_Init(ctx, keyL, PASSWD_LEN);
+}
+//-----------------------------------------------------------------------------
+inline
+void Decrypt(BLOWFISH_CTX * ctx, char * dst, const char * src, int len8)
+{
+// len8 - ÄÌÉÎÁ × 8-ÍÉ ÂÁÊÔÏ×ÙÈ ÂÌÏËÁÈ
+
+for (int i = 0; i < len8; i++)
+ DecodeString(dst + i * 8, src + i * 8, ctx);
+}
+//-----------------------------------------------------------------------------
+inline
+void Encrypt(BLOWFISH_CTX * ctx, char * dst, const char * src, int len8)
+{
+// len8 - ÄÌÉÎÁ × 8-ÍÉ ÂÁÊÔÏ×ÙÈ ÂÌÏËÁÈ
+
+for (int i = 0; i < len8; i++)
+ EncodeString(dst + i * 8, src + i * 8, ctx);
+}