namespace Mono.Security.Protocol.Tls
{
- public class SslServerStream : SslStreamBase
+#if INSIDE_SYSTEM
+ internal
+#else
+ public
+#endif
+ class SslServerStream : SslStreamBase
{
#region Internal Events
Fig. 1 - Message flow for a full handshake
*/
- internal override IAsyncResult OnBeginNegotiateHandshake(AsyncCallback callback, object state)
+ internal override IAsyncResult BeginNegotiateHandshake(AsyncCallback callback, object state)
{
// Reset the context if needed
if (this.context.HandshakeState != HandshakeState.None)
}
// Obtain supported cipher suites
- this.context.SupportedCiphers = CipherSuiteFactory.GetSupportedCiphers(this.context.SecurityProtocol);
+ this.context.SupportedCiphers = CipherSuiteFactory.GetSupportedCiphers (true, context.SecurityProtocol);
// Set handshake state
this.context.HandshakeState = HandshakeState.Started;
}
- internal override void OnNegotiateHandshakeCallback(IAsyncResult asyncResult)
+ internal override void EndNegotiateHandshake(IAsyncResult asyncResult)
{
// Receive Client Hello message and ignore it
this.protocol.EndReceiveRecord(asyncResult);
// Send ServerCertificate message
this.protocol.SendRecord(HandshakeType.Certificate);
- // If the negotiated cipher is a KeyEx cipher send ServerKeyExchange
- if (this.context.Negotiating.Cipher.IsExportable)
- {
- this.protocol.SendRecord(HandshakeType.ServerKeyExchange);
- }
-
- // If the negotiated cipher is a KeyEx cipher or
- // the client certificate is required send the CertificateRequest message
- if (this.context.Negotiating.Cipher.IsExportable ||
- ((ServerContext)this.context).ClientCertificateRequired ||
+ // If the client certificate is required send the CertificateRequest message
+ if (((ServerContext)this.context).ClientCertificateRequired ||
((ServerContext)this.context).RequestClientCertificate)
{
this.protocol.SendRecord(HandshakeType.CertificateRequest);