summarylogtreecommitdiffstats
path: root/openssl.patch
diff options
context:
space:
mode:
authorNicholas Wang2018-09-26 03:28:17 -0500
committerNicholas Wang2018-09-26 03:28:17 -0500
commit4f757d9ee0fba92a77f2108eab2a15621fe7189a (patch)
treec0382fe03ed6029226f6f721cef0c6a8762b1472 /openssl.patch
parent676758e0627632fa4b463b01ecd4c3b7dff15575 (diff)
downloadaur-softethervpn-beta.tar.gz
add openssl patch and update
patch and pkgbuild thanks to Tun Win Naing and Jonathan Liu
Diffstat (limited to 'openssl.patch')
-rw-r--r--openssl.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/openssl.patch b/openssl.patch
new file mode 100644
index 000000000000..b42be512d63b
--- /dev/null
+++ b/openssl.patch
@@ -0,0 +1,65 @@
+From 1fad008e1adba5cb596da6f9ec6a244d49a585cf Mon Sep 17 00:00:00 2001
+From: Davide Beatrici <davidebeatrici@gmail.com>
+Date: Mon, 9 Apr 2018 22:02:34 +0200
+Subject: [PATCH] Encrypt: set default RSA key size to 1024 everywhere, using
+ the RSA_KEY_SIZE macro
+
+This commit also fixes the problem described in #31, which was caused by the test key generated in RsaCheck() being too small for newer OpenSSL versions.
+---
+ src/Mayaqua/Encrypt.c | 8 ++++----
+ src/Mayaqua/Encrypt.h | 2 +-
+ 2 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/Mayaqua/Encrypt.c b/src/Mayaqua/Encrypt.c
+index 381d1c57..a5570520 100644
+--- a/src/Mayaqua/Encrypt.c
++++ b/src/Mayaqua/Encrypt.c
+@@ -2194,7 +2194,7 @@ bool RsaVerifyEx(void *data, UINT data_size, void *sign, K *k, UINT bits)
+ }
+ if (bits == 0)
+ {
+- bits = 1024;
++ bits = RSA_KEY_SIZE;
+ }
+
+ // Hash the data
+@@ -2233,7 +2233,7 @@ bool RsaSignEx(void *dst, void *src, UINT size, K *k, UINT bits)
+ }
+ if (bits == 0)
+ {
+- bits = 1024;
++ bits = RSA_KEY_SIZE;
+ }
+
+ Zero(dst, bits / 8);
+@@ -2302,7 +2302,7 @@ bool RsaCheck()
+ BIO *bio;
+ char errbuf[MAX_SIZE];
+ UINT size = 0;
+- UINT bit = 32;
++ UINT bit = RSA_KEY_SIZE;
+ // Validate arguments
+
+ // Key generation
+@@ -2372,7 +2372,7 @@ bool RsaGen(K **priv, K **pub, UINT bit)
+ }
+ if (bit == 0)
+ {
+- bit = 1024;
++ bit = RSA_KEY_SIZE;
+ }
+
+ // Key generation
+diff --git a/src/Mayaqua/Encrypt.h b/src/Mayaqua/Encrypt.h
+index d795d2d6..0c481610 100644
+--- a/src/Mayaqua/Encrypt.h
++++ b/src/Mayaqua/Encrypt.h
+@@ -128,7 +128,7 @@ void RAND_Free_For_SoftEther();
+ #define DES_IV_SIZE 8 // DES IV size
+ #define DES_BLOCK_SIZE 8 // DES block size
+ #define DES3_KEY_SIZE (8 * 3) // 3DES key size
+-#define RSA_KEY_SIZE 128 // RSA key size
++#define RSA_KEY_SIZE 1024 // RSA key size
+ #define DH_KEY_SIZE 128 // DH key size
+ #define RSA_MIN_SIGN_HASH_SIZE (15 + SHA1_HASH_SIZE) // Minimum RSA hash size
+ #define RSA_SIGN_HASH_SIZE (RSA_MIN_SIGN_HASH_SIZE) // RSA hash size