Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
5ed3d7b
Update Copyright date in EULA
ld0614 May 11, 2025
477b5d0
Add simple interactive test endpoint for debugging. This should never…
ld0614 May 11, 2025
6ceff58
Added detection and removal for corrupted hiddenPBK files
ld0614 May 11, 2025
967a9f9
Increment build number as the beta version of 5.0.4 got rolled out to…
May 26, 2025
bf5959c
Avoid setting device tunnel related registry setting unless DPC 'owns…
ld0614 Jun 7, 2025
97b21cf
Merge branch 'Development' of https://github.com/ld0614/DPC into Deve…
ld0614 Jun 7, 2025
fa1e79c
Add support for Excluding DNS entries from force tunnel #26 and initi…
ld0614 Jun 7, 2025
b94ee5b
Avoid issues where multiple DNS entries return the same IP addresses
ld0614 Jul 23, 2025
c8348fb
Update Readme and bump dependencies
ld0614 Jul 26, 2025
a746d5c
Update ETW Library to fix issues with operational logs disappearing
ld0614 Jul 27, 2025
6743c25
Added ability to write logs to disk
ld0614 Jul 27, 2025
a3d1ed9
Fix Operational Events not showing in event log by forcing a reorgani…
ld0614 Jul 27, 2025
84f289f
Identified and fixed support for WMI profiles correctly identifying w…
ld0614 Jul 27, 2025
409e626
Update README in preperation for release
ld0614 Jul 27, 2025
e4b43af
Update README with Feature already added to the development branch
ld0614 Jul 27, 2025
980bf98
Refactor DNS lookups to continue in the event of a single resolution …
ld0614 Jul 27, 2025
52dc3b4
Bump Version Number
ld0614 Jul 27, 2025
019e0bc
Add tests for duplicate IP support and fix bug with DNS route comments
ld0614 Jul 27, 2025
98d7fe0
Update README
ld0614 Jul 27, 2025
a85d1a9
Clean up Dev Client
ld0614 Jul 27, 2025
74bbed2
Fix DNS route null exceptions
Jul 27, 2025
b8e5ed0
bump version number
Jul 27, 2025
46c8326
Attempt to avoid errors during the GPO update process by staggering p…
ld0614 Jul 29, 2025
031962d
Add additional Null Check
ld0614 Jul 29, 2025
3f882ec
Fix missing null check
ld0614 Jul 29, 2025
cc414d5
Add initial Get-RRASReport provided by ChrisAtWork on Discord
ld0614 Jul 29, 2025
d848317
Fix bug where thread was locked for profile update time
ld0614 Jul 30, 2025
fe1e7e7
Add debug event to show why a profile is being updated and prepare fo…
ld0614 Aug 10, 2025
85eb397
Update Development with Troubleshooting guide
ld0614 Aug 10, 2025
3995cc8
Merge branch 'Development' of https://github.com/ld0614/DPC into Deve…
ld0614 Aug 10, 2025
04b5425
Re-Merge from Main
ld0614 Aug 10, 2025
ad037d8
Merge branch 'main' into Development
ld0614 Aug 13, 2025
b874954
Update comments and fix capitalization
ld0614 Aug 13, 2025
b7142f4
Fixed issue with profile update never returning spinlock
ld0614 Aug 13, 2025
b8741ff
Merge branch 'main' into Development
ld0614 Aug 13, 2025
b935b12
Updated proxy examples
Sep 5, 2025
f6a4540
Fix incorrect registry location for User Backup Tunnel Setting
ld0614 Sep 9, 2025
974e11d
Fix null pointer exception
Sep 10, 2025
8faa048
Update interim changelog
ld0614 Sep 15, 2025
a2fd84d
Update PSExec Scripts to dynamically locate the latest version of the…
ld0614 Sep 16, 2025
3b6adbd
Tests for and fixed #42
ld0614 Sep 23, 2025
a8c6435
Update Route to make use of existing IPUtil methods and add in additi…
ld0614 Sep 23, 2025
a59e070
update comment
ld0614 Sep 23, 2025
b49cdc9
Refactor of IP address validation logic (#44)
ryannewington Sep 24, 2025
629c284
Update interim change log
ld0614 Sep 24, 2025
eba9d9d
Add additional null checks for proxy exclusions
ld0614 Sep 30, 2025
2ece02e
Prepare for release
ld0614 Sep 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/DevelopmentDPC.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ name: Development DPC

on:
push:
branches: [ "Development" ]
branches-ignore:
- main
pull_request:
branches: [ "Development" ]
branches-ignore:
- main

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion DPCInstaller/ADMX/dpc.admx
Original file line number Diff line number Diff line change
Expand Up @@ -1335,7 +1335,7 @@
<parentCategory ref="CAT_DPCCategory_C_UserBackupTunnel" />
<supportedOn ref="SUPPORTED_Windows_10_0_NOSERVER" />
<elements>
<list id="DPCCategory_UserTunnel_ProxyExclusions_Listbox" key="SOFTWARE\Policies\DPC\DPCClient\UserTunnel\ProxyExcludeList" valuePrefix="" />
<list id="DPCCategory_UserTunnel_ProxyExclusions_Listbox" key="SOFTWARE\Policies\DPC\DPCClient\UserBackupTunnel\ProxyExcludeList" valuePrefix="" />
<enum id="ProxyBypassForLocal" valueName="ProxyBypassForLocal">
<item displayName="$(string.Disabled)">
<value>
Expand Down
6 changes: 5 additions & 1 deletion DPCInstaller/ADMX/en-US/DPC.adml
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,15 @@ If PAC File is selected then the full url to the PAC file should be defined in t

Example:
http://proxy.contoso.com/vpnproxy.pac
https://proxy.contoso.com/vpnproxy.pac
http://proxy.contoso.com:8080/vpnproxy.pac
https://proxy.contoso.com:8081/vpnproxy.pac

If Proxy Server is selected then the hostname and port of the proxy server should be defined in the Proxy Value

Example:
http://proxy.contoso.com:8080
proxy.contoso.com
proxy.contoso.com:8080

NOTE: Proxy Exclusions and Bypass For Local Address Options are only valid when 'Proxy Server' is selected. These settings can be set with a seperate Group Policy Setting

Expand Down
2 changes: 1 addition & 1 deletion DPCInstaller/ProductVersion.wxi
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
<?define ProductVersion=5.2.1?>
<?define ProductVersion=5.2.2?>
</Include>
2 changes: 1 addition & 1 deletion DPCLibrary/Models/IPv4Address.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void LoadFromString(string address)
throw new ArgumentException("IPAddress must not be null");
}

