mirror of
https://github.com/coolsnowwolf/packages.git
synced 2025-05-01 04:20:09 +08:00
fix openssl compile issue
This commit is contained in:
parent
806e47676c
commit
5be5dc0b9e
@ -1,5 +1,3 @@
|
|||||||
diff --git a/src/Mayaqua/Encrypt.c b/src/Mayaqua/Encrypt.c
|
|
||||||
index f3b3908..06b7fea 100644
|
|
||||||
--- a/src/Mayaqua/Encrypt.c
|
--- a/src/Mayaqua/Encrypt.c
|
||||||
+++ b/src/Mayaqua/Encrypt.c
|
+++ b/src/Mayaqua/Encrypt.c
|
||||||
@@ -120,6 +120,7 @@
|
@@ -120,6 +120,7 @@
|
||||||
@ -18,7 +16,7 @@ index f3b3908..06b7fea 100644
|
|||||||
#include <openssl/des.h>
|
#include <openssl/des.h>
|
||||||
#include <openssl/aes.h>
|
#include <openssl/aes.h>
|
||||||
#include <openssl/dh.h>
|
#include <openssl/dh.h>
|
||||||
@@ -625,7 +627,7 @@ UINT CipherProcess(CIPHER *c, void *iv, void *dest, void *src, UINT size)
|
@@ -627,7 +629,7 @@ UINT CipherProcess(CIPHER *c, void *iv, void *dest, void *src, UINT size)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,7 +25,7 @@ index f3b3908..06b7fea 100644
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -924,6 +926,7 @@ BUF *BigNumToBuf(const BIGNUM *bn)
|
@@ -926,6 +928,7 @@ BUF *BigNumToBuf(const BIGNUM *bn)
|
||||||
// Initialization of the lock of OpenSSL
|
// Initialization of the lock of OpenSSL
|
||||||
void OpenSSL_InitLock()
|
void OpenSSL_InitLock()
|
||||||
{
|
{
|
||||||
@ -35,7 +33,7 @@ index f3b3908..06b7fea 100644
|
|||||||
UINT i;
|
UINT i;
|
||||||
|
|
||||||
// Initialization of the lock object
|
// Initialization of the lock object
|
||||||
@@ -937,11 +940,13 @@ void OpenSSL_InitLock()
|
@@ -939,11 +942,13 @@ void OpenSSL_InitLock()
|
||||||
// Setting the lock function
|
// Setting the lock function
|
||||||
CRYPTO_set_locking_callback(OpenSSL_Lock);
|
CRYPTO_set_locking_callback(OpenSSL_Lock);
|
||||||
CRYPTO_set_id_callback(OpenSSL_Id);
|
CRYPTO_set_id_callback(OpenSSL_Id);
|
||||||
@ -49,7 +47,7 @@ index f3b3908..06b7fea 100644
|
|||||||
UINT i;
|
UINT i;
|
||||||
|
|
||||||
for (i = 0;i < ssl_lock_num;i++)
|
for (i = 0;i < ssl_lock_num;i++)
|
||||||
@@ -953,11 +958,13 @@ void OpenSSL_FreeLock()
|
@@ -955,11 +960,13 @@ void OpenSSL_FreeLock()
|
||||||
|
|
||||||
CRYPTO_set_locking_callback(NULL);
|
CRYPTO_set_locking_callback(NULL);
|
||||||
CRYPTO_set_id_callback(NULL);
|
CRYPTO_set_id_callback(NULL);
|
||||||
@ -63,7 +61,7 @@ index f3b3908..06b7fea 100644
|
|||||||
LOCK *lock = ssl_lock_obj[n];
|
LOCK *lock = ssl_lock_obj[n];
|
||||||
|
|
||||||
if (mode & CRYPTO_LOCK)
|
if (mode & CRYPTO_LOCK)
|
||||||
@@ -970,12 +977,15 @@ void OpenSSL_Lock(int mode, int n, const char *file, int line)
|
@@ -972,12 +979,15 @@ void OpenSSL_Lock(int mode, int n, const char *file, int line)
|
||||||
// Unlock
|
// Unlock
|
||||||
Unlock(lock);
|
Unlock(lock);
|
||||||
}
|
}
|
||||||
@ -79,7 +77,7 @@ index f3b3908..06b7fea 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get the display name of the certificate
|
// Get the display name of the certificate
|
||||||
@@ -1899,8 +1909,8 @@ X509 *NewX509(K *pub, K *priv, X *ca, NAME *name, UINT days, X_SERIAL *serial)
|
@@ -1901,8 +1911,8 @@ X509 *NewX509(K *pub, K *priv, X *ca, NAME *name, UINT days, X_SERIAL *serial)
|
||||||
X509_set_version(x509, 2L);
|
X509_set_version(x509, 2L);
|
||||||
|
|
||||||
// Set the Expiration
|
// Set the Expiration
|
||||||
@ -90,7 +88,7 @@ index f3b3908..06b7fea 100644
|
|||||||
if (!UINT64ToAsn1Time(t1, notBefore))
|
if (!UINT64ToAsn1Time(t1, notBefore))
|
||||||
{
|
{
|
||||||
FreeX509(x509);
|
FreeX509(x509);
|
||||||
@@ -2041,8 +2051,8 @@ X509 *NewRootX509(K *pub, K *priv, NAME *name, UINT days, X_SERIAL *serial)
|
@@ -2043,8 +2053,8 @@ X509 *NewRootX509(K *pub, K *priv, NAME *name, UINT days, X_SERIAL *serial)
|
||||||
X509_set_version(x509, 2L);
|
X509_set_version(x509, 2L);
|
||||||
|
|
||||||
// Set the Expiration
|
// Set the Expiration
|
||||||
@ -192,7 +190,7 @@ index f3b3908..06b7fea 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Release the Crypt library
|
// Release the Crypt library
|
||||||
@@ -4130,13 +4177,16 @@ void InitCryptLibrary()
|
@@ -4130,12 +4177,14 @@ void InitCryptLibrary()
|
||||||
CheckIfIntelAesNiSupportedInit();
|
CheckIfIntelAesNiSupportedInit();
|
||||||
// RAND_Init_For_SoftEther()
|
// RAND_Init_For_SoftEther()
|
||||||
openssl_lock = NewLock();
|
openssl_lock = NewLock();
|
||||||
@ -203,10 +201,39 @@ index f3b3908..06b7fea 100644
|
|||||||
OpenSSL_add_all_digests();
|
OpenSSL_add_all_digests();
|
||||||
ERR_load_crypto_strings();
|
ERR_load_crypto_strings();
|
||||||
SSL_load_error_strings();
|
SSL_load_error_strings();
|
||||||
-
|
|
||||||
+#else
|
|
||||||
+ OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
|
|
||||||
+#endif
|
+#endif
|
||||||
#ifdef OS_UNIX
|
|
||||||
{
|
ssl_clientcert_index = SSL_get_ex_new_index(0, "struct SslClientCertInfo *", NULL, NULL, NULL);
|
||||||
char *name1 = "/dev/random";
|
|
||||||
|
--- a/src/Mayaqua/Encrypt.h
|
||||||
|
+++ b/src/Mayaqua/Encrypt.h
|
||||||
|
@@ -105,7 +105,7 @@
|
||||||
|
#ifndef ENCRYPT_H
|
||||||
|
#define ENCRYPT_H
|
||||||
|
|
||||||
|
-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
|
||||||
|
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(OPENSSL_NO_CHACHA) && !defined(LIBRESSL_VERSION_NUMBER)
|
||||||
|
#define USE_OPENSSL_AEAD_CHACHA20POLY1305
|
||||||
|
#endif
|
||||||
|
|
||||||
|
--- a/src/Mayaqua/Network.c
|
||||||
|
+++ b/src/Mayaqua/Network.c
|
||||||
|
@@ -18172,7 +18172,7 @@ struct ssl_ctx_st *NewSSLCtx(bool server_mode)
|
||||||
|
SSL_CTX_set_ecdh_auto(ctx, 1);
|
||||||
|
#endif // SSL_CTX_set_ecdh_auto
|
||||||
|
|
||||||
|
-#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
|
||||||
|
+#if OPENSSL_VERSION_NUMBER >= 0x1010100fL && !defined(LIBRESSL_VERSION_NUMBER)
|
||||||
|
// For compatibility with VPN 3.0 or older
|
||||||
|
SSL_CTX_set_security_level(ctx, 0);
|
||||||
|
#endif
|
||||||
|
--- a/src/Mayaqua/Secure.c
|
||||||
|
+++ b/src/Mayaqua/Secure.c
|
||||||
|
@@ -127,6 +127,7 @@
|
||||||
|
#include <openssl/pkcs7.h>
|
||||||
|
#include <openssl/pkcs12.h>
|
||||||
|
#include <openssl/rc4.h>
|
||||||
|
+#include <openssl/rsa.h>
|
||||||
|
#include <openssl/md5.h>
|
||||||
|
#include <openssl/sha.h>
|
||||||
|
#include <Mayaqua/Mayaqua.h>
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
diff --git a/src/Mayaqua/Mayaqua.h b/src/Mayaqua/Mayaqua.h
|
|
||||||
index 194f8e6..177129e 100644
|
|
||||||
--- a/src/Mayaqua/Mayaqua.h
|
--- a/src/Mayaqua/Mayaqua.h
|
||||||
+++ b/src/Mayaqua/Mayaqua.h
|
+++ b/src/Mayaqua/Mayaqua.h
|
||||||
@@ -283,7 +283,7 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, char *CmdLine, int CmdShow)
|
@@ -283,7 +283,7 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, char *CmdLine, int CmdShow)
|
||||||
@ -11,8 +9,6 @@ index 194f8e6..177129e 100644
|
|||||||
typedef void *iconv_t;
|
typedef void *iconv_t;
|
||||||
iconv_t iconv_open (__const char *__tocode, __const char *__fromcode);
|
iconv_t iconv_open (__const char *__tocode, __const char *__fromcode);
|
||||||
size_t iconv (iconv_t __cd, char **__restrict __inbuf,
|
size_t iconv (iconv_t __cd, char **__restrict __inbuf,
|
||||||
diff --git a/src/makefiles/linux_32bit.mak b/src/makefiles/linux_32bit.mak
|
|
||||||
index 8219d5d..8020290 100644
|
|
||||||
--- a/src/makefiles/linux_32bit.mak
|
--- a/src/makefiles/linux_32bit.mak
|
||||||
+++ b/src/makefiles/linux_32bit.mak
|
+++ b/src/makefiles/linux_32bit.mak
|
||||||
@@ -68,7 +68,7 @@ OPTIONS_LINK_DEBUG=-g -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lrea
|
@@ -68,7 +68,7 @@ OPTIONS_LINK_DEBUG=-g -fsigned-char -lm -ldl -lrt -lpthread -lssl -lcrypto -lrea
|
||||||
@ -24,8 +20,6 @@ index 8219d5d..8020290 100644
|
|||||||
|
|
||||||
INSTALL_BINDIR=/usr/bin/
|
INSTALL_BINDIR=/usr/bin/
|
||||||
INSTALL_VPNSERVER_DIR=/usr/vpnserver/
|
INSTALL_VPNSERVER_DIR=/usr/vpnserver/
|
||||||
diff --git a/src/makefiles/linux_64bit.mak b/src/makefiles/linux_64bit.mak
|
|
||||||
index 7f81b58..a36e0de 100644
|
|
||||||
--- a/src/makefiles/linux_64bit.mak
|
--- a/src/makefiles/linux_64bit.mak
|
||||||
+++ b/src/makefiles/linux_64bit.mak
|
+++ b/src/makefiles/linux_64bit.mak
|
||||||
@@ -68,7 +68,7 @@ OPTIONS_LINK_DEBUG=-g -fsigned-char -m64 -lm -ldl -lrt -lpthread -lssl -lcrypto
|
@@ -68,7 +68,7 @@ OPTIONS_LINK_DEBUG=-g -fsigned-char -m64 -lm -ldl -lrt -lpthread -lssl -lcrypto
|
||||||
|
@ -1,10 +0,0 @@
|
|||||||
--- a/src/Mayaqua/Secure.c
|
|
||||||
+++ b/src/Mayaqua/Secure.c
|
|
||||||
@@ -127,6 +127,7 @@
|
|
||||||
#include <openssl/pkcs7.h>
|
|
||||||
#include <openssl/pkcs12.h>
|
|
||||||
#include <openssl/rc4.h>
|
|
||||||
+#include <openssl/rsa.h>
|
|
||||||
#include <openssl/md5.h>
|
|
||||||
#include <openssl/sha.h>
|
|
||||||
#include <Mayaqua/Mayaqua.h>
|
|
Loading…
Reference in New Issue
Block a user