Browse Source

Use mbedtls MD5 in PACServer, close #2759

Workaround FIPS, there is no security concern as it's only a "cache key".
tags/4.1.9.2-a-nbbnu^2^2
Student Main 4 years ago
parent
commit
49cc922631
1 changed files with 5 additions and 15 deletions
  1. +5
    -15
      shadowsocks-csharp/Controller/Service/PACServer.cs

+ 5
- 15
shadowsocks-csharp/Controller/Service/PACServer.cs View File

@@ -1,15 +1,10 @@
using System;
using System.Collections;
using System.Globalization;
using System.IO;
using Shadowsocks.Encryption;
using Shadowsocks.Model;
using Shadowsocks.Util;
using System;
using System.Net;
using System.Net.Sockets;
using System.Text;
using Shadowsocks.Encryption;
using Shadowsocks.Model;
using Shadowsocks.Properties;
using Shadowsocks.Util;
using System.Threading.Tasks;
using System.Web;
namespace Shadowsocks.Controller
@@ -53,12 +48,7 @@ namespace Shadowsocks.Controller
private static string GetHash(string content)
{
var contentBytes = Encoding.ASCII.GetBytes(content);
using (var md5 = System.Security.Cryptography.MD5.Create())
{
var md5Bytes = md5.ComputeHash(contentBytes);
return HttpServerUtility.UrlTokenEncode(md5Bytes);
};
return HttpServerUtility.UrlTokenEncode(MbedTLS.MD5(Encoding.ASCII.GetBytes(content)));
}
public override bool Handle(byte[] firstPacket, int length, Socket socket, object state)


Loading…
Cancel
Save