if (!Validate.IPv4(address))
if (!Validate.IPv4Address(address))
{
throw new ArgumentException("IPAddress must be a valid IPv4 Address");
}
Expand Down
2 changes: 1 addition & 1 deletion DPCLibrary/Models/IPv6Address.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void LoadFromString(string address)
throw new ArgumentException("IPAddress must not be null");
}

if (!Validate.IPv6(address))
if (!Validate.IPv6Address(address))
{
throw new ArgumentException("IPAddress must be a valid IPv6 Address");
}
Expand Down
19 changes: 13 additions & 6 deletions DPCLibrary/Models/Route.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,28 +72,35 @@ public Route(XElement routeNode)
string tempAddress = routeNode.XPathSelectElement("Address")?.Value;
if (tempAddress.Contains("/"))
{
string[] tempAddressSplit = tempAddress.Split('/');
tempAddress = tempAddressSplit[0];
Prefix = Convert.ToInt32(tempAddressSplit[1], CultureInfo.InvariantCulture);
Prefix = IPUtils.GetIPCIDRSuffix(tempAddress);
tempAddress = IPUtils.GetIPAddress(tempAddress);
}
else
{
Prefix = Convert.ToInt32(routeNode.XPathSelectElement("PrefixSize")?.Value, CultureInfo.InvariantCulture);
}

if (Validate.IPv4(tempAddress))
if (Validate.IPv4Address(tempAddress))
{
Address = new IPv4Address();
Address.LoadFromString(tempAddress);
if (Prefix < 0 || Prefix > 32)
{
throw new InvalidDataException("IPv4 Prefix " + Prefix + " was not considered a valid CIDR Suffix");
}
}
else if (Validate.IPv6(tempAddress))
else if (Validate.IPv6Address(tempAddress))
{
Address = new IPv6Address();
Address.LoadFromString(tempAddress);
if (Prefix < 0 || Prefix > 128)
{
throw new InvalidDataException("IPv6 Prefix " + Prefix + " was not considered a valid CIDR Suffix");
}
}
else
{
throw new InvalidDataException("IP Address " + tempAddress + " was not considered a valid Iv4 or IPv6 Address");
throw new InvalidDataException("IP Address " + tempAddress + " was not considered a valid IPv4 or IPv6 Address");
}


Expand Down
15 changes: 12 additions & 3 deletions DPCLibrary/Utils/AccessWMI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ private static string SanitizeName(string name)

private static string Sanitize(string profileData)
{
profileData = profileData.Replace("&", "&amp;"); //Must be first or breaks all the other escape codes
profileData = profileData.Replace("<", "&lt;");
profileData = profileData.Replace(">", "&gt;");
profileData = profileData.Replace("\"", "&quot;");
Expand Down Expand Up @@ -232,7 +233,15 @@ public static bool SetProxyExcludeExceptions(string profileName, IList<string> e
return false;
}

List<string> proxyExcludeList = new List<string>(excludeList);
List<string> proxyExcludeList;
if (excludeList != null)
{
proxyExcludeList = new List<string>(excludeList);
}
else
{
proxyExcludeList = new List<string>();
}

using (CimOperationOptions options = GetContextOptions(DeviceInfo.SYSTEMSID, cancelToken))
{
Expand All @@ -244,7 +253,7 @@ public static bool SetProxyExcludeExceptions(string profileName, IList<string> e
CimMethodParameter.Create("BypassProxyForLocal", bypassForLocal, CimFlags.In)
})
{
if (excludeList.Count > 0)
if (proxyExcludeList.Count > 0)
{
string proxyServer = GetProxyServer(profileName, cancelToken);
if (!string.IsNullOrWhiteSpace(proxyServer))
Expand Down Expand Up @@ -277,7 +286,7 @@ private static IList<string> GetMachineCertificateEKUFilter(string profileName,
return EKUData.ToList();
}

private static IList<string> GetProxyExcludeList(string profileName, CancellationToken cancelToken)
public static IList<string> GetProxyExcludeList(string profileName, CancellationToken cancelToken)
{
IList<string> profileDetailsList = new List<string>();
string XML = GetWMIVPNConfig(profileName, cancelToken);
Expand Down
8 changes: 4 additions & 4 deletions DPCLibrary/Utils/IPUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,26 @@ public static int GetIPCIDRSuffix(string address)
}

string[] splitAddress = address.Split('/');
if (splitAddress.Length == 1 && Validate.IPv4(address))
if (splitAddress.Length == 1 && Validate.IPv4EndpointAddress(address))
{
//If there is no CIDR then assume it is a single IPv4 hence /32
return 32;
}
if (splitAddress.Length == 1 && Validate.IPv6(address))
if (splitAddress.Length == 1 && Validate.IPv6EndpointAddress(address))
{
//If there is no CIDR then assume it is a single IPv6 hence /128
return 128;
}
else if (splitAddress.Length == 2)
{
if (Validate.IPv4(splitAddress[1]))
if (Validate.IPv4Address(splitAddress[1]))
{
//Mask may be in the format 255.255.0.0
return GetCIDRFromNetMask(splitAddress[1]);
}
else
{
//Assume mask is in the format /24
//Assume mask is in the CIDR format
//Throw exception if not valid
return int.Parse(splitAddress[1], CultureInfo.InvariantCulture);
}
Expand Down
29 changes: 24 additions & 5 deletions DPCLibrary/Utils/VPNProfileCreator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,15 @@ public void LoadFromRegistry()
//Proxy Disabled, reset proxy settings to defaults
ProxyType = ProxyType.None;
ProxyValue = "";
if (ProxyExcludeList != null && ProxyExcludeList.Count > 0)
//Initialise the value if it wasn't already
if (ProxyExcludeList == null)
{
ProxyExcludeList = new List<string>();
}

if (ProxyExcludeList.Count > 0)
{
//Proxy has been disabled, clear out any previous proxy exclusions as they are no longer needed
ProxyExcludeList.Clear();
}
ProxyBypassForLocal = false;
Expand Down Expand Up @@ -1216,9 +1223,21 @@ public void Generate()
{
writer.WriteComment(Route.Value);
}
string address = IPUtils.GetIPAddress(Route.Key);
if (string.IsNullOrWhiteSpace(address))
{
ValidationFailures.AppendLine("Route: " + Route.Key + " is not valid and has been skipped");
continue;
}
int prefix = IPUtils.GetIPCIDRSuffix(Route.Key);
if (prefix < 0)
{
ValidationFailures.AppendLine("Route: " + Route.Key + " is not valid and has been skipped");
continue;
}
writer.WriteStartElement("Route");
writer.WriteElementString("Address", IPUtils.GetIPAddress(Route.Key));
writer.WriteElementString("PrefixSize", IPUtils.GetIPCIDRSuffix(Route.Key).ToString(CultureInfo.InvariantCulture));
writer.WriteElementString("Address", address);
writer.WriteElementString("PrefixSize", prefix.ToString(CultureInfo.InvariantCulture));
if (RouteMetric > 0)
{
writer.WriteElementString("Metric", RouteMetric.ToString(CultureInfo.InvariantCulture));
Expand Down Expand Up @@ -1838,7 +1857,7 @@ private static List<string> GetOffice365ExcludeRoutes()
{
if (ipList.Contains(item)) continue;
//Don't add IPv6 addresses as currently windows won't connect the profile if a client doesn't have an IPv6 address and there are IPv6 routes in the Route Table
if (Validate.IPv4(item) || Validate.IPv4CIDR(item))
if (Validate.IPv4EndpointAddress(item) || Validate.IPv4CIDR(item))
{
ipList.Add(item);
}
Expand Down Expand Up @@ -1887,7 +1906,7 @@ private static string GetDNSRoutes(ref Dictionary<string, string> resolvedIPList
}
//Don't add IPv6 addresses as IPv6 Exclusions added to a machine without an IPv6 address breaks the tunnel completely
//if (Validate.IPv4(item) || Validate.IPv6(item))
if (Validate.IPv4(item.Key))
if (Validate.IPv4EndpointAddress(item.Key))
{
resolvedIPList.Add(item.Key, item.Value);
}
Expand Down
Loading