Skip to content

Commit

Permalink
Initial fix for reneg issue
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdettman committed Jul 26, 2021
1 parent d8187de commit 0bb8330
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
5 changes: 5 additions & 0 deletions crypto/src/tls/AbstractTlsContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ internal bool IsConnected
get { lock (this) return m_connected; }
}

internal bool IsHandshaking
{
get { lock (this) return !m_connected && null != m_securityParameters; }
}

public TlsCrypto Crypto
{
get { return m_crypto; }
Expand Down
17 changes: 15 additions & 2 deletions crypto/src/tls/TlsProtocol.cs
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ protected virtual void CompleteHandshake()
AbstractTlsContext context = ContextAdmin;
SecurityParameters securityParameters = context.SecurityParameters;

if (m_appDataReady ||
if (!context.IsHandshaking ||
null == securityParameters.LocalVerifyData ||
null == securityParameters.PeerVerifyData)
{
Expand Down Expand Up @@ -1557,6 +1557,19 @@ public virtual bool IsClosed
get { return m_closed; }
}

public virtual bool IsConnected
{
get
{
if (m_closed)
return false;

AbstractTlsContext context = ContextAdmin;

return null != context && context.IsConnected;
}
}

public virtual bool IsHandshaking
{
get
Expand All @@ -1566,7 +1579,7 @@ public virtual bool IsHandshaking

AbstractTlsContext context = ContextAdmin;

return null != context && !context.IsConnected;
return null != context && context.IsHandshaking;
}
}

Expand Down

0 comments on commit 0bb8330

Please sign in to comment.