Skip to content
This repository was archived by the owner on Jul 9, 2023. It is now read-only.

Commit 1880a7d

Browse files
authored
Merge pull request #736 from justcoding121/master
beta
2 parents afff522 + 33d86a5 commit 1880a7d

File tree

3 files changed

+29
-17
lines changed

3 files changed

+29
-17
lines changed

src/Titanium.Web.Proxy/Helpers/SystemProxy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,9 +345,9 @@ private static void refresh()
345345
/// <summary>
346346
/// Opens the registry key with the internet settings
347347
/// </summary>
348-
private static RegistryKey openInternetSettingsKey()
348+
private static RegistryKey? openInternetSettingsKey()
349349
{
350-
return Registry.CurrentUser.OpenSubKey(regKeyInternetSettings, true);
350+
return Registry.CurrentUser?.OpenSubKey(regKeyInternetSettings, true);
351351
}
352352
}
353353
}

src/Titanium.Web.Proxy/Network/DefaultCertificateDiskCache.cs

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@
66

77
namespace Titanium.Web.Proxy.Network
88
{
9-
internal sealed class DefaultCertificateDiskCache : ICertificateCache
9+
public sealed class DefaultCertificateDiskCache : ICertificateCache
1010
{
1111
private const string defaultCertificateDirectoryName = "crts";
1212
private const string defaultCertificateFileExtension = ".pfx";
1313
private const string defaultRootCertificateFileName = "rootCert" + defaultCertificateFileExtension;
1414
private string? rootCertificatePath;
15-
private string? certificatePath;
1615

1716
public X509Certificate2? LoadRootCertificate(string pathOrName, string password, X509KeyStorageFlags storageFlags)
1817
{
@@ -56,8 +55,6 @@ public void Clear()
5655
{
5756
// do nothing
5857
}
59-
60-
certificatePath = null;
6158
}
6259

6360
private X509Certificate2? loadCertificate(string path, string password, X509KeyStorageFlags storageFlags)
@@ -95,20 +92,15 @@ private string getRootCertificatePath(string pathOrName)
9592

9693
private string getCertificatePath(bool create)
9794
{
98-
if (certificatePath == null)
99-
{
100-
string path = getRootCertificateDirectory();
101-
102-
string certPath = Path.Combine(path, defaultCertificateDirectoryName);
103-
if (create && !Directory.Exists(certPath))
104-
{
105-
Directory.CreateDirectory(certPath);
106-
}
95+
string path = getRootCertificateDirectory();
10796

108-
certificatePath = certPath;
97+
string certPath = Path.Combine(path, defaultCertificateDirectoryName);
98+
if (create && !Directory.Exists(certPath))
99+
{
100+
Directory.CreateDirectory(certPath);
109101
}
110102

111-
return certificatePath;
103+
return certPath;
112104
}
113105

114106
private string getRootCertificateDirectory()

src/Titanium.Web.Proxy/StreamExtended/Models/SslCiphers.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,12 @@ internal static class SslCiphers
173173
{ 0x00C4, "TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256" },
174174
{ 0x00C5, "TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256" },
175175
{ 0x00FF, "TLS_EMPTY_RENEGOTIATION_INFO_SCSV" },
176+
// RFC 8446
177+
{ 0x1301, "TLS_AES_128_GCM_SHA256" },
178+
{ 0x1302, "TLS_AES_256_GCM_SHA384" },
179+
{ 0x1303, "TLS_CHACHA20_POLY1305_SHA256" },
180+
{ 0x1304, "TLS_AES_128_CCM_SHA256" },
181+
{ 0x1305, "TLS_AES_128_CCM_8_SHA256" },
176182
{ 0x5600, "TLS_FALLBACK_SCSV" },
177183
// RFC 4492
178184
{ 0xC001, "TLS_ECDH_ECDSA_WITH_NULL_SHA" },
@@ -353,6 +359,15 @@ internal static class SslCiphers
353359
{ 0xC0AD, "TLS_ECDHE_ECDSA_WITH_AES_256_CCM" },
354360
{ 0xC0AE, "TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8" },
355361
{ 0xC0AF, "TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8" },
362+
{ 0xC0B0, "TLS_ECCPWD_WITH_AES_128_GCM_SHA256" },
363+
{ 0xC0B1, "TLS_ECCPWD_WITH_AES_256_GCM_SHA384" },
364+
{ 0xC0B2, "TLS_ECCPWD_WITH_AES_128_CCM_SHA256" },
365+
{ 0xC0B3, "TLS_ECCPWD_WITH_AES_256_CCM_SHA384" },
366+
{ 0xC0B4, "TLS_SHA256_SHA256" },
367+
{ 0xC0B5, "TLS_SHA384_SHA384" },
368+
{ 0xC100, "TLS_GOSTR341112_256_WITH_KUZNYECHIK_CTR_OMAC" },
369+
{ 0xC101, "TLS_GOSTR341112_256_WITH_MAGMA_CTR_OMAC" },
370+
{ 0xC102, "TLS_GOSTR341112_256_WITH_28147_CNT_IMIT" },
356371
// old numbers used in the beginning http://tools.ietf.org/html/draft-agl-tls-chacha20poly1305
357372
{ 0xCC13, "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256" },
358373
{ 0xCC14, "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256" },
@@ -365,6 +380,11 @@ internal static class SslCiphers
365380
{ 0xCCAC, "TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256" },
366381
{ 0xCCAD, "TLS_DHE_PSK_WITH_CHACHA20_POLY1305_SHA256" },
367382
{ 0xCCAE, "TLS_RSA_PSK_WITH_CHACHA20_POLY1305_SHA256" },
383+
// RFC 8442
384+
{ 0xD001, "TLS_ECDHE_PSK_WITH_AES_128_GCM_SHA256" },
385+
{ 0xD002, "TLS_ECDHE_PSK_WITH_AES_256_GCM_SHA384" },
386+
{ 0xD003, "TLS_ECDHE_PSK_WITH_AES_128_CCM_8_SHA256" },
387+
{ 0xD005, "TLS_ECDHE_PSK_WITH_AES_128_CCM_SHA256" },
368388
// http://tools.ietf.org/html/draft-josefsson-salsa20-tls
369389
{ 0xE410, "TLS_RSA_WITH_ESTREAM_SALSA20_SHA1" },
370390
{ 0xE411, "TLS_RSA_WITH_SALSA20_SHA1" },

0 commit comments

Comments
 (0)