Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NTDLS/NetTunnel
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.2.1
Choose a base ref
...
head repository: NTDLS/NetTunnel
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4.2.2
Choose a head ref
  • 3 commits
  • 35 files changed
  • 1 contributor

Commits on Nov 1, 2024

  1. Dependency updates.

    NTDLS committed Nov 1, 2024
    Copy the full SHA
    2554986 View commit details

Commits on Nov 4, 2024

  1. Code cleanup.

    NTDLS committed Nov 4, 2024
    Copy the full SHA
    6d9a127 View commit details
  2. version bump.

    NTDLS committed Nov 4, 2024
    Copy the full SHA
    2ffd4b1 View commit details
Showing with 158 additions and 278 deletions.
  1. +1 −1 @Installers/Installer.Iss
  2. +25 −1 NetTunnel.Library/Constants.cs
  3. +3 −3 NetTunnel.Library/NetTunnel.Library.csproj
  4. +2 −2 NetTunnel.Library/ReliablePayloads/Query/UIOrService/UOSQueryRequestKeyExchange.cs
  5. +13 −17 NetTunnel.Library/ServiceClient.cs
  6. +1 −6 NetTunnel.Service/NetTunnel.Service.csproj
  7. +0 −12 NetTunnel.Service/ReliableHandlers/Service/Notifications/ServiceNotificationHandlers.cs
  8. +0 −9 NetTunnel.Service/ReliableHandlers/Service/Queries/ServiceQueryHandlersForServiceToService.cs
  9. +0 −6 NetTunnel.Service/ReliableHandlers/Service/Queries/ServiceQueryHandlersForServiceToServiceOrUI.cs
  10. +0 −57 NetTunnel.Service/ReliableHandlers/Service/Queries/ServiceQueryHandlersForUI.cs
  11. +0 −10 NetTunnel.Service/ReliableHandlers/ServiceClient/Notifications/TunnelOutboundNotificationHandlers.cs
  12. +12 −15 NetTunnel.Service/TunnelEngine/Endpoints/BaseEndpoint.cs
  13. +6 −6 NetTunnel.Service/TunnelEngine/Endpoints/EndpointEdgeConnection.cs
  14. +3 −7 NetTunnel.Service/TunnelEngine/Endpoints/EndpointInbound.cs
  15. +2 −5 NetTunnel.Service/TunnelEngine/Endpoints/EndpointOutbound.cs
  16. +12 −18 NetTunnel.Service/TunnelEngine/HttpUtility.cs
  17. +2 −2 NetTunnel.Service/TunnelEngine/Managers/TunnelManager.cs
  18. +9 −10 NetTunnel.Service/TunnelEngine/ServiceConnectionState.cs
  19. +5 −9 NetTunnel.Service/TunnelEngine/ServiceEngine.cs
  20. +3 −3 NetTunnel.Service/TunnelEngine/Singletons.cs
  21. +2 −2 NetTunnel.Service/TunnelEngine/TunnelBase.cs
  22. +0 −2 NetTunnel.Service/TunnelEngine/TunnelInbound.cs
  23. +0 −1 NetTunnel.Service/TunnelEngine/TunnelOutbound.cs
  24. +1 −1 NetTunnel.UI/Forms/FormAbout.Designer.cs
  25. +2 −2 NetTunnel.UI/Forms/FormAbout.cs
  26. +2 −2 NetTunnel.UI/Forms/FormAddEditEndpoint.cs
  27. +2 −1 NetTunnel.UI/Forms/FormAddEditUser.cs
  28. +2 −2 NetTunnel.UI/Forms/FormConnectTunnel.cs
  29. +12 −28 NetTunnel.UI/Forms/FormEndpointEdgeConnections.cs
  30. +3 −3 NetTunnel.UI/Forms/FormEndpointProperties.cs
  31. +4 −4 NetTunnel.UI/Forms/FormLogin.cs
  32. +24 −25 NetTunnel.UI/Forms/FormMain.cs
  33. +2 −2 NetTunnel.UI/Forms/FormTunnelProperties.cs
  34. +1 −1 NetTunnel.UI/Forms/FormUsers.cs
  35. +2 −3 NetTunnel.UI/NetTunnel.UI.csproj
2 changes: 1 addition & 1 deletion @Installers/Installer.Iss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define AppVersion "4.2.1"
#define AppVersion "4.2.2"

[Setup]
;-- Main Setup Information
26 changes: 25 additions & 1 deletion NetTunnel.Library/Constants.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
namespace NetTunnel.Library
using NetTunnel.Library.Payloads;

namespace NetTunnel.Library
{
public static class Constants
{
public const string FriendlyName = "NetTunnel";
public const string EventSourceName = "NetTunnel";

public enum NtHTTPHeaderResult
{
WaitOnData,
Present,
NotPresent
}

public enum NtEdgeStatus
{
Normal, //This is a persistent connection.
New, //This is a new connection.
Expire //The connection is gone.
}

public class NtEdgeState
{
public NtEdgeStatus Status { get; set; }
public DirectionalKey TunnelKey { get; set; } = new();
public DirectionalKey EndpointKey { get; set; } = new();
public Guid EdgeId { get; set; }
}

public enum NtTrafficType
{
Raw,
6 changes: 3 additions & 3 deletions NetTunnel.Library/NetTunnel.Library.csproj
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
<Company>NetworkDLS</Company>
<Authors>NetworkDLS</Authors>
<Copyright>Copyright © 2024 NetworkDLS</Copyright>
<Version>4.2.1</Version>
<Version>4.2.2</Version>
</PropertyGroup>

<ItemGroup>
@@ -18,9 +18,9 @@

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NTDLS.Helpers" Version="1.0.5" />
<PackageReference Include="NTDLS.Helpers" Version="1.3.9" />
<PackageReference Include="NTDLS.NASCCL" Version="1.2.0" />
<PackageReference Include="NTDLS.ReliableMessaging" Version="1.8.6" />
<PackageReference Include="NTDLS.ReliableMessaging" Version="1.10.16" />
<PackageReference Include="NTDLS.SecureKeyExchange" Version="3.0.1" />
</ItemGroup>

Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ public class UOSQueryRequestKeyExchange : IRmQuery<UOSQueryReplyKeyExchangeReply

public UOSQueryRequestKeyExchange()
{
NegotiationToken = new byte[0];
NegotiationToken = Array.Empty<byte>();
}

public UOSQueryRequestKeyExchange(byte[] negotiationToken)
@@ -24,7 +24,7 @@ public class UOSQueryReplyKeyExchangeReply : IRmQueryReply

public UOSQueryReplyKeyExchangeReply()
{
NegotiationToken = new byte[0];
NegotiationToken = Array.Empty<byte>();
}

public UOSQueryReplyKeyExchangeReply(Guid connectionId, byte[] negotiationToken)
30 changes: 13 additions & 17 deletions NetTunnel.Library/ServiceClient.cs
Original file line number Diff line number Diff line change
@@ -19,31 +19,27 @@ namespace NetTunnel.Library
/// </summary>
public class ServiceClient
{
private readonly ILogger _logger;
private readonly int _port;
private readonly ServiceConfiguration _configuration;
private readonly string _address;
private readonly int _port;
private readonly string _userName;
private readonly string _passwordHash;
private readonly string _userName;

public NtUserRole Role { get; private set; } = NtUserRole.Undefined;

public string Address { get { return _address; } }
public bool IsLoggedIn { get; private set; } = false;
public delegate void ConnectedEvent(RmContext context);
public delegate void DisconnectedEvent(RmContext context);
public delegate void ExceptionEvent(RmContext? context, Exception ex, IRmPayload? payload);
public event ConnectedEvent? OnConnected;
public event DisconnectedEvent? OnDisconnected;
public event ExceptionEvent? OnException;
/// <summary>
/// The id of the service that we are logged into.
/// </summary>
public Guid ServiceId { get; private set; }
public NtUserRole Role { get; private set; } = NtUserRole.Undefined;
public RmClient Client { get; private set; }
public bool IsLoggedIn { get; private set; } = false;
public ILogger _logger;

public event ExceptionEvent? OnException;
public delegate void ExceptionEvent(RmContext? context, Exception ex, IRmPayload? payload);

public event ConnectedEvent? OnConnected;
public delegate void ConnectedEvent(RmContext context);

public event DisconnectedEvent? OnDisconnected;
public delegate void DisconnectedEvent(RmContext context);
public string Address { get { return _address; } }

public ServiceClient(ILogger logger, ServiceConfiguration configuration, RmClient client, string address, int port, string userName, string passwordHash)
{
@@ -126,7 +122,7 @@ public void ConnectAndLogin(NtLoginType loginType)

//The first thing we do when we get a connection is start a new key exchange process.
var queryRequestKeyExchangeReply = Client.Query(
new UOSQueryRequestKeyExchange(negotiationToken), _configuration.MessageQueryTimeoutMs).Result;
new UOSQueryRequestKeyExchange(negotiationToken), TimeSpan.FromMilliseconds(_configuration.MessageQueryTimeoutMs)).Result;

//We received a reply to the secure key exchange, apply it.
compoundNegotiator.ApplyNegotiationResponseToken(queryRequestKeyExchangeReply.NegotiationToken);
7 changes: 1 addition & 6 deletions NetTunnel.Service/NetTunnel.Service.csproj
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
<Company>NetworkDLS</Company>
<Authors>NetworkDLS</Authors>
<Copyright>Copyright © 2024 NetworkDLS</Copyright>
<Version>4.2.1</Version>
<Version>4.2.2</Version>
<OutputType>Exe</OutputType>
</PropertyGroup>

@@ -25,12 +25,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="NTDLS.Helpers" Version="1.0.5" />
<PackageReference Include="NTDLS.NASCCL" Version="1.2.0" />
<PackageReference Include="NTDLS.Persistence" Version="1.2.1" />
<PackageReference Include="NTDLS.ReliableMessaging" Version="1.8.6" />
<PackageReference Include="NTDLS.SecureKeyExchange" Version="3.0.1" />
<PackageReference Include="Topshelf" Version="4.3.0" />
</ItemGroup>

Original file line number Diff line number Diff line change
@@ -18,8 +18,6 @@ internal class ServiceNotificationHandlers : ServiceHandlerBase, IRmMessageHandl
/// The remote service is letting us know that they are about to start using the cryptography provider,
/// so we need to apply the one that we have ready on this end.
/// </summary>
/// <param name="context"></param>
/// <param name="notification"></param>
public void OnNotify(RmContext context, UOSNotificationApplyCryptography notification)
{
try
@@ -57,8 +55,6 @@ public void OnNotify(RmContext context, S2SNotificationEndpointConnect notificat
/// The remote service is letting us know that edge data has been received on an endpoint and is giving
/// it to the local service to that it can be delivered to the associated endpoint edge connection.
/// </summary>
/// <param name="context"></param>
/// <param name="notification"></param>
public void OnNotify(RmContext context, S2SNotificationEndpointDataExchange notification)
{
try
@@ -78,8 +74,6 @@ public void OnNotify(RmContext context, S2SNotificationEndpointDataExchange noti
/// <summary>
/// The remote service is letting us know that it is deleting the given tunnel.
/// </summary>
/// <param name="context"></param>
/// <param name="notification"></param>
public void OnNotify(RmContext context, S2SNotificationTunnelDeletion notification)
{
try
@@ -98,8 +92,6 @@ public void OnNotify(RmContext context, S2SNotificationTunnelDeletion notificati
/// <summary>
/// The remote service is letting us know that it is deleting the given endpoint.
/// </summary>
/// <param name="context"></param>
/// <param name="notification"></param>
public void OnNotify(RmContext context, S2SNotificationEndpointDeletion notification)
{
try
@@ -118,8 +110,6 @@ public void OnNotify(RmContext context, S2SNotificationEndpointDeletion notifica
/// <summary>
/// The remote service is letting us know that an edge connection has been terminated to the given endpoint.
/// </summary>
/// <param name="context"></param>
/// <param name="notification"></param>
public void OnNotify(RmContext context, S2SNotificationEndpointDisconnect notification)
{
try
@@ -138,8 +128,6 @@ public void OnNotify(RmContext context, S2SNotificationEndpointDisconnect notifi
/// <summary>
/// The UI is requesting that the local service disconnect the given endpoint edge connection.
/// </summary>
/// <param name="context"></param>
/// <param name="notification"></param>
public void OnNotify(RmContext context, UINotifyTerminateEndpointEdgeConnection notification)
{
try
Original file line number Diff line number Diff line change
@@ -17,9 +17,6 @@ internal class ServiceQueryHandlersForServiceToService : ServiceHandlerBase, IRm
/// <summary>
/// The remote service is requesting that this service respond to a ping request.
/// </summary>
/// <param name="context"></param>
/// <param name="query"></param>
/// <returns></returns>
public S2SQueryPingReply OnQuery(RmContext context, S2SQueryPing query)
{
try
@@ -44,9 +41,6 @@ public S2SQueryPingReply OnQuery(RmContext context, S2SQueryPing query)
/// The remote outbound service is asking this service to register the given tunnel.
/// The service will connect the tunnel and send back the endpoints for the logged in user.
/// </summary>
/// <param name="context"></param>
/// <param name="query"></param>
/// <returns></returns>
public S2SQueryRegisterTunnelReply OnQuery(RmContext context, S2SQueryRegisterTunnel query)
{
try
@@ -94,9 +88,6 @@ public S2SQueryRegisterTunnelReply OnQuery(RmContext context, S2SQueryRegisterTu
/// <summary>
/// A new endpoint has been added to the remote service, so that remote service is asking this service to add the endpoint locally too.
/// </summary>
/// <param name="context"></param>
/// <param name="query"></param>
/// <returns></returns>
public S2SQueryUpsertEndpointReply OnQuery(RmContext context, S2SQueryUpsertEndpoint query)
{
try
Original file line number Diff line number Diff line change
@@ -21,9 +21,6 @@ internal class ServiceQueryHandlersForServiceToServiceOrUI : ServiceHandlerBase,
/// sends the NotificationApplyCryptography notification. This is because if we apply the cryptography now, then
/// the reply will be encrypted before the remote service has the data it needs to decrypt it.
/// </summary>
/// <param name="context"></param>
/// <param name="query"></param>
/// <returns></returns>
public UOSQueryReplyKeyExchangeReply OnQuery(RmContext context, UOSQueryRequestKeyExchange query)
{
try
@@ -48,9 +45,6 @@ public UOSQueryReplyKeyExchangeReply OnQuery(RmContext context, UOSQueryRequestK
/// <summary>
/// A UI client or remote service is requesting to login.
/// </summary>
/// <param name="context"></param>
/// <param name="query"></param>
/// <returns></returns>
public UOSQueryLoginReply OnQuery(RmContext context, UOSQueryLogin query)
{
try
Loading