mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 17:39:53 +03:00
remove unused functions (identified by cppcheck)
[src/Cedar/Account.c:854]: (style) The function 'AddGroupTraffic' is never used. [src/Mayaqua/Secure.c:1455]: (style) The function 'AddSecObjToEnumCache' is never used. [src/Mayaqua/Network.c:18445]: (style) The function 'AddSockList' is never used. [src/Cedar/Account.c:870]: (style) The function 'AddUserTraffic' is never used. [src/Cedar/Server.c:1045]: (style) The function 'AdjoinEnumLogFile' is never used. [src/Cedar/Admin.c:13780]: (style) The function 'AdminConnect' is never used. [src/Mayaqua/Encrypt.c:855]: (style) The function 'BigNumToStr' is never used. [src/Mayaqua/Str.c:2113]: (style) The function 'Bit128ToStr' is never used. [src/Mayaqua/Encrypt.c:898]: (style) The function 'BufToBigNum' is never used. [src/Mayaqua/Internat.c:1874]: (style) The function 'CalcStrToUtf8' is never used. [src/Cedar/Hub.c:6689]: (style) The function 'CalcTrafficDiff' is never used. [src/Mayaqua/Internat.c:1819]: (style) The function 'CalcUtf8ToStr' is never used. [src/Mayaqua/Network.c:6495]: (style) The function 'CanGetTcpProcessId' is never used. [src/Cedar/WinUi.c:7226]: (style) The function 'CbInsertStrA' is never used. [src/Cedar/Client.c:3035]: (style) The function 'CcEnumObjectInSecure' is never used. [src/Cedar/Client.c:2826]: (style) The function 'CcGetCommonProxySetting' is never used. [src/Cedar/Client.c:2857]: (style) The function 'CcSetCommonProxySetting' is never used. [src/Cedar/Cedar.c:575]: (style) The function 'CedarLog' is never used. [src/Cedar/WinUi.c:9841]: (style) The function 'Center2' is never used. [src/Mayaqua/Encrypt.c:814]: (style) The function 'CertTest' is never used. [src/Mayaqua/Encrypt.c:809]: (style) The function 'CertTest2' is never used. [src/Mayaqua/Encrypt.c:819]: (style) The function 'CertTest_' is never used. [src/Mayaqua/Cfg.c:1705]: (style) The function 'CfgIsFolder' is never used.
This commit is contained in:
parent
56c4582da8
commit
79c06146a4
@ -850,38 +850,6 @@ void SetUserAuthData(USER *u, UINT authtype, void *authdata)
|
||||
Unlock(u->lock);
|
||||
}
|
||||
|
||||
// Cumulate group traffic data
|
||||
void AddGroupTraffic(USERGROUP *g, TRAFFIC *diff)
|
||||
{
|
||||
// Validate arguments
|
||||
if (g == NULL || diff == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Lock(g->lock);
|
||||
{
|
||||
AddTraffic(g->Traffic, diff);
|
||||
}
|
||||
Unlock(g->lock);
|
||||
}
|
||||
|
||||
// Cumulate user traffic data
|
||||
void AddUserTraffic(USER *u, TRAFFIC *diff)
|
||||
{
|
||||
// Validate arguments
|
||||
if (u == NULL || diff == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Lock(u->lock);
|
||||
{
|
||||
AddTraffic(u->Traffic, diff);
|
||||
}
|
||||
Unlock(u->lock);
|
||||
}
|
||||
|
||||
// Set traffic data for group
|
||||
void SetGroupTraffic(USERGROUP *g, TRAFFIC *t)
|
||||
{
|
||||
|
@ -283,8 +283,6 @@ bool AcDeleteGroup(HUB *h, char *name);
|
||||
void JoinUserToGroup(USER *u, USERGROUP *g);
|
||||
void SetUserTraffic(USER *u, TRAFFIC *t);
|
||||
void SetGroupTraffic(USERGROUP *g, TRAFFIC *t);
|
||||
void AddUserTraffic(USER *u, TRAFFIC *diff);
|
||||
void AddGroupTraffic(USERGROUP *g, TRAFFIC *diff);
|
||||
void SetUserAuthData(USER *u, UINT authtype, void *authdata);
|
||||
void *NewPasswordAuthData(char *username, char *password);
|
||||
void *NewPasswordAuthDataRaw(UCHAR *hashed_password, UCHAR *ntlm_secure_hash);
|
||||
|
@ -13770,10 +13770,6 @@ SESSION *AdminConnectMain(CEDAR *cedar, CLIENT_OPTION *o, char *hubname, void *h
|
||||
}
|
||||
|
||||
// Admin connection
|
||||
RPC *AdminConnect(CEDAR *cedar, CLIENT_OPTION *o, char *hubname, void *hashed_password, UINT *err)
|
||||
{
|
||||
return AdminConnectEx(cedar, o, hubname, hashed_password, err, NULL);
|
||||
}
|
||||
RPC *AdminConnectEx(CEDAR *cedar, CLIENT_OPTION *o, char *hubname, void *hashed_password, UINT *err, char *client_name)
|
||||
{
|
||||
return AdminConnectEx2(cedar, o, hubname, hashed_password, err, client_name, NULL);
|
||||
|
@ -1003,7 +1003,6 @@ struct RPC_AZURE_STATUS
|
||||
UINT AdminAccept(CONNECTION *c, PACK *p);
|
||||
void HashAdminPassword(void *hash, char *password);
|
||||
SESSION *AdminConnectMain(CEDAR *cedar, CLIENT_OPTION *o, char *hubname, void *hashed_password, UINT *err, char *client_name, void *hWnd, bool *empty_password);
|
||||
RPC *AdminConnect(CEDAR *cedar, CLIENT_OPTION *o, char *hubname, void *hashed_password, UINT *err);
|
||||
RPC *AdminConnectEx(CEDAR *cedar, CLIENT_OPTION *o, char *hubname, void *hashed_password, UINT *err, char *client_name);
|
||||
RPC *AdminConnectEx2(CEDAR *cedar, CLIENT_OPTION *o, char *hubname, void *hashed_password, UINT *err, char *client_name, void *hWnd);
|
||||
void AdminDisconnect(RPC *rpc);
|
||||
|
@ -571,42 +571,6 @@ void FreeNoSslList(CEDAR *c)
|
||||
c->NonSslList = NULL;
|
||||
}
|
||||
|
||||
// Write a message into Cedar log
|
||||
void CedarLog(char *str)
|
||||
{
|
||||
char *tmp;
|
||||
// Validate arguments
|
||||
if (str == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (cedar_log_ref == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
tmp = CopyStr(str);
|
||||
|
||||
if (StrLen(tmp) > 1)
|
||||
{
|
||||
if (tmp[StrLen(tmp) - 1] == '\n')
|
||||
{
|
||||
tmp[StrLen(tmp) - 1] = 0;
|
||||
}
|
||||
if (StrLen(tmp) > 1)
|
||||
{
|
||||
if (tmp[StrLen(tmp) - 1] == '\r')
|
||||
{
|
||||
tmp[StrLen(tmp) - 1] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
InsertStringRecord(cedar_log, tmp);
|
||||
|
||||
Free(tmp);
|
||||
}
|
||||
|
||||
// Start Cedar log
|
||||
void StartCedarLog()
|
||||
{
|
||||
|
@ -1234,7 +1234,6 @@ UINT64 GetTrafficPacketNum(TRAFFIC *t);
|
||||
void EnableDebugLog(CEDAR *c);
|
||||
void StartCedarLog();
|
||||
void StopCedarLog();
|
||||
void CedarLog(char *str);
|
||||
int CompareNoSslList(void *p1, void *p2);
|
||||
void InitNoSslList(CEDAR *c);
|
||||
void FreeNoSslList(CEDAR *c);
|
||||
|
@ -2821,69 +2821,6 @@ UINT CcDeleteCa(REMOTE_CLIENT *r, RPC_CLIENT_DELETE_CA *c)
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
// Get the proxy setting
|
||||
UINT CcGetCommonProxySetting(REMOTE_CLIENT *r, INTERNET_SETTING *a)
|
||||
{
|
||||
PACK *p, *ret;
|
||||
UINT err = 0;
|
||||
// Validate arguments
|
||||
if (r == NULL || a == NULL)
|
||||
{
|
||||
return ERR_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
p = NewPack();
|
||||
OutRpcInternetSetting(p, a);
|
||||
|
||||
ret = RpcCall(r->Rpc, "GetCommonProxySetting", p);
|
||||
|
||||
if (RpcIsOk(ret))
|
||||
{
|
||||
Zero(a, sizeof(INTERNET_SETTING));
|
||||
InRpcInternetSetting(a, ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
err = RpcGetError(ret);
|
||||
}
|
||||
|
||||
FreePack(ret);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
// Set the proxy setting
|
||||
UINT CcSetCommonProxySetting(REMOTE_CLIENT *r, INTERNET_SETTING *a)
|
||||
{
|
||||
PACK *p, *ret;
|
||||
UINT err = 0;
|
||||
// Validate arguments
|
||||
if (r == NULL || a == NULL)
|
||||
{
|
||||
return ERR_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
p = NewPack();
|
||||
OutRpcInternetSetting(p, a);
|
||||
|
||||
ret = RpcCall(r->Rpc, "SetCommonProxySetting", p);
|
||||
|
||||
if (RpcIsOk(ret))
|
||||
{
|
||||
Zero(a, sizeof(INTERNET_SETTING));
|
||||
InRpcInternetSetting(a, ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
err = RpcGetError(ret);
|
||||
}
|
||||
|
||||
FreePack(ret);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
// Get the issuer
|
||||
UINT CcGetIssuer(REMOTE_CLIENT *r, RPC_GET_ISSUER *a)
|
||||
{
|
||||
@ -3031,33 +2968,6 @@ UINT CcUseSecure(REMOTE_CLIENT *r, RPC_USE_SECURE *sec)
|
||||
return err;
|
||||
}
|
||||
|
||||
// Enumerate objects in the secure device
|
||||
UINT CcEnumObjectInSecure(REMOTE_CLIENT *r, RPC_ENUM_OBJECT_IN_SECURE *e)
|
||||
{
|
||||
PACK *ret;
|
||||
UINT err = 0;
|
||||
// Validate arguments
|
||||
if (r == NULL || e == NULL)
|
||||
{
|
||||
return ERR_INTERNAL_ERROR;
|
||||
}
|
||||
|
||||
ret = RpcCall(r->Rpc, "EnumObjectInSecure", NULL);
|
||||
|
||||
if (RpcIsOk(ret))
|
||||
{
|
||||
InRpcEnumObjectInSecure(e, ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
err = RpcGetError(ret);
|
||||
}
|
||||
|
||||
FreePack(ret);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
// Get a next recommended virtual LAN card name
|
||||
bool CiGetNextRecommendedVLanName(REMOTE_CLIENT *r, char *name, UINT size)
|
||||
{
|
||||
|
@ -570,7 +570,6 @@ UINT CcGetCa(REMOTE_CLIENT *r, RPC_GET_CA *get);
|
||||
UINT CcEnumSecure(REMOTE_CLIENT *r, RPC_CLIENT_ENUM_SECURE *e);
|
||||
UINT CcUseSecure(REMOTE_CLIENT *r, RPC_USE_SECURE *sec);
|
||||
UINT CcGetUseSecure(REMOTE_CLIENT *r, RPC_USE_SECURE *sec);
|
||||
UINT CcEnumObjectInSecure(REMOTE_CLIENT *r, RPC_ENUM_OBJECT_IN_SECURE *e);
|
||||
UINT CcCreateVLan(REMOTE_CLIENT *r, RPC_CLIENT_CREATE_VLAN *create);
|
||||
UINT CcUpgradeVLan(REMOTE_CLIENT *r, RPC_CLIENT_CREATE_VLAN *create);
|
||||
UINT CcGetVLan(REMOTE_CLIENT *r, RPC_CLIENT_GET_VLAN *get);
|
||||
@ -593,8 +592,6 @@ UINT CcGetAccountStatus(REMOTE_CLIENT *r, RPC_CLIENT_GET_CONNECTION_STATUS *st);
|
||||
UINT CcSetStartupAccount(REMOTE_CLIENT *r, RPC_CLIENT_DELETE_ACCOUNT *a);
|
||||
UINT CcRemoveStartupAccount(REMOTE_CLIENT *r, RPC_CLIENT_DELETE_ACCOUNT *a);
|
||||
UINT CcGetIssuer(REMOTE_CLIENT *r, RPC_GET_ISSUER *a);
|
||||
UINT CcGetCommonProxySetting(REMOTE_CLIENT *r, INTERNET_SETTING *a);
|
||||
UINT CcSetCommonProxySetting(REMOTE_CLIENT *r, INTERNET_SETTING *a);
|
||||
|
||||
|
||||
void CcSetServiceToForegroundProcess(REMOTE_CLIENT *r);
|
||||
|
@ -6686,17 +6686,6 @@ void CalcTrafficEntryDiff(TRAFFIC_ENTRY *diff, TRAFFIC_ENTRY *old, TRAFFIC_ENTRY
|
||||
diff->UnicastBytes = current->UnicastBytes - old->UnicastBytes;
|
||||
}
|
||||
}
|
||||
void CalcTrafficDiff(TRAFFIC *diff, TRAFFIC *old, TRAFFIC *current)
|
||||
{
|
||||
Zero(diff, sizeof(TRAFFIC));
|
||||
if (old == NULL || current == NULL || diff == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CalcTrafficEntryDiff(&diff->Send, &old->Send, ¤t->Send);
|
||||
CalcTrafficEntryDiff(&diff->Recv, &old->Recv, ¤t->Recv);
|
||||
}
|
||||
|
||||
// Add the traffic information for Virtual HUB
|
||||
void IncrementHubTraffic(HUB *h)
|
||||
|
@ -639,7 +639,6 @@ bool IsUserMatchInUserList(LIST *o, char *filename, UINT64 user_hash);
|
||||
bool IsUserMatchInUserListWithCacheExpires(LIST *o, char *filename, UINT64 user_hash, UINT64 lifetime);
|
||||
bool IsUserMatchInUserListWithCacheExpiresAcl(LIST *o, char *name_in_acl, UINT64 user_hash, UINT64 lifetime);
|
||||
void CalcTrafficEntryDiff(TRAFFIC_ENTRY *diff, TRAFFIC_ENTRY *old, TRAFFIC_ENTRY *current);
|
||||
void CalcTrafficDiff(TRAFFIC *diff, TRAFFIC *old, TRAFFIC *current);
|
||||
bool CheckMaxLoggedPacketsPerMinute(SESSION *s, UINT max_packets, UINT64 now);
|
||||
void VgsSetUserAgentValue(char *str);
|
||||
void VgsSetEmbTag(bool b);
|
||||
|
@ -1041,24 +1041,6 @@ void GetServerProductNameInternal(SERVER *s, char *name, UINT size)
|
||||
#endif // BETA_NUMBER
|
||||
}
|
||||
|
||||
// Adjoin the enumerations of log files
|
||||
void AdjoinEnumLogFile(LIST *o, LIST *src)
|
||||
{
|
||||
UINT i;
|
||||
// Validate arguments
|
||||
if (o == NULL || src == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0;i < LIST_NUM(src);i++)
|
||||
{
|
||||
LOG_FILE *f = LIST_DATA(src, i);
|
||||
|
||||
Insert(o, Clone(f, sizeof(LOG_FILE)));
|
||||
}
|
||||
}
|
||||
|
||||
// Check whether the log file with the specified name is contained in the enumerated list
|
||||
bool CheckLogFileNameFromEnumList(LIST *o, char *name, char *server_name)
|
||||
{
|
||||
|
@ -655,7 +655,6 @@ LIST *EnumLogFile(char *hubname);
|
||||
void EnumLogFileDir(LIST *o, char *dirname);
|
||||
void FreeEnumLogFile(LIST *o);
|
||||
bool CheckLogFileNameFromEnumList(LIST *o, char *name, char *server_name);
|
||||
void AdjoinEnumLogFile(LIST *o, LIST *src);
|
||||
void IncrementServerConfigRevision(SERVER *s);
|
||||
void GetServerProductName(SERVER *s, char *name, UINT size);
|
||||
void GetServerProductNameInternal(SERVER *s, char *name, UINT size);
|
||||
|
@ -7223,20 +7223,6 @@ UINT CbAddStr9xA(HWND hWnd, UINT id, char *str, UINT data)
|
||||
}
|
||||
|
||||
// Insert a string
|
||||
UINT CbInsertStrA(HWND hWnd, UINT id, UINT index, char *str, UINT data)
|
||||
{
|
||||
wchar_t *tmp;
|
||||
UINT ret;
|
||||
// Validate arguments
|
||||
if (hWnd == NULL || str == NULL)
|
||||
{
|
||||
return INFINITE;
|
||||
}
|
||||
tmp = CopyStrToUni(str);
|
||||
ret = CbInsertStr(hWnd, id, index, tmp, data);
|
||||
Free(tmp);
|
||||
return ret;
|
||||
}
|
||||
UINT CbInsertStr(HWND hWnd, UINT id, UINT index, wchar_t *str, UINT data)
|
||||
{
|
||||
UINT ret;
|
||||
@ -9837,49 +9823,6 @@ void Center(HWND hWnd)
|
||||
SetWindowPos(hWnd, NULL, x, y, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE);
|
||||
}
|
||||
|
||||
// Move the window to the center 2
|
||||
void Center2(HWND hWnd)
|
||||
{
|
||||
RECT screen;
|
||||
RECT win;
|
||||
UINT x, y;
|
||||
UINT win_x, win_y;
|
||||
// Validate arguments
|
||||
if (hWnd == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (SystemParametersInfo(SPI_GETWORKAREA, 0, &screen, 0) == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GetWindowRect(hWnd, &win);
|
||||
win_x = win.right - win.left;
|
||||
win_y = win.bottom - win.top;
|
||||
|
||||
if (win_x < (UINT)(screen.right - screen.left))
|
||||
{
|
||||
x = (screen.right - screen.left - win_x) / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = 0;
|
||||
}
|
||||
|
||||
if (win_y < (UINT)(screen.bottom - screen.top))
|
||||
{
|
||||
y = (screen.bottom - screen.top - win_y) / 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
y = 0;
|
||||
}
|
||||
|
||||
SetWindowPos(hWnd, NULL, x, y, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE);
|
||||
}
|
||||
|
||||
// Get the size of the monitor
|
||||
void GetMonitorSize(UINT *width, UINT *height)
|
||||
{
|
||||
|
@ -646,7 +646,6 @@ void SetTextExA(HWND hWnd, UINT id, char *str, ...);
|
||||
void FormatText(HWND hWnd, UINT id, ...);
|
||||
void FormatTextA(HWND hWnd, UINT id, ...);
|
||||
void Center(HWND hWnd);
|
||||
void Center2(HWND hWnd);
|
||||
void GetWindowClientRect(HWND hWnd, struct tagRECT *rect);
|
||||
void CenterParent(HWND hWnd);
|
||||
void GetMonitorSize(UINT *width, UINT *height);
|
||||
@ -704,7 +703,6 @@ UINT CbAddStr(HWND hWnd, UINT id, wchar_t *str, UINT data);
|
||||
UINT CbAddStrA(HWND hWnd, UINT id, char *str, UINT data);
|
||||
UINT CbAddStr9xA(HWND hWnd, UINT id, char *str, UINT data);
|
||||
UINT CbInsertStr(HWND hWnd, UINT id, UINT index, wchar_t *str, UINT data);
|
||||
UINT CbInsertStrA(HWND hWnd, UINT id, UINT index, char *str, UINT data);
|
||||
UINT CbInsertStr9xA(HWND hWnd, UINT id, UINT index, char *str, UINT data);
|
||||
void CbSelectIndex(HWND hWnd, UINT id, UINT index);
|
||||
UINT CbNum(HWND hWnd, UINT id);
|
||||
|
@ -1701,18 +1701,6 @@ bool CfgGetUniStr(FOLDER *f, char *name, wchar_t *str, UINT size)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check for the existence of a folder
|
||||
bool CfgIsFolder(FOLDER *f, char *name)
|
||||
{
|
||||
// Validate arguments
|
||||
if (f == NULL || name == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return (CfgGetFolder(f, name) == NULL) ? false : true;
|
||||
}
|
||||
|
||||
// Check for the existence of item
|
||||
bool CfgIsItem(FOLDER *f, char *name)
|
||||
{
|
||||
|
@ -210,7 +210,6 @@ BUF *CfgGetBuf(FOLDER *f, char *name);
|
||||
bool CfgGetStr(FOLDER *f, char *name, char *str, UINT size);
|
||||
bool CfgGetUniStr(FOLDER *f, char *name, wchar_t *str, UINT size);
|
||||
bool CfgIsItem(FOLDER *f, char *name);
|
||||
bool CfgIsFolder(FOLDER *f, char *name);
|
||||
void CfgTest();
|
||||
void CfgTest2(FOLDER *f, UINT n);
|
||||
char *CfgEscape(char *name);
|
||||
|
@ -805,21 +805,6 @@ UINT RsaPublicSize(K *k)
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Stupid test
|
||||
void CertTest2()
|
||||
{
|
||||
}
|
||||
|
||||
// Yagi test
|
||||
void CertTest()
|
||||
{
|
||||
}
|
||||
|
||||
// Test function related to certificate
|
||||
void CertTest_()
|
||||
{
|
||||
}
|
||||
|
||||
// Hash a pointer to a 32-bit
|
||||
UINT HashPtrToUINT(void *p)
|
||||
{
|
||||
@ -851,33 +836,6 @@ NAME *CopyName(NAME *n)
|
||||
n->Country, n->State, n->Local);
|
||||
}
|
||||
|
||||
// Convert a BIGNUM to a string
|
||||
char *BigNumToStr(BIGNUM *bn)
|
||||
{
|
||||
BIO *bio;
|
||||
BUF *b;
|
||||
char *ret;
|
||||
// Validate arguments
|
||||
if (bn == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bio = NewBio();
|
||||
|
||||
BN_print(bio, bn);
|
||||
|
||||
b = BioToBuf(bio);
|
||||
|
||||
FreeBio(bio);
|
||||
|
||||
ret = ZeroMalloc(b->Size + 1);
|
||||
Copy(ret, b->Buf, b->Size);
|
||||
FreeBuf(b);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Convert the binary to the BIGNUM
|
||||
BIGNUM *BinToBigNum(void *data, UINT size)
|
||||
{
|
||||
@ -894,17 +852,6 @@ BIGNUM *BinToBigNum(void *data, UINT size)
|
||||
return bn;
|
||||
}
|
||||
|
||||
// Convert the buffer to a BIGNUM
|
||||
BIGNUM *BufToBigNum(BUF *b)
|
||||
{
|
||||
if (b == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return BinToBigNum(b->Buf, b->Size);
|
||||
}
|
||||
|
||||
// Convert a BIGNUM to a buffer
|
||||
BUF *BigNumToBuf(const BIGNUM *bn)
|
||||
{
|
||||
|
@ -388,7 +388,6 @@ UCHAR Rand8();
|
||||
bool Rand1();
|
||||
UINT HashPtrToUINT(void *p);
|
||||
|
||||
void CertTest();
|
||||
BIO *BufToBio(BUF *b);
|
||||
BUF *BioToBuf(BIO *bio);
|
||||
BIO *NewBio();
|
||||
@ -481,8 +480,6 @@ void GetAllNameFromXEx(wchar_t *str, UINT size, X *x);
|
||||
void GetAllNameFromXExA(char *str, UINT size, X *x);
|
||||
BUF *BigNumToBuf(const BIGNUM *bn);
|
||||
BIGNUM *BinToBigNum(void *data, UINT size);
|
||||
BIGNUM *BufToBigNum(BUF *b);
|
||||
char *BigNumToStr(BIGNUM *bn);
|
||||
X_SERIAL *CloneXSerial(X_SERIAL *src);
|
||||
bool CompareXSerial(X_SERIAL *s1, X_SERIAL *s2);
|
||||
void GetXDigest(X *x, UCHAR *buf, bool sha1);
|
||||
|
@ -1815,33 +1815,6 @@ UINT Utf8ToStr(char *str, UINT str_size, BYTE *u, UINT size)
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Get the size required when UTF-8 string is converted to ANSI string
|
||||
UINT CalcUtf8ToStr(BYTE *u, UINT size)
|
||||
{
|
||||
UINT ret, uni_size;
|
||||
wchar_t *tmp;
|
||||
// Validate arguments
|
||||
if (u == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Convert to Unicode
|
||||
uni_size = CalcUtf8ToUni(u, size);
|
||||
if (uni_size == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
tmp = Malloc(uni_size);
|
||||
Utf8ToUni(tmp, uni_size, u, size);
|
||||
|
||||
// Convert to ANSI
|
||||
ret = CalcUniToStr(tmp);
|
||||
Free(tmp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Convert an ANSI string to UTF-8 string
|
||||
UINT StrToUtf8(BYTE *u, UINT size, char *str)
|
||||
{
|
||||
@ -1870,34 +1843,6 @@ UINT StrToUtf8(BYTE *u, UINT size, char *str)
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Get the required buffer size to convert an ANSI string to an UTF-8 string
|
||||
UINT CalcStrToUtf8(char *str)
|
||||
{
|
||||
UINT ret;
|
||||
UINT uni_size;
|
||||
wchar_t *tmp;
|
||||
// Validate arguments
|
||||
if (str == NULL)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Convert to Unicode
|
||||
uni_size = CalcStrToUni(str);
|
||||
if (uni_size == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
tmp = Malloc(uni_size);
|
||||
StrToUni(tmp, uni_size, str);
|
||||
|
||||
// Get the size as it was converted to UTF-8
|
||||
ret = CalcUniToUtf8(tmp);
|
||||
Free(tmp);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Convert Unicode string to ANSI string
|
||||
UINT UniToStr(char *str, UINT size, wchar_t *s)
|
||||
{
|
||||
|
@ -177,9 +177,7 @@ UINT CalcStrToUni(char *str);
|
||||
UINT StrToUni(wchar_t *s, UINT size, char *str);
|
||||
UINT CalcUniToStr(wchar_t *s);
|
||||
UINT UniToStr(char *str, UINT size, wchar_t *s);
|
||||
UINT CalcStrToUtf8(char *str);
|
||||
UINT StrToUtf8(BYTE *u, UINT size, char *str);
|
||||
UINT CalcUtf8ToStr(BYTE *u, UINT size);
|
||||
UINT Utf8ToStr(char *str, UINT str_size, BYTE *u, UINT size);
|
||||
bool IsSafeUniStr(wchar_t *str);
|
||||
bool IsSafeUniChar(wchar_t c);
|
||||
|
@ -6490,38 +6490,6 @@ L_LOOP:
|
||||
|
||||
#endif // OS_WIN32
|
||||
|
||||
|
||||
// Get whether the aquirement of the Process ID of the TCP connection succeed
|
||||
bool CanGetTcpProcessId()
|
||||
{
|
||||
UINT i;
|
||||
bool ret = false;
|
||||
LIST *o = GetTcpTableList();
|
||||
|
||||
if (o == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
for (i = 0;i < LIST_NUM(o);i++)
|
||||
{
|
||||
TCPTABLE *t = LIST_DATA(o, i);
|
||||
|
||||
if (t->ProcessId != 0)
|
||||
{
|
||||
ret = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
FreeTcpTableList(o);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#define USE_OLD_GETIP
|
||||
|
||||
// Set the arp_filter in Linux
|
||||
@ -18415,27 +18383,6 @@ void FreeNetwork()
|
||||
|
||||
}
|
||||
|
||||
// Add a socket to socket list
|
||||
void AddSockList(SOCKLIST *sl, SOCK *s)
|
||||
{
|
||||
// Validate arguments
|
||||
if (sl == NULL || s == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LockList(sl->SockList);
|
||||
{
|
||||
if (IsInList(sl->SockList, s) == false)
|
||||
{
|
||||
AddRef(s->ref);
|
||||
|
||||
Insert(sl->SockList, s);
|
||||
}
|
||||
}
|
||||
UnlockList(sl->SockList);
|
||||
}
|
||||
|
||||
// Remove the socket from socket list
|
||||
void DelSockList(SOCKLIST *sl, SOCK *s)
|
||||
{
|
||||
|
@ -1410,7 +1410,6 @@ void IntToSubnetMask4(IP *ip, UINT i);
|
||||
bool GetNetBiosName(char *name, UINT size, IP *ip);
|
||||
bool NormalizeMacAddress(char *dst, UINT size, char *src);
|
||||
SOCKLIST *NewSockList();
|
||||
void AddSockList(SOCKLIST *sl, SOCK *s);
|
||||
void DelSockList(SOCKLIST *sl, SOCK *s);
|
||||
void StopSockList(SOCKLIST *sl);
|
||||
void FreeSockList(SOCKLIST *sl);
|
||||
@ -1432,7 +1431,6 @@ void PrintTcpTableList(LIST *o);
|
||||
TCPTABLE *GetTcpTableFromEndPoint(LIST *o, IP *local_ip, UINT local_port, IP *remote_ip, UINT remote_port);
|
||||
UINT GetTcpProcessIdFromSocket(SOCK *s);
|
||||
UINT GetTcpProcessIdFromSocketReverse(SOCK *s);
|
||||
bool CanGetTcpProcessId();
|
||||
int connect_timeout(SOCKET s, struct sockaddr *addr, int size, int timeout, bool *cancel_flag);
|
||||
void EnableNetworkNameCache();
|
||||
void DisableNetworkNameCache();
|
||||
|
@ -201,7 +201,6 @@ bool ReadPack(BUF *b, PACK *p);
|
||||
ELEMENT *ReadElement(BUF *b);
|
||||
VALUE *ReadValue(BUF *b, UINT type);
|
||||
void Bit160ToStr(char *str, UCHAR *data);
|
||||
void Bit128ToStr(char *str, UCHAR *data);
|
||||
VALUE *NewInt64Value(UINT64 i);
|
||||
TOKEN_LIST *GetPackElementNames(PACK *p);
|
||||
|
||||
|
@ -1451,25 +1451,6 @@ bool WriteSecData(SECURE *sec, bool private_obj, char *name, void *data, UINT si
|
||||
return true;
|
||||
}
|
||||
|
||||
// Add the information of the newly created object to the cache
|
||||
void AddSecObjToEnumCache(SECURE *sec, char *name, UINT type, bool private_obj, UINT object)
|
||||
{
|
||||
SEC_OBJ *obj;
|
||||
// Validate arguments
|
||||
if (sec == NULL || name == NULL || sec->EnumCache == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
obj = ZeroMalloc(sizeof(SEC_OBJ));
|
||||
obj->Name = CopyStr(name);
|
||||
obj->Object = object;
|
||||
obj->Private = private_obj;
|
||||
obj->Type = type;
|
||||
|
||||
Add(sec->EnumCache, obj);
|
||||
}
|
||||
|
||||
// Display the token information
|
||||
void PrintSecInfo(SECURE *sec)
|
||||
{
|
||||
|
@ -243,7 +243,6 @@ SEC_OBJ *CloneSecObject(SEC_OBJ *obj);
|
||||
LIST *CloneEnumSecObject(LIST *o);
|
||||
void EraseEnumSecObjectCache(SECURE *sec);
|
||||
void DeleteSecObjFromEnumCache(SECURE *sec, char *name, UINT type);
|
||||
void AddSecObjToEnumCache(SECURE *sec, char *name, UINT type, bool private_obj, UINT object);
|
||||
bool WriteSecData(SECURE *sec, bool private_obj, char *name, void *data, UINT size);
|
||||
int ReadSecDataFromObject(SECURE *sec, SEC_OBJ *obj, void *data, UINT size);
|
||||
int ReadSecData(SECURE *sec, char *name, void *data, UINT size);
|
||||
|
@ -2109,21 +2109,6 @@ void Bit160ToStr(char *str, UCHAR *data)
|
||||
data[10], data[11], data[12], data[13], data[14], data[15], data[16], data[17], data[18], data[19]);
|
||||
}
|
||||
|
||||
// Make a string from a 128-bit sequence
|
||||
void Bit128ToStr(char *str, UCHAR *data)
|
||||
{
|
||||
// Validate arguments
|
||||
if (str == NULL || data == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Format(str, 0,
|
||||
"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
|
||||
data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8], data[9],
|
||||
data[10], data[11], data[12], data[13], data[14], data[15]);
|
||||
}
|
||||
|
||||
// Copy a string
|
||||
char *CopyStr(char *str)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user