You've already forked linux-packaging-mono
Imported Upstream version 4.4.0.182
Former-commit-id: ea38b2115ac3af9a394fe6cddf2be2acd11bc002
This commit is contained in:
parent
ee13743634
commit
180e8b1935
@ -93,80 +93,6 @@ public class SslStreamTest {
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ClientCipherSuitesCallback ()
|
||||
{
|
||||
try {
|
||||
ServicePointManager.ClientCipherSuitesCallback += (SecurityProtocolType p, IEnumerable<string> allCiphers) => {
|
||||
string prefix = p == SecurityProtocolType.Tls ? "TLS_" : "SSL_";
|
||||
return new List<string> { prefix + "RSA_WITH_AES_128_CBC_SHA" };
|
||||
};
|
||||
// client will only offers AES 128 - that's fine since the server support it (and many more ciphers)
|
||||
AuthenticateClientAndServer_ClientSendsNoData ();
|
||||
}
|
||||
finally {
|
||||
ServicePointManager.ClientCipherSuitesCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ServerCipherSuitesCallback ()
|
||||
{
|
||||
try {
|
||||
ServicePointManager.ServerCipherSuitesCallback += (SecurityProtocolType p, IEnumerable<string> allCiphers) => {
|
||||
string prefix = p == SecurityProtocolType.Tls ? "TLS_" : "SSL_";
|
||||
return new List<string> { prefix + "RSA_WITH_AES_256_CBC_SHA" };
|
||||
};
|
||||
// server only accept AES 256 - that's fine since the client support it (and many more ciphers)
|
||||
AuthenticateClientAndServer_ClientSendsNoData ();
|
||||
}
|
||||
finally {
|
||||
ServicePointManager.ServerCipherSuitesCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void CipherSuitesCallbacks ()
|
||||
{
|
||||
try {
|
||||
ServicePointManager.ClientCipherSuitesCallback += (SecurityProtocolType p, IEnumerable<string> allCiphers) => {
|
||||
string prefix = p == SecurityProtocolType.Tls ? "TLS_" : "SSL_";
|
||||
return new List<string> { prefix + "RSA_WITH_AES_128_CBC_SHA", prefix + "RSA_WITH_AES_256_CBC_SHA" };
|
||||
};
|
||||
ServicePointManager.ServerCipherSuitesCallback += (SecurityProtocolType p, IEnumerable<string> allCiphers) => {
|
||||
string prefix = p == SecurityProtocolType.Tls ? "TLS_" : "SSL_";
|
||||
return new List<string> { prefix + "RSA_WITH_AES_128_CBC_SHA", prefix + "RSA_WITH_AES_256_CBC_SHA" };
|
||||
};
|
||||
// both client and server supports AES (128 and 256) - server will select 128 (first choice)
|
||||
AuthenticateClientAndServer_ClientSendsNoData ();
|
||||
}
|
||||
finally {
|
||||
ServicePointManager.ClientCipherSuitesCallback = null;
|
||||
ServicePointManager.ServerCipherSuitesCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void MismatchedCipherSuites ()
|
||||
{
|
||||
try {
|
||||
ServicePointManager.ClientCipherSuitesCallback += (SecurityProtocolType p, IEnumerable<string> allCiphers) => {
|
||||
string prefix = p == SecurityProtocolType.Tls ? "TLS_" : "SSL_";
|
||||
return new List<string> { prefix + "RSA_WITH_AES_128_CBC_SHA" };
|
||||
};
|
||||
ServicePointManager.ServerCipherSuitesCallback += (SecurityProtocolType p, IEnumerable<string> allCiphers) => {
|
||||
string prefix = p == SecurityProtocolType.Tls ? "TLS_" : "SSL_";
|
||||
return new List<string> { prefix + "RSA_WITH_AES_256_CBC_SHA" };
|
||||
};
|
||||
// mismatch! server will refuse and send back an alert
|
||||
AuthenticateClientAndServer (false, false);
|
||||
}
|
||||
finally {
|
||||
ServicePointManager.ClientCipherSuitesCallback = null;
|
||||
ServicePointManager.ServerCipherSuitesCallback = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void StartClientAndAuthenticate (ClientServerState state,
|
||||
IPEndPoint endPoint) {
|
||||
try {
|
||||
|
Reference in New Issue
Block a user