From 6b3cddde65ce1126b91a49472443aa2aad4fad64 Mon Sep 17 00:00:00 2001 From: tr00d Date: Thu, 14 Sep 2023 10:17:59 +0200 Subject: [PATCH] Use a 2048 bits key for Linux and MacOs platforms --- Vonage/PemParse.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Vonage/PemParse.cs b/Vonage/PemParse.cs index 764c22680..a7111c582 100644 --- a/Vonage/PemParse.cs +++ b/Vonage/PemParse.cs @@ -80,7 +80,7 @@ public static RSA DecodePEMKey(string pemstr) if (!(isPkcs1 || isPkcs8)) { logger.LogError("App private key is not in PKCS#1 or PKCS#8 format!"); - + return null; } @@ -259,7 +259,7 @@ public static RSA DecodeRSAPrivateKey(byte[] privkey, bool isPkcs8) if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { - RSA = new RSACryptoServiceProvider(); + RSA = new RSACryptoServiceProvider(2048); } else { @@ -306,7 +306,7 @@ private static int GetIntegerSize(BinaryReader binr) { highbyte = binr.ReadByte(); // data size in next 2 bytes lowbyte = binr.ReadByte(); - byte[] modint = {lowbyte, highbyte, 0x00, 0x00}; + byte[] modint = { lowbyte, highbyte, 0x00, 0x00 }; count = BitConverter.ToInt32(modint, 0); } else