From d4ee5e4e7f0ad9ad6bf02725c67b22adf66d1814 Mon Sep 17 00:00:00 2001 From: tr00d Date: Thu, 4 Apr 2024 09:52:12 +0200 Subject: [PATCH] refactor: remove TODOs --- .gitignore | 2 -- Vonage/PemParse.cs | 9 +++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index a23329600..ac317eb93 100644 --- a/.gitignore +++ b/.gitignore @@ -126,8 +126,6 @@ publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted *.pubxml # NuGet Packages diff --git a/Vonage/PemParse.cs b/Vonage/PemParse.cs index 97a573483..5f80a0c1a 100644 --- a/Vonage/PemParse.cs +++ b/Vonage/PemParse.cs @@ -55,6 +55,7 @@ THE SOFTWARE. using System.Security.Cryptography; using System.Text; using Microsoft.Extensions.Logging; +using Vonage.Logger; namespace Vonage; @@ -69,7 +70,7 @@ internal class PemParse public static RSA DecodePEMKey(string pemstr) { - var logger = Logger.LogProvider.GetLogger(LOGGER_CATEGORY); + var logger = LogProvider.GetLogger(LOGGER_CATEGORY); pemstr = pemstr.Trim(); var isPkcs1 = pemstr.StartsWith(pkcs1privheader) && pemstr.EndsWith(pkcs1privfooter); var isPkcs8 = pemstr.StartsWith(pkcs8privheader) && pemstr.EndsWith(pkcs8privfooter); @@ -88,7 +89,7 @@ public static RSA DecodePEMKey(string pemstr) public static RSA DecodeRSAPrivateKey(byte[] privkey, bool isPkcs8) { - var logger = Logger.LogProvider.GetLogger(LOGGER_CATEGORY); + var logger = LogProvider.GetLogger(LOGGER_CATEGORY); byte[] MODULUS, E, D, P, Q, DP, DQ, IQ; // --------- Set up stream to decode the asn.1 encoded RSA private key ------ @@ -162,7 +163,7 @@ public static RSA DecodeRSAPrivateKey(byte[] privkey, bool isPkcs8) // ------- create RSACryptoServiceProvider instance and initialize with public key ----- #if NET452 - // TODO: throwing "Bad Data" exception even though RSACng is fine + // throwing "Bad Data" exception even though RSACng is fine var RSA = new RSACryptoServiceProvider(); #else RSA RSA; @@ -289,7 +290,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