Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Köplinger <alex.koeplinger@outlook.com>2014-08-07 23:09:54 +0400
committerAlexander Köplinger <alex.koeplinger@outlook.com>2014-08-08 05:28:34 +0400
commit48e112d652335da23dd1b4d5f3227e54b74d0814 (patch)
tree9a47ae5b02de2131814fa4e455dccc43720b4128 /mcs/class/Novell.Directory.Ldap
parentc685b217646d271e70063173171a98159109ab2b (diff)
[Cleanup] Removed TARGET_JVM
It was once part of a special Java target profile, but this is no longer used today.
Diffstat (limited to 'mcs/class/Novell.Directory.Ldap')
-rw-r--r--mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Utilclass/RespExtensionSet.cs5
-rw-r--r--mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/AssemblyInfo.cs4
-rw-r--r--mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs21
-rw-r--r--mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/LdapConnection.cs138
-rw-r--r--mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/SupportClass.cs8
5 files changed, 0 insertions, 176 deletions
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Utilclass/RespExtensionSet.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Utilclass/RespExtensionSet.cs
index 701ce4b9a71..87a5a89b00e 100644
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Utilclass/RespExtensionSet.cs
+++ b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.Utilclass/RespExtensionSet.cs
@@ -33,11 +33,6 @@ using System;
namespace Novell.Directory.Ldap.Utilclass
{
-#if TARGET_JVM
- // This dummy class workarounds a MS CSC bug by using SupportClass before
- // using its inner class (SupportClass.AbstractSetSupport)
- class RespExtensionSetDummy : SupportClass {}
-#endif
/// <summary> This class extends the AbstractSet and Implements the Set
/// so that it can be used to maintain a list of currently
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/AssemblyInfo.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/AssemblyInfo.cs
index b5563d56cd2..cba8084028d 100644
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/AssemblyInfo.cs
+++ b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/AssemblyInfo.cs
@@ -48,9 +48,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright(" (C) 2003 Novell, Inc")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
-#if !TARGET_JVM
[assembly: CLSCompliant(true)]
-#endif
//
// Version information for an assembly consists of the following four values:
@@ -65,8 +63,6 @@ using System.Runtime.InteropServices;
[assembly: AssemblyVersion (Consts.FxVersion)]
-#if (!TARGET_JVM)
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile ("../mono.pub")]
-#endif
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs
index 1dc68151233..f2ef8e99597 100644
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs
+++ b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/Connection.cs
@@ -34,10 +34,8 @@ using System.Threading;
using Novell.Directory.Ldap.Asn1;
using Novell.Directory.Ldap.Rfc2251;
using Novell.Directory.Ldap.Utilclass;
-#if !TARGET_JVM
using Mono.Security.Protocol.Tls;
using Mono.Security.X509.Extensions;
-#endif
using Syscert = System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography;
using System.Net;
@@ -45,9 +43,7 @@ using System.Net.Sockets;
using System.Collections;
using System.IO;
using System.Text;
-#if !TARGET_JVM
using Mono.Security.X509;
-#endif
using System.Text.RegularExpressions;
using System.Globalization;
using System.Reflection;
@@ -735,7 +731,6 @@ namespace Novell.Directory.Ldap
{
if ((in_Renamed == null) || (out_Renamed == null))
{
-#if !TARGET_JVM
if(Ssl)
{
this.host = host;
@@ -796,13 +791,10 @@ namespace Novell.Directory.Ldap
out_Renamed = (System.IO.Stream) sslstream;*/
}
else{
-#endif
socket = new System.Net.Sockets.TcpClient(host, port);
in_Renamed = (System.IO.Stream) socket.GetStream();
out_Renamed = (System.IO.Stream) socket.GetStream();
-#if !TARGET_JVM
}
-#endif
}
else
{
@@ -1140,11 +1132,9 @@ namespace Novell.Directory.Ldap
if (socket != null || sock != null)
{
-#if !TARGET_JVM
// Just before closing the sockets, abort the reader thread
if ((reader != null) && (reason != "reader: thread stopping"))
reader.Abort();
-#endif
// Close the socket
try
{
@@ -1264,7 +1254,6 @@ namespace Novell.Directory.Ldap
/* package */
internal void startTLS()
{
-#if !TARGET_JVM
try
{
waitForReader(null);
@@ -1333,7 +1322,6 @@ namespace Novell.Directory.Ldap
throw new LdapException("The host is unknown", LdapException.CONNECT_ERROR, null, uhe);
}
return ;
-#endif
}
/*
@@ -1544,15 +1532,6 @@ namespace Novell.Directory.Ldap
// before closing sockets, from shutdown
return;
}
-#if TARGET_JVM
- catch (ObjectDisposedException)
- {
- // we do not support Thread.Abort under java
- // so we close the stream and the working thread
- // catches ObjectDisposedException exception
- return;
- }
-#endif
catch (System.IO.IOException ioe)
{
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/LdapConnection.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/LdapConnection.cs
index f6c72497f9e..35ee09ca151 100644
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/LdapConnection.cs
+++ b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/LdapConnection.cs
@@ -34,18 +34,7 @@ using Novell.Directory.Ldap;
using Novell.Directory.Ldap.Asn1;
using Novell.Directory.Ldap.Rfc2251;
using Novell.Directory.Ldap.Utilclass;
-#if !TARGET_JVM
using Mono.Security.Protocol.Tls;
-#else
-using org.ietf.jgss;
-using javax.security.auth;
-using javax.security.auth.login;
-using java.security;
-
-using Novell.Directory.Ldap.Security;
-using System.Collections.Specialized;
-using System.Configuration;
-#endif
using System.Security.Cryptography.X509Certificates;
namespace Novell.Directory.Ldap
@@ -1199,13 +1188,6 @@ namespace Novell.Directory.Ldap
public virtual void Bind(System.String dn, System.String passwd, AuthenticationTypes authenticationTypes)
{
-#if TARGET_JVM
- if (authenticationTypes != AuthenticationTypes.None &&
- authenticationTypes != AuthenticationTypes.ServerBind &&
- authenticationTypes != AuthenticationTypes.Anonymous)
- BindSecure(dn, passwd, authenticationTypes);
- else
-#endif
Bind(Ldap_V3, dn, passwd, defSearchCons);
return ;
@@ -1542,11 +1524,6 @@ namespace Novell.Directory.Ldap
}
LdapMessage msg;
-#if TARGET_JVM
- if (mech != null)
- msg = new LdapBindRequest(version, "", mech, passwd, cons.getControls());
- else
-#endif
msg = new LdapBindRequest(version, dn, passwd, cons.getControls());
msgId = msg.MessageID;
@@ -1565,127 +1542,12 @@ namespace Novell.Directory.Ldap
}
}
-#if TARGET_JVM
- // stopping reader to enable stream replace after secure binding is complete, see Connection.ReplaceStreams()
- if (mech != null)
- {
- if (conn.BindSemIdClear) {
- // need to acquire a semaphore only if bindSemId is clear
- // because if we receive SASL_BIND_IN_PROGRESS the semaphore is not
- // released when the response is queued
- conn.acquireWriteSemaphore(msgId);
- conn.BindSemId = msgId;
- }
- conn.stopReaderOnReply(msgId);
- }
- else
-#endif
// The semaphore is released when the bind response is queued.
conn.acquireWriteSemaphore(msgId);
return SendRequestToServer(msg, cons.TimeLimit, queue, bindProps);
}
-#if TARGET_JVM
- private void BindSecure(System.String username, System.String password, AuthenticationTypes authenticationTypes)
- {
- if ((authenticationTypes & AuthenticationTypes.Secure) != 0) {
- LoginContext loginContext = null;
- try {
- if (username != null && password != null) {
- AuthenticationCallbackHandler callbackHandler = new AuthenticationCallbackHandler (username,password);
- loginContext = new LoginContext (SecurityAppName, callbackHandler);
- }
- else
- loginContext = new LoginContext (SecurityAppName);
-
- loginContext.login ();
- }
- catch (Exception e) {
- throw new LdapException ("Failed to create login security context", 80, "", e);
- }
-
- Krb5Helper krb5Helper = null;
- try {
- krb5Helper = new Krb5Helper ("ldap@" + conn.Host, username, loginContext.getSubject (), authenticationTypes, SecurityMech);
- }
- finally {
- loginContext.logout();
- }
- sbyte [] token = krb5Helper.ExchangeTokens (Krb5Helper.EmptyToken);
-
- for (;;) {
- LdapResponseQueue queue = Bind(LdapConnection.Ldap_V3, username, token, null, null, AuthenticationMech);
- LdapResponse res = (LdapResponse) queue.getResponse ();
- if (res.ResultCode != LdapException.SASL_BIND_IN_PROGRESS &&
- res.ResultCode != LdapException.SUCCESS) {
- krb5Helper.Dispose();
- throw new LdapException(ExceptionMessages.CONNECTION_ERROR, res.ResultCode, res.ErrorMessage);
- }
- Asn1OctetString serverSaslCreds = ((RfcBindResponse)res.Asn1Object.Response).ServerSaslCreds;
- token = serverSaslCreds != null ? serverSaslCreds.byteValue () : null;
-
- token = krb5Helper.ExchangeTokens(token == null ? Krb5Helper.EmptyToken : token);
-
- if (res.ResultCode != LdapException.SASL_BIND_IN_PROGRESS)
- break;
-
- conn.ReplaceStreams (conn.InputStream,conn.OutputStream);
- }
-
- System.IO.Stream inStream = conn.InputStream;
- System.IO.Stream newIn = new SecureStream (inStream, krb5Helper);
- System.IO.Stream outStream = conn.OutputStream;
- System.IO.Stream newOut = new SecureStream (outStream, krb5Helper);
- conn.ReplaceStreams (newIn,newOut);
- }
- }
-
- static string SecurityMech
- {
- get {
- string securityMech = null;
- NameValueCollection config = (NameValueCollection) ConfigurationSettings.GetConfig ("mainsoft.directoryservices/settings");
- if (config != null)
- securityMech = config ["securitymech"];
-
- if (securityMech == null)
- throw new ArgumentException("Security mechanism id not found in application settings");
-
- return securityMech;
- }
- }
-
- static string SecurityAppName
- {
- get {
- string securityAppName = null;
- NameValueCollection config = (NameValueCollection) ConfigurationSettings.GetConfig ("mainsoft.directoryservices/settings");
- if (config != null)
- securityAppName = config ["securityappname"];
-
- if (securityAppName == null)
- throw new ArgumentException("Application section name not found in application settings");
-
- return securityAppName;
- }
- }
-
- static string AuthenticationMech
- {
- get {
- string authenticationMech = null;
- NameValueCollection config = (NameValueCollection) ConfigurationSettings.GetConfig ("mainsoft.directoryservices/settings");
- if (config != null)
- authenticationMech = config ["authenticationmech"];
-
- if (authenticationMech == null)
- throw new ArgumentException("Authentication mechanism not found in application settings");
-
- return authenticationMech;
- }
- }
-#endif
//*************************************************************************
// compare methods
diff --git a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/SupportClass.cs b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/SupportClass.cs
index 0f9033a3dbe..450ad081648 100644
--- a/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/SupportClass.cs
+++ b/mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap/SupportClass.cs
@@ -87,14 +87,10 @@ using System;
[CLSCompliantAttribute(false)]
public static sbyte[] ToSByteArray(byte[] byteArray)
{
-#if TARGET_JVM
- return vmw.common.TypeUtils.ToSByteArray(byteArray);
-#else
sbyte[] sbyteArray = new sbyte[byteArray.Length];
for(int index=0; index < byteArray.Length; index++)
sbyteArray[index] = (sbyte) byteArray[index];
return sbyteArray;
-#endif
}
/*******************************/
/// <summary>
@@ -105,14 +101,10 @@ using System;
[CLSCompliantAttribute(false)]
public static byte[] ToByteArray(sbyte[] sbyteArray)
{
-#if TARGET_JVM
- return (byte[])vmw.common.TypeUtils.ToByteArray(sbyteArray);;
-#else
byte[] byteArray = new byte[sbyteArray.Length];
for(int index=0; index < sbyteArray.Length; index++)
byteArray[index] = (byte) sbyteArray[index];
return byteArray;
-#endif
}
/// <summary>