Skip to content

Commit 8f3a4cc

Browse files
Merge PR SoftEtherVPN#481: Encrypt: set default RSA key size to 1024 everywhere, using the RSA_KEY_SIZE macro
2 parents 0a839bc + 1fad008 commit 8f3a4cc

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/Mayaqua/Encrypt.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,7 +2212,7 @@ bool RsaVerifyEx(void *data, UINT data_size, void *sign, K *k, UINT bits)
22122212
}
22132213
if (bits == 0)
22142214
{
2215-
bits = 1024;
2215+
bits = RSA_KEY_SIZE;
22162216
}
22172217

22182218
// Hash the data
@@ -2251,7 +2251,7 @@ bool RsaSignEx(void *dst, void *src, UINT size, K *k, UINT bits)
22512251
}
22522252
if (bits == 0)
22532253
{
2254-
bits = 1024;
2254+
bits = RSA_KEY_SIZE;
22552255
}
22562256

22572257
Zero(dst, bits / 8);
@@ -2320,7 +2320,7 @@ bool RsaCheck()
23202320
BIO *bio;
23212321
char errbuf[MAX_SIZE];
23222322
UINT size = 0;
2323-
UINT bit = 32;
2323+
UINT bit = RSA_KEY_SIZE;
23242324
// Validate arguments
23252325

23262326
// Key generation
@@ -2390,7 +2390,7 @@ bool RsaGen(K **priv, K **pub, UINT bit)
23902390
}
23912391
if (bit == 0)
23922392
{
2393-
bit = 1024;
2393+
bit = RSA_KEY_SIZE;
23942394
}
23952395

23962396
// Key generation

src/Mayaqua/Encrypt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ void RAND_Free_For_SoftEther();
128128
#define DES_IV_SIZE 8 // DES IV size
129129
#define DES_BLOCK_SIZE 8 // DES block size
130130
#define DES3_KEY_SIZE (8 * 3) // 3DES key size
131-
#define RSA_KEY_SIZE 128 // RSA key size
131+
#define RSA_KEY_SIZE 1024 // RSA key size
132132
#define DH_KEY_SIZE 128 // DH key size
133133
#define RSA_MIN_SIGN_HASH_SIZE (15 + SHA1_HASH_SIZE) // Minimum RSA hash size
134134
#define RSA_SIGN_HASH_SIZE (RSA_MIN_SIGN_HASH_SIZE) // RSA hash size

0 commit comments

Comments
 (0)