Skip to content

Commit

Permalink
refactor: remove TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
Tr00d committed Apr 4, 2024
1 parent 7f6c7a0 commit d4ee5e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions Vonage/PemParse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ THE SOFTWARE.
using System.Security.Cryptography;
using System.Text;
using Microsoft.Extensions.Logging;
using Vonage.Logger;

namespace Vonage;

Expand All @@ -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);
Expand All @@ -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 ------
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d4ee5e4

Please sign in to comment.