Skip to content
This repository has been archived by the owner on Jun 16, 2022. It is now read-only.

Commit

Permalink
Initial work to change from RSA to DH key setup.
Browse files Browse the repository at this point in the history
TODO: Fix code for tests.
  • Loading branch information
DJGosnell committed Jun 14, 2018
1 parent 7c5570f commit c6360a2
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 222 deletions.
2 changes: 1 addition & 1 deletion src/DtronixMessageQueue.Tests/TestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static int FreeTcpPort()
protected void StartAndWait(bool timeoutError = true, int timeoutLength = -1)
{
timeoutLength = timeoutLength != -1 ? timeoutLength : (int)TestTimeout.TotalMilliseconds;
#if false
#if true
timeoutLength = 100000;
#endif

Expand Down
1 change: 0 additions & 1 deletion src/DtronixMessageQueue/DtronixMessageQueue.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
<Compile Include="Rpc\ServiceMethodCache.cs" />
<Compile Include="TcpSocket\BufferManager.cs" />
<None Include="TcpSocket\EncryptedSocketSession.cs" />
<Compile Include="TcpSocket\ISecureSocketSession.cs" />
<Compile Include="TcpSocket\ISetupSocketSession.cs" />
<Compile Include="SessionEventArgs.cs" />
<Compile Include="SessionClosedEventArgs.cs" />
Expand Down
12 changes: 0 additions & 12 deletions src/DtronixMessageQueue/TcpSocket/ISecureSocketSession.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/DtronixMessageQueue/TcpSocket/TcpSocketClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public void Connect(IPEndPoint endPoint)

ConnectedSessions.TryAdd(Session.Id, Session);

((ISecureSocketSession) Session).SecureSession(Rsa);
((ISetupSocketSession) Session).StartSession();
}
};

Expand Down
13 changes: 0 additions & 13 deletions src/DtronixMessageQueue/TcpSocket/TcpSocketHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,6 @@ public abstract class TcpSocketHandler<TSession, TConfig>
/// </summary>
protected readonly ServiceMethodCache ServiceMethodCache;

/// <summary>
/// Hold the RSA class for authentication during session setup.
/// </summary>
protected RSACng Rsa;

/// <summary>
/// Key used for encryption of data to the server side.
/// </summary>
public byte[] RsaPublicKey { get; set; }

/// <summary>
/// Base constructor to all socket classes.
/// </summary>
Expand Down Expand Up @@ -139,9 +129,6 @@ protected TcpSocketHandler(TConfig config, TcpSocketMode mode)
ThreadName = $"{modeLower}-inbox",
StartThreads = processorThreads
});

Rsa = new RSACng(4096);
RsaPublicKey = Rsa.ExportParameters(false).Modulus;
}

OutboxProcessor.Start();
Expand Down
2 changes: 1 addition & 1 deletion src/DtronixMessageQueue/TcpSocket/TcpSocketServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ private void AcceptCompleted(SocketAsyncEventArgs e)
ConnectedSessions.TryAdd(session.Id, session);

// Start the session.
((ISecureSocketSession)session).SecureSession(Rsa);
((ISetupSocketSession)session).StartSession();

session.Connected += (sender, args) => OnConnect(session);
}
Expand Down
Loading

0 comments on commit c6360a2

Please sign in to comment.