mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2026-04-20 05:49:26 +03:00
v4.23-9647-beta
This commit is contained in:
+3
-7
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -2427,7 +2427,3 @@ FOLDER *CfgCreateFolder(FOLDER *parent, char *name)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+3
-7
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -275,7 +275,3 @@ ITEM *CfgAddIp(FOLDER *f, char *name, struct IP *ip);
|
||||
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+47
-289
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -390,50 +390,14 @@ void HMacMd5(void *dst, void *key, UINT key_size, void *data, UINT data_size)
|
||||
MD5_Final(dst, &md5_ctx1);
|
||||
}
|
||||
|
||||
void HMacSha1(void *dst, void *key, UINT key_size, void *data, UINT data_size) {
|
||||
HMacSha(SHA1_160, dst, key, key_size, data, data_size);
|
||||
}
|
||||
|
||||
void HMacSha2_256(void *dst, void *key, UINT key_size, void *data, UINT data_size) {
|
||||
HMacSha(SHA2_256, dst, key, key_size, data, data_size);
|
||||
}
|
||||
|
||||
void HMacSha2_384(void *dst, void *key, UINT key_size, void *data, UINT data_size) {
|
||||
HMacSha(SHA2_384, dst, key, key_size, data, data_size);
|
||||
}
|
||||
|
||||
void HMacSha2_512(void *dst, void *key, UINT key_size, void *data, UINT data_size) {
|
||||
HMacSha(SHA2_512, dst, key, key_size, data, data_size);
|
||||
}
|
||||
|
||||
// Calculation of HMAC (SHA-1)
|
||||
void HMacSha(UINT sha_type, void *dst, void *key, UINT key_size, void *data, UINT data_size)
|
||||
void HMacSha1(void *dst, void *key, UINT key_size, void *data, UINT data_size)
|
||||
{
|
||||
UINT hmac_block_size;
|
||||
void* sha_ctx1;
|
||||
switch(sha_type) {
|
||||
case SHA1_160:
|
||||
sha_ctx1 = ZeroMalloc(sizeof(SHA_CTX));
|
||||
hmac_block_size = HMAC_BLOCK_SIZE;
|
||||
break;
|
||||
case SHA2_256:
|
||||
sha_ctx1 = ZeroMalloc(sizeof(SHA256_CTX));
|
||||
hmac_block_size = HMAC_BLOCK_SIZE;
|
||||
break;
|
||||
case SHA2_384:
|
||||
case SHA2_512:
|
||||
sha_ctx1 = ZeroMalloc(sizeof(SHA512_CTX));
|
||||
hmac_block_size = HMAC_BLOCK_SIZE_1024;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
UCHAR k[hmac_block_size];
|
||||
UCHAR hash1[hmac_block_size];
|
||||
UCHAR data2[hmac_block_size];
|
||||
//SHA_CTX sha_ctx1;
|
||||
UCHAR pad1[hmac_block_size];
|
||||
UCHAR k[HMAC_BLOCK_SIZE];
|
||||
UCHAR hash1[SHA1_SIZE];
|
||||
UCHAR data2[HMAC_BLOCK_SIZE];
|
||||
SHA_CTX sha_ctx1;
|
||||
UCHAR pad1[HMAC_BLOCK_SIZE];
|
||||
UINT i;
|
||||
// Validate arguments
|
||||
if (dst == NULL || (key == NULL && key_size != 0) || (data == NULL && data_size != 0))
|
||||
@@ -441,15 +405,14 @@ void HMacSha(UINT sha_type, void *dst, void *key, UINT key_size, void *data, UIN
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Creating a K
|
||||
if (key_size <= hmac_block_size)
|
||||
if (key_size <= HMAC_BLOCK_SIZE)
|
||||
{
|
||||
for (i = 0;i < key_size;i++)
|
||||
{
|
||||
pad1[i] = ((UCHAR *)key)[i] ^ 0x36;
|
||||
}
|
||||
for (i = key_size;i < hmac_block_size;i++)
|
||||
for (i = key_size;i < HMAC_BLOCK_SIZE;i++)
|
||||
{
|
||||
pad1[i] = 0 ^ 0x36;
|
||||
}
|
||||
@@ -459,89 +422,41 @@ void HMacSha(UINT sha_type, void *dst, void *key, UINT key_size, void *data, UIN
|
||||
Zero(k, sizeof(k));
|
||||
HashSha1(k, key, key_size);
|
||||
|
||||
for (i = 0;i < hmac_block_size;i++)
|
||||
for (i = 0;i < HMAC_BLOCK_SIZE;i++)
|
||||
{
|
||||
pad1[i] = k[i] ^ 0x36;
|
||||
}
|
||||
}
|
||||
|
||||
switch(sha_type) {
|
||||
case SHA1_160:
|
||||
SHA1_Init((SHA_CTX *)sha_ctx1);
|
||||
SHA1_Update((SHA_CTX *)sha_ctx1, pad1, sizeof(pad1));
|
||||
SHA1_Update((SHA_CTX *)sha_ctx1, data, data_size);
|
||||
SHA1_Final(hash1, (SHA_CTX *)sha_ctx1);
|
||||
break;
|
||||
case SHA2_256:
|
||||
SHA256_Init((SHA256_CTX *)sha_ctx1);
|
||||
SHA256_Update((SHA256_CTX *)sha_ctx1, pad1, sizeof(pad1));
|
||||
SHA256_Update((SHA256_CTX *)sha_ctx1, data, data_size);
|
||||
SHA256_Final(hash1, (SHA256_CTX *)sha_ctx1);
|
||||
break;
|
||||
case SHA2_384:
|
||||
SHA384_Init((SHA512_CTX *)sha_ctx1);
|
||||
SHA384_Update((SHA512_CTX *)sha_ctx1, pad1, sizeof(pad1));
|
||||
SHA384_Update((SHA512_CTX *)sha_ctx1, data, data_size);
|
||||
SHA384_Final(hash1, (SHA512_CTX *)sha_ctx1);
|
||||
break;
|
||||
case SHA2_512:
|
||||
SHA512_Init((SHA512_CTX *)sha_ctx1);
|
||||
SHA512_Update((SHA512_CTX *)sha_ctx1, pad1, sizeof(pad1));
|
||||
SHA512_Update((SHA512_CTX *)sha_ctx1, data, data_size);
|
||||
SHA512_Final(hash1, (SHA512_CTX *)sha_ctx1);
|
||||
break;
|
||||
}
|
||||
|
||||
SHA1_Init(&sha_ctx1);
|
||||
SHA1_Update(&sha_ctx1, pad1, sizeof(pad1));
|
||||
SHA1_Update(&sha_ctx1, data, data_size);
|
||||
SHA1_Final(hash1, &sha_ctx1);
|
||||
|
||||
// Generation of data 2
|
||||
if (key_size <= hmac_block_size)
|
||||
if (key_size <= HMAC_BLOCK_SIZE)
|
||||
{
|
||||
for (i = 0;i < key_size;i++)
|
||||
{
|
||||
data2[i] = ((UCHAR *)key)[i] ^ 0x5c;
|
||||
}
|
||||
for (i = key_size;i < hmac_block_size;i++)
|
||||
for (i = key_size;i < HMAC_BLOCK_SIZE;i++)
|
||||
{
|
||||
data2[i] = 0 ^ 0x5c;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0;i < hmac_block_size;i++)
|
||||
for (i = 0;i < HMAC_BLOCK_SIZE;i++)
|
||||
{
|
||||
data2[i] = k[i] ^ 0x5c;
|
||||
}
|
||||
}
|
||||
|
||||
switch(sha_type) {
|
||||
case SHA1_160:
|
||||
SHA1_Init((SHA_CTX *)sha_ctx1);
|
||||
SHA1_Update((SHA_CTX *)sha_ctx1, data2, hmac_block_size);
|
||||
SHA1_Update((SHA_CTX *)sha_ctx1, hash1, SHA1_SIZE);
|
||||
SHA1_Final(dst, (SHA_CTX *)sha_ctx1);
|
||||
break;
|
||||
case SHA2_256:
|
||||
SHA256_Init((SHA256_CTX *)sha_ctx1);
|
||||
SHA256_Update((SHA256_CTX *)sha_ctx1, data2, hmac_block_size);
|
||||
SHA256_Update((SHA256_CTX *)sha_ctx1, hash1, SHA256_SIZE);
|
||||
SHA256_Final(dst, (SHA256_CTX *)sha_ctx1);
|
||||
break;
|
||||
case SHA2_384:
|
||||
SHA384_Init((SHA512_CTX *)sha_ctx1);
|
||||
SHA384_Update((SHA512_CTX *)sha_ctx1, data2, hmac_block_size);
|
||||
SHA384_Update((SHA512_CTX *)sha_ctx1, hash1, SHA384_SIZE);
|
||||
SHA384_Final(dst, (SHA512_CTX *)sha_ctx1);
|
||||
break;
|
||||
|
||||
case SHA2_512:
|
||||
SHA512_Init((SHA512_CTX *)sha_ctx1);
|
||||
SHA512_Update((SHA512_CTX *)sha_ctx1, data2, hmac_block_size);
|
||||
SHA512_Update((SHA512_CTX *)sha_ctx1, hash1, SHA512_SIZE);
|
||||
SHA512_Final(dst, (SHA512_CTX *)sha_ctx1);
|
||||
break;
|
||||
}
|
||||
Free(sha_ctx1);
|
||||
|
||||
SHA1_Init(&sha_ctx1);
|
||||
SHA1_Update(&sha_ctx1, data2, HMAC_BLOCK_SIZE);
|
||||
SHA1_Update(&sha_ctx1, hash1, SHA1_SIZE);
|
||||
SHA1_Final(dst, &sha_ctx1);
|
||||
}
|
||||
|
||||
// Calculate the HMAC
|
||||
@@ -570,7 +485,7 @@ void SetMdKey(MD *md, void *key, UINT key_size)
|
||||
return;
|
||||
}
|
||||
|
||||
HMAC_Init_ex(md->Ctx, key, key_size, md->Md, NULL);
|
||||
HMAC_Init_ex(md->Ctx, key, key_size, (const EVP_MD *)md->Md, NULL);
|
||||
}
|
||||
|
||||
// Creating a message digest object
|
||||
@@ -586,7 +501,7 @@ MD *NewMd(char *name)
|
||||
m = ZeroMalloc(sizeof(MD));
|
||||
|
||||
StrCpy(m->Name, sizeof(m->Name), name);
|
||||
m->Md = EVP_get_digestbyname(name);
|
||||
m->Md = (const struct evp_md_st *)EVP_get_digestbyname(name);
|
||||
if (m->Md == NULL)
|
||||
{
|
||||
FreeMd(m);
|
||||
@@ -600,7 +515,7 @@ MD *NewMd(char *name)
|
||||
HMAC_CTX_init(m->Ctx);
|
||||
#endif
|
||||
|
||||
m->Size = EVP_MD_size(m->Md);
|
||||
m->Size = EVP_MD_size((const EVP_MD *)m->Md);
|
||||
|
||||
return m;
|
||||
}
|
||||
@@ -749,175 +664,6 @@ void FreeCipher(CIPHER *c)
|
||||
Free(c);
|
||||
}
|
||||
|
||||
// Verify whether the certificate is disabled by CRL in a particular directory
|
||||
bool IsXRevoked(X *x)
|
||||
{
|
||||
char dirname[MAX_PATH];
|
||||
UINT i;
|
||||
bool ret = false;
|
||||
DIRLIST *t;
|
||||
// Validate arguments
|
||||
if (x == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
GetExeDir(dirname, sizeof(dirname));
|
||||
|
||||
// Search the CRL file
|
||||
t = EnumDir(dirname);
|
||||
|
||||
for (i = 0;i < t->NumFiles;i++)
|
||||
{
|
||||
char *name = t->File[i]->FileName;
|
||||
if (t->File[i]->Folder == false)
|
||||
{
|
||||
if (EndWith(name, ".crl"))
|
||||
{
|
||||
char filename[MAX_PATH];
|
||||
X_CRL *r;
|
||||
|
||||
ConbinePath(filename, sizeof(filename), dirname, name);
|
||||
|
||||
r = FileToXCrl(filename);
|
||||
|
||||
if (r != NULL)
|
||||
{
|
||||
if (IsXRevokedByXCrl(x, r))
|
||||
{
|
||||
ret = true;
|
||||
}
|
||||
|
||||
FreeXCrl(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FreeDir(t);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Verify whether the certificate is disabled by the CRL
|
||||
bool IsXRevokedByXCrl(X *x, X_CRL *r)
|
||||
{
|
||||
#ifdef OS_WIN32
|
||||
X509_REVOKED tmp;
|
||||
X509_CRL_INFO *info;
|
||||
int index;
|
||||
// Validate arguments
|
||||
if (x == NULL || r == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Zero(&tmp, sizeof(tmp));
|
||||
tmp.serialNumber = X509_get_serialNumber(x->x509);
|
||||
|
||||
info = r->Crl->crl;
|
||||
|
||||
if (sk_X509_REVOKED_is_sorted(info->revoked) == false)
|
||||
{
|
||||
sk_X509_REVOKED_sort(info->revoked);
|
||||
}
|
||||
|
||||
index = sk_X509_REVOKED_find(info->revoked, &tmp);
|
||||
|
||||
if (index < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
#else // OS_WIN32
|
||||
return false;
|
||||
#endif // OS_WIN32
|
||||
}
|
||||
|
||||
// Release of the CRL
|
||||
void FreeXCrl(X_CRL *r)
|
||||
{
|
||||
// Validate arguments
|
||||
if (r == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
X509_CRL_free(r->Crl);
|
||||
|
||||
Free(r);
|
||||
}
|
||||
|
||||
// Convert a file to a CRL
|
||||
X_CRL *FileToXCrl(char *filename)
|
||||
{
|
||||
wchar_t *filename_w = CopyStrToUni(filename);
|
||||
X_CRL *ret = FileToXCrlW(filename_w);
|
||||
|
||||
Free(filename_w);
|
||||
|
||||
return ret;
|
||||
}
|
||||
X_CRL *FileToXCrlW(wchar_t *filename)
|
||||
{
|
||||
BUF *b;
|
||||
X_CRL *r;
|
||||
// Validate arguments
|
||||
if (filename == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
b = ReadDumpW(filename);
|
||||
if (b == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
r = BufToXCrl(b);
|
||||
|
||||
FreeBuf(b);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
// Convert the buffer to the CRL
|
||||
X_CRL *BufToXCrl(BUF *b)
|
||||
{
|
||||
X_CRL *r;
|
||||
X509_CRL *x509crl;
|
||||
BIO *bio;
|
||||
// Validate arguments
|
||||
if (b == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bio = BufToBio(b);
|
||||
if (bio == NULL)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
x509crl = NULL;
|
||||
|
||||
if (d2i_X509_CRL_bio(bio, &x509crl) == NULL || x509crl == NULL)
|
||||
{
|
||||
FreeBio(bio);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
r = ZeroMalloc(sizeof(X_CRL));
|
||||
r->Crl = x509crl;
|
||||
|
||||
FreeBio(bio);
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
// Convert the buffer to the public key
|
||||
K *RsaBinToPublic(void *data, UINT size)
|
||||
{
|
||||
@@ -2535,8 +2281,8 @@ void LoadXDates(X *x)
|
||||
return;
|
||||
}
|
||||
|
||||
x->notBefore = Asn1TimeToUINT64(X509_get0_notBefore(x->x509));
|
||||
x->notAfter = Asn1TimeToUINT64(X509_get0_notAfter(x->x509));
|
||||
x->notBefore = Asn1TimeToUINT64((ASN1_TIME *)X509_get0_notBefore(x->x509));
|
||||
x->notAfter = Asn1TimeToUINT64((ASN1_TIME *)X509_get0_notAfter(x->x509));
|
||||
}
|
||||
|
||||
// Convert the 64bit system time to ASN1 time
|
||||
@@ -4165,9 +3911,13 @@ X *X509ToX(X509 *x509)
|
||||
x->is_compatible_bit = true;
|
||||
|
||||
if(x->bits != 1024 && x->bits != 1536 && x->bits != 2048 && x->bits != 3072 && x->bits != 4096)
|
||||
{
|
||||
x->is_compatible_bit = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
x->is_compatible_bit = true;
|
||||
}
|
||||
|
||||
/*switch (size)
|
||||
{
|
||||
@@ -4231,7 +3981,7 @@ BUF *BioToBuf(BIO *bio)
|
||||
}
|
||||
|
||||
BIO_seek(bio, 0);
|
||||
size = BIO_number_written(bio);
|
||||
size = (UINT)BIO_number_written(bio);
|
||||
tmp = Malloc(size);
|
||||
BIO_read(bio, tmp, size);
|
||||
|
||||
@@ -4534,7 +4284,20 @@ void Sha(UINT sha_type, void *dst, void *src, UINT size)
|
||||
|
||||
}
|
||||
|
||||
void Sha1(void *dst, void *src, UINT size) {
|
||||
|
||||
// SHA-1 hash
|
||||
void Sha1(void *dst, void *src, UINT size)
|
||||
{
|
||||
// Validate arguments
|
||||
if (dst == NULL || src == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
SHA1(src, size, dst);
|
||||
}
|
||||
|
||||
void Sha1__(void *dst, void *src, UINT size) {
|
||||
Sha(SHA1_160, dst, src, size);
|
||||
}
|
||||
|
||||
@@ -5545,8 +5308,3 @@ static unsigned char *Internal_SHA0(const unsigned char *d, size_t n, unsigned c
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+4
-18
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -151,6 +151,7 @@ void RAND_Free_For_SoftEther();
|
||||
#define HMAC_BLOCK_SIZE 64
|
||||
// The block size for sha-384 and sha-512 as defined by rfc4868
|
||||
#define HMAC_BLOCK_SIZE_1024 128
|
||||
#define HMAC_BLOCK_SIZE_MAX 512
|
||||
|
||||
#define DH_GROUP1_PRIME_768 \
|
||||
"FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1" \
|
||||
@@ -505,13 +506,6 @@ void RsaPublicToBin(K *k, void *data);
|
||||
BUF *RsaPublicToBuf(K *k);
|
||||
K *RsaBinToPublic(void *data, UINT size);
|
||||
|
||||
X_CRL *FileToXCrl(char *filename);
|
||||
X_CRL *FileToXCrlW(wchar_t *filename);
|
||||
X_CRL *BufToXCrl(BUF *b);
|
||||
void FreeXCrl(X_CRL *r);
|
||||
bool IsXRevokedByXCrl(X *x, X_CRL *r);
|
||||
bool IsXRevoked(X *x);
|
||||
|
||||
DES_KEY_VALUE *DesNewKeyValue(void *value);
|
||||
DES_KEY_VALUE *DesRandKeyValue();
|
||||
void DesFreeKeyValue(DES_KEY_VALUE *v);
|
||||
@@ -581,11 +575,7 @@ void MdProcess(MD *md, void *dest, void *src, UINT size);
|
||||
void Enc_tls1_PRF(unsigned char *label, int label_len, const unsigned char *sec,
|
||||
int slen, unsigned char *out1, int olen);
|
||||
|
||||
void HMacSha(UINT sha_type, void *dst, void *key, UINT key_size, void *data, UINT data_size);
|
||||
void HMacSha1(void *dst, void *key, UINT key_size, void *data, UINT data_size);
|
||||
void HMacSha2_256(void *dst, void *key, UINT key_size, void *data, UINT data_size);
|
||||
void HMacSha2_384(void *dst, void *key, UINT key_size, void *data, UINT data_size);
|
||||
void HMacSha2_512(void *dst, void *key, UINT key_size, void *data, UINT data_size);
|
||||
void HMacMd5(void *dst, void *key, UINT key_size, void *data, UINT data_size);
|
||||
|
||||
BUF *EasyEncrypt(BUF *src_buf);
|
||||
@@ -601,7 +591,3 @@ void DisableIntelAesAccel();
|
||||
|
||||
#endif // ENCRYPT_H
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -2949,7 +2949,3 @@ IO *FileOpenExW(wchar_t *name, bool write_mode, bool read_lock)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -388,7 +388,3 @@ bool IsInLinesFile(wchar_t *filename, char *str, bool instr);
|
||||
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -3584,7 +3584,3 @@ UINT UniStrLen(wchar_t *str)
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -252,7 +252,3 @@ int IconvFreeInternal(void *d);
|
||||
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+62
-7
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -161,6 +161,7 @@ static int ydays[] =
|
||||
};
|
||||
|
||||
static UINT current_num_thread = 0;
|
||||
static UINT cached_number_of_cpus = 0;
|
||||
|
||||
|
||||
|
||||
@@ -336,6 +337,43 @@ UINT64 TickGetRealtimeTickValue64()
|
||||
|
||||
#endif // OS_WIN32
|
||||
|
||||
// Get the number of CPUs
|
||||
UINT GetNumberOfCpu()
|
||||
{
|
||||
UINT ret = 0;
|
||||
|
||||
if (cached_number_of_cpus == 0)
|
||||
{
|
||||
UINT i = 0;
|
||||
|
||||
#ifdef OS_WIN32
|
||||
i = Win32GetNumberOfCpuInner();
|
||||
#else // OS_WIN32
|
||||
i = UnixGetNumberOfCpuInner();
|
||||
#endif // OS_WIN32
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
i = 8;
|
||||
}
|
||||
|
||||
cached_number_of_cpus = i;
|
||||
}
|
||||
|
||||
ret = cached_number_of_cpus;
|
||||
|
||||
if (ret == 0)
|
||||
{
|
||||
ret = 1;
|
||||
}
|
||||
if (ret > 128)
|
||||
{
|
||||
ret = 128;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Creating a thread list
|
||||
LIST *NewThreadList()
|
||||
{
|
||||
@@ -1593,6 +1631,27 @@ void GetDateTimeStrMilli(char *str, UINT size, SYSTEMTIME *st)
|
||||
st->wMilliseconds);
|
||||
}
|
||||
|
||||
// Get the date and time string in RFC3164 format (example: 2017-09-27T18:25:55.434-9:00)
|
||||
void GetDateTimeStrRFC3164(char *str, UINT size, SYSTEMTIME *st, int timezone_min){
|
||||
// Validate arguments
|
||||
if (str == NULL || st == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(timezone_min == 0){
|
||||
Format(str, size, "%04u-%02u-%02uT%02u:%02u:%02u.%03uZ",
|
||||
st->wYear, st->wMonth, st->wDay,
|
||||
st->wHour, st->wMinute, st->wSecond,
|
||||
st->wMilliseconds);
|
||||
}else{
|
||||
Format(str, size, "%04u-%02u-%02uT%02u:%02u:%02u.%03u%+02d:%02d",
|
||||
st->wYear, st->wMonth, st->wDay,
|
||||
st->wHour, st->wMinute, st->wSecond,
|
||||
st->wMilliseconds, timezone_min/60, timezone_min%60);
|
||||
}
|
||||
}
|
||||
|
||||
// Get the time string
|
||||
void GetSpanStr(char *str, UINT size, UINT64 sec64)
|
||||
{
|
||||
@@ -2274,7 +2333,3 @@ void AbortExitEx(char *msg)
|
||||
#endif // OS_WIN32
|
||||
}
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -248,6 +248,7 @@ void GetTimeStrEx64(wchar_t *str, UINT size, UINT64 sec64, LOCALE *locale);
|
||||
void GetDateStrEx64(wchar_t *str, UINT size, UINT64 sec64, LOCALE *locale);
|
||||
void GetTimeStrMilli64(char *str, UINT size, UINT64 sec64);
|
||||
void GetTimeStr64(char *str, UINT size, UINT64 sec64);
|
||||
void GetDateTimeStrRFC3164(char *str, UINT size, SYSTEMTIME *st, int timezone_min);
|
||||
UINT64 SafeTime64(UINT64 sec64);
|
||||
bool Run(char *filename, char *arg, bool hide, bool wait);
|
||||
bool RunW(wchar_t *filename, wchar_t *arg, bool hide, bool wait);
|
||||
@@ -277,10 +278,7 @@ void MainteThreadList(LIST *o);
|
||||
void FreeThreadList(LIST *o);
|
||||
void StopThreadList(LIST *o);
|
||||
void WaitAllThreadsWillBeStopped(LIST *o);
|
||||
UINT GetNumberOfCpu();
|
||||
|
||||
#endif // KERNEL_H
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -588,7 +588,3 @@ typedef struct IKE_HEADER IKE_HEADER;
|
||||
|
||||
#endif // MAYATYPE_H
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -1224,7 +1224,3 @@ void PrintDebugInformation()
|
||||
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -614,6 +614,7 @@ USHORT CalcChecksum16(void *buf, UINT size);
|
||||
#pragma comment(lib, "version.lib")
|
||||
#pragma comment(lib, "Netapi32.lib")
|
||||
#pragma comment(lib, "shlwapi.lib")
|
||||
#pragma comment(lib, "crypt32.lib")
|
||||
#pragma warning( disable : 4099 )
|
||||
#endif // OS_WIN32
|
||||
|
||||
@@ -626,7 +627,3 @@ USHORT CalcChecksum16(void *buf, UINT size);
|
||||
#endif // MAYAQUA_H
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -4427,7 +4427,3 @@ void XorData(void *dst, void *src1, void *src2, UINT size)
|
||||
c2++;
|
||||
}
|
||||
}
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -479,7 +479,3 @@ void AppendBufStr(BUF *b, char *str);
|
||||
|
||||
#endif // MEMORY_H
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -15540,7 +15540,3 @@ wchar_t *MsGetWinTempDirW()
|
||||
|
||||
#endif // WIN32
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -1217,7 +1217,3 @@ void MsSuspendHandlerThreadProc(THREAD *thread, void *param);
|
||||
|
||||
#endif // OS_WIN32
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+17
-17
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -233,7 +233,12 @@ static COUNTER *getip_thread_counter = NULL;
|
||||
static UINT max_getip_thread = 0;
|
||||
|
||||
|
||||
static char *cipher_list = "RC4-MD5 RC4-SHA AES128-SHA AES256-SHA DES-CBC-SHA DES-CBC3-SHA DHE-RSA-AES128-SHA DHE-RSA-AES256-SHA AES128-GCM-SHA256 AES128-SHA256 AES256-GCM-SHA384 AES256-SHA256 DHE-RSA-AES128-GCM-SHA256 DHE-RSA-AES128-SHA256 DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA256 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-RSA-AES128-SHA256 ECDHE-RSA-AES256-GCM-SHA384 ECDHE-RSA-AES256-SHA384";
|
||||
static char *cipher_list = "RC4-MD5 RC4-SHA AES128-SHA AES256-SHA DES-CBC-SHA DES-CBC3-SHA DHE-RSA-AES128-SHA DHE-RSA-AES256-SHA AES128-GCM-SHA256 AES128-SHA256 AES256-GCM-SHA384 AES256-SHA256 DHE-RSA-AES128-GCM-SHA256 DHE-RSA-AES128-SHA256 DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA256 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-RSA-AES128-SHA256 ECDHE-RSA-AES256-GCM-SHA384 ECDHE-RSA-AES256-SHA384"
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||
" DHE-RSA-CHACHA20-POLY1305 ECDHE-RSA-CHACHA20-POLY1305";
|
||||
#endif
|
||||
;
|
||||
|
||||
static LIST *ip_clients = NULL;
|
||||
|
||||
static LIST *local_mac_list = NULL;
|
||||
@@ -9254,14 +9259,9 @@ void UnixSelectInner(UINT num_read, UINT *reads, UINT num_write, UINT *writes, U
|
||||
if (num != 0)
|
||||
{
|
||||
#ifdef UNIX_MACOS
|
||||
if (timeout == INFINITE) {
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 0;
|
||||
} else {
|
||||
tv.tv_sec = timeout / 1000;
|
||||
tv.tv_usec = (timeout % 1000) * 1000l;
|
||||
}
|
||||
select(max_fd + 1, &rfds, &wfds, NULL, &tv);
|
||||
tv.tv_sec = timeout / 1000;
|
||||
tv.tv_usec = (timeout % 1000) * 1000l;
|
||||
select(max_fd + 1, &rfds, &wfds, NULL, timeout == INFINITE ? NULL : &tv);
|
||||
#else // UNIX_MACOS
|
||||
poll(p, num, timeout == INFINITE ? -1 : (int)timeout);
|
||||
#endif // UNIX_MACOS
|
||||
@@ -13017,7 +13017,11 @@ bool StartSSLEx(SOCK *sock, X *x, K *priv, bool client_tls, UINT ssl_timeout, ch
|
||||
{
|
||||
if (client_tls == false)
|
||||
{
|
||||
#if OPENSSL_VERSION_NUMBER < 0x10100000L
|
||||
SSL_CTX_set_ssl_version(ssl_ctx, SSLv3_method());
|
||||
#else
|
||||
SSL_CTX_set_ssl_version(ssl_ctx, SSLv23_method());
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -18323,7 +18327,7 @@ void SetCurrentGlobalIP(IP *ip, bool ipv6)
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsZeroIp(ip));
|
||||
if (IsZeroIp(ip))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -22912,7 +22916,3 @@ bool GetSniNameFromSslPacket(UCHAR *packet_buf, UINT packet_size, char *sni, UIN
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -1686,7 +1686,3 @@ UINT64 GetDynValueOrDefaultSafe(char *name, UINT64 default_value);
|
||||
|
||||
#endif // NETWORK_H
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+3
-7
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -555,7 +555,3 @@ void OSFreeEvent(EVENT *event)
|
||||
os->FreeEvent(event);
|
||||
}
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+3
-7
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -244,7 +244,3 @@ typedef struct OS_DISPATCH_TABLE
|
||||
|
||||
#endif // OS_H
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -620,7 +620,3 @@ bool WaitEx(EVENT *e, UINT timeout, volatile bool *cancel)
|
||||
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -213,7 +213,3 @@ void CheckDeadLockThread(THREAD *t, void *param);
|
||||
|
||||
#endif // OBJECT_H
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+3
-7
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -1730,7 +1730,3 @@ void PackAddStr(PACK *p, char *name, char *str)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+3
-7
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -260,7 +260,3 @@ bool PackGetDataEx2(PACK *p, char *name, void *data, UINT size, UINT index);
|
||||
bool PackIsValueExists(PACK *p, char *name);
|
||||
|
||||
#endif // PACK_H
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+11
-20
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -549,14 +549,14 @@ bool WriteSecKey(SECURE *sec, bool private_obj, char *name, K *k)
|
||||
RSA_get0_factors(rsa, &p, &q);
|
||||
RSA_get0_crt_params(rsa, &dmp1, &dmq1, &iqmp);
|
||||
#else
|
||||
rsa->n = n;
|
||||
rsa->e = e;
|
||||
rsa->d = d;
|
||||
rsa->p = p;
|
||||
rsa->q = q;
|
||||
rsa->dmp1 = dmp1;
|
||||
rsa->dmq1 = dmq1;
|
||||
rsa->iqmp = iqmp;
|
||||
n = rsa->n;
|
||||
e = rsa->e;
|
||||
d = rsa->d;
|
||||
p = rsa->p;
|
||||
q = rsa->q;
|
||||
dmp1 = rsa->dmp1;
|
||||
dmq1 = rsa->dmq1;
|
||||
iqmp = rsa->iqmp;
|
||||
#endif
|
||||
|
||||
b = BigNumToBuf(n);
|
||||
@@ -805,11 +805,6 @@ bool WriteSecCert(SECURE *sec, bool private_obj, char *name, X *x)
|
||||
b_private_obj = false;
|
||||
}
|
||||
|
||||
// CryptoID PKCS#11 requires CKA_ID attiribute instead of CKA_LABEL.
|
||||
if(sec->Dev->Id == 22) {
|
||||
a[7].type = CKA_ID;
|
||||
}
|
||||
|
||||
// Remove objects which have the same name
|
||||
if (CheckSecObject(sec, name, SEC_X))
|
||||
{
|
||||
@@ -2277,7 +2272,3 @@ void FreeSecure()
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -308,8 +308,8 @@ SECURE_DEVICE SupportedList[] =
|
||||
{19, SECURE_IC_CARD, "Gemalto .NET 64bit", "Gemalto", "gtop11dotnet64.dll"},
|
||||
{20, SECURE_USB_TOKEN, "ePass 2003", "Feitian Technologies", "eps2003csp11.dll"},
|
||||
{21, SECURE_USB_TOKEN, "ePass 1000ND/2000/3000", "Feitian Technologies", "ngp11v211.dll"},
|
||||
{22, SECURE_USB_TOKEN, "CryptoID", "Longmai Technology", "cryptoida_pkcs11.dll"},
|
||||
{23, SECURE_USB_TOKEN, "RuToken", "Aktiv Co.", "rtPKCS11.dll"},
|
||||
{22, SECURE_USB_TOKEN, "CryptoID", "Longmai Technology", "cryptoide_pkcs11.dll"},
|
||||
{23, SECURE_USB_TOKEN, "RuToken", "Aktiv Co.", "rtPKCS11.dll"},
|
||||
};
|
||||
|
||||
#ifdef OS_WIN32
|
||||
@@ -325,7 +325,3 @@ typedef struct SEC_DATA_WIN32
|
||||
#endif // SECURE_C
|
||||
|
||||
#endif // SECURE_H
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+3
-7
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -3415,7 +3415,3 @@ UINT StrLen(char *str)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+3
-7
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -252,7 +252,3 @@ void SetStrCaseAccordingToBits(char *str, UINT bits);
|
||||
|
||||
#endif // STR_H
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+3
-7
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -1504,7 +1504,3 @@ bool LoadTableW(wchar_t *filename)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+3
-7
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -212,7 +212,3 @@ UINT GetCurrentOsLangId();
|
||||
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+19
-8
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -669,6 +669,7 @@ bool AdjustTcpMssL3(UCHAR *src, UINT src_size, UINT mss)
|
||||
if (ip_ver == 4)
|
||||
{
|
||||
UINT ip_header_size;
|
||||
UINT ip_total_length;
|
||||
// IPv4
|
||||
if (src_size < sizeof(IPV4_HEADER))
|
||||
{
|
||||
@@ -709,8 +710,22 @@ bool AdjustTcpMssL3(UCHAR *src, UINT src_size, UINT mss)
|
||||
return false;
|
||||
}
|
||||
|
||||
ip_total_length = READ_USHORT(&ip->TotalLength);
|
||||
|
||||
if (ip_total_length < ip_header_size)
|
||||
{
|
||||
// Invalid total length
|
||||
return false;
|
||||
}
|
||||
|
||||
if (src_size < ip_total_length)
|
||||
{
|
||||
// No total length
|
||||
return false;
|
||||
}
|
||||
|
||||
src += ip_header_size;
|
||||
src_size -= ip_header_size;
|
||||
src_size = ip_total_length - ip_header_size;
|
||||
|
||||
if (src_size < sizeof(TCP_HEADER))
|
||||
{
|
||||
@@ -4310,7 +4325,3 @@ LABEL_CLEANUP:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+3
-7
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -944,7 +944,3 @@ bool NormalizeClasslessRouteTableStr(char *dst, UINT dst_size, char *src);
|
||||
#endif // TCPIP_H
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -403,7 +403,3 @@ void FreeTick64()
|
||||
halt_tick_event = NULL;
|
||||
}
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -158,7 +158,3 @@ UINT64 TickHighres64();
|
||||
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -999,7 +999,3 @@ void FreeCallStack(CALLSTACK_DATA *s)
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -195,7 +195,3 @@ bool IsTrackingEnabled();
|
||||
#endif // TRACKING_H
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
@@ -323,7 +323,3 @@ struct tuninfo {
|
||||
#endif // UNIX_LINUX
|
||||
|
||||
#endif // TUNTAP_H
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+60
-7
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -1010,6 +1010,63 @@ void UnixRestorePriority()
|
||||
}
|
||||
}
|
||||
|
||||
UINT UnixGetNumberOfCpuInner()
|
||||
{
|
||||
BUF *b;
|
||||
UINT ret = 0;
|
||||
|
||||
b = ReadDump("/proc/cpuinfo");
|
||||
if (b != NULL)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
char *line = CfgReadNextLine(b);
|
||||
|
||||
if (line == NULL)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (IsEmptyStr(line) == false)
|
||||
{
|
||||
TOKEN_LIST *t = ParseToken(line, ":");
|
||||
if (t != NULL)
|
||||
{
|
||||
if (t->NumTokens >= 2)
|
||||
{
|
||||
char *key = t->Token[0];
|
||||
char *value = t->Token[1];
|
||||
|
||||
Trim(key);
|
||||
Trim(value);
|
||||
|
||||
if (StrCmpi(key, "processor") == 0)
|
||||
{
|
||||
if (IsNum(value))
|
||||
{
|
||||
UINT i = ToInt(value) + 1;
|
||||
|
||||
if (i >= 1 && i <= 128)
|
||||
{
|
||||
ret = MAX(ret, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FreeToken(t);
|
||||
}
|
||||
}
|
||||
|
||||
Free(line);
|
||||
}
|
||||
|
||||
FreeBuf(b);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Get the product ID
|
||||
char *UnixGetProductId()
|
||||
{
|
||||
@@ -2859,7 +2916,3 @@ void UnixServiceMain(int argc, char *argv[], char *name, SERVICE_FUNCTION *start
|
||||
}
|
||||
|
||||
#endif // UNIX
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+4
-7
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -204,6 +204,7 @@ char *UnixGetProductId();
|
||||
void UnixSetHighPriority();
|
||||
void UnixSetHighOomScore();
|
||||
void UnixRestorePriority();
|
||||
UINT UnixGetNumberOfCpuInner();
|
||||
void *UnixNewSingleInstance(char *instance_name);
|
||||
void UnixFreeSingleInstance(void *data);
|
||||
void UnixGetMemInfo(MEMINFO *info);
|
||||
@@ -267,7 +268,3 @@ bool UnixIsInVm();
|
||||
|
||||
#endif // OS_UNIX
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+21
-7
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -983,6 +983,24 @@ void Win32DebugAlert(char *msg)
|
||||
MessageBox(NULL, msg, "Debug", MB_SETFOREGROUND | MB_TOPMOST | MB_SERVICE_NOTIFICATION | MB_OK | MB_ICONEXCLAMATION);
|
||||
}
|
||||
|
||||
// Get the number of CPUs
|
||||
UINT Win32GetNumberOfCpuInner()
|
||||
{
|
||||
UINT ret = 0;
|
||||
SYSTEM_INFO info;
|
||||
|
||||
Zero(&info, sizeof(info));
|
||||
|
||||
GetSystemInfo(&info);
|
||||
|
||||
if (info.dwNumberOfProcessors >= 1 && info.dwNumberOfProcessors <= 128)
|
||||
{
|
||||
ret = info.dwNumberOfProcessors;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Get the OS information
|
||||
void Win32GetOsInfo(OS_INFO *info)
|
||||
{
|
||||
@@ -3522,7 +3540,3 @@ void Win32PrintToFileW(wchar_t *str)
|
||||
#endif // WIN32
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
+5
-7
@@ -3,9 +3,9 @@
|
||||
//
|
||||
// SoftEther VPN Server, Client and Bridge are free software under GPLv2.
|
||||
//
|
||||
// Copyright (c) 2012-2016 Daiyuu Nobori.
|
||||
// Copyright (c) 2012-2016 SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) 2012-2016 SoftEther Corporation.
|
||||
// Copyright (c) Daiyuu Nobori, Ph.D..
|
||||
// Copyright (c) SoftEther VPN Project, University of Tsukuba, Japan.
|
||||
// Copyright (c) SoftEther Corporation.
|
||||
//
|
||||
// All Rights Reserved.
|
||||
//
|
||||
@@ -220,6 +220,8 @@ void Win32PrintW(wchar_t *str);
|
||||
void Win32PrintToFileW(wchar_t *str);
|
||||
bool Win32GetVersionExInternal(void *info);
|
||||
bool Win32GetVersionExInternalForWindows81orLater(void *info);
|
||||
UINT Win32GetNumberOfCpuInner();
|
||||
|
||||
|
||||
void Win32SetThreadName(UINT thread_id, char *name);
|
||||
|
||||
@@ -228,7 +230,3 @@ void Win32SetThreadName(UINT thread_id, char *name);
|
||||
#endif // OS_WIN32
|
||||
|
||||
|
||||
|
||||
// Developed by SoftEther VPN Project at University of Tsukuba in Japan.
|
||||
// Department of Computer Science has dozens of overly-enthusiastic geeks.
|
||||
// Join us: http://www.tsukuba.ac.jp/english/admission/
|
||||
|
||||
Reference in New Issue
Block a user