├── key.snk
├── SharpSSH-1.1.1.13.src
├── App.ico
├── ref
│ ├── DiffieHellman.dll
│ └── Org.Mentalis.Security.dll
├── java
│ ├── lang
│ │ ├── Runnable.cs
│ │ ├── Integer.cs
│ │ ├── Class.cs
│ │ ├── StringBuffer.cs
│ │ └── Thread.cs
│ ├── RuntimeException.cs
│ ├── Platform.cs
│ ├── Exception.cs
│ ├── io
│ │ ├── InputStreamWrapper.cs
│ │ ├── FileInputStream.cs
│ │ ├── FileOutputStream.cs
│ │ ├── File.cs
│ │ ├── OutputStream.cs
│ │ ├── InputStream.cs
│ │ └── JStream.cs
│ ├── util
│ │ ├── Arrays.cs
│ │ ├── JavaString.cs
│ │ ├── Enumeration.cs
│ │ ├── Hashtable.cs
│ │ └── Vector.cs
│ ├── net
│ │ ├── ServerSocket.cs
│ │ ├── InetAddress.cs
│ │ └── Socket.cs
│ └── System.cs
├── jsch
│ ├── ForwardedTCPIPDaemon.cs
│ ├── jce
│ │ ├── BlowfishCBC.cs
│ │ ├── SHA1.cs
│ │ ├── MD5.cs
│ │ ├── DH.cs
│ │ ├── Random.cs
│ │ ├── KeyPairGenDSA.cs
│ │ ├── HMACMD596.cs
│ │ ├── HMACMD5.cs
│ │ ├── HMACSHA196.cs
│ │ ├── HMACSHA1.cs
│ │ └── AES128CBC.cs
│ ├── ServerSocketFactory.cs
│ ├── SftpException.cs
│ ├── JSchException.cs
│ ├── JSchAuthCancelException.cs
│ ├── JSchPartialAuthException.cs
│ ├── Random.cs
│ ├── Request.cs
│ ├── DH.cs
│ ├── KeyPairGenDSA.cs
│ ├── HASH.cs
│ ├── UIKeyboardInteractive.cs
│ ├── MAC.cs
│ ├── SocketFactory.cs
│ ├── UserInfo.cs
│ ├── KeyPairGenRSA.cs
│ ├── Identity.cs
│ ├── SignatureDSA.cs
│ ├── SftpProgressMonitor.cs
│ ├── Proxy.cs
│ ├── Compression.cs
│ ├── SignatureRSA.cs
│ ├── Cipher.cs
│ ├── HostKeyRepository.cs
│ ├── RequestSignal.cs
│ ├── UserAuth.cs
│ ├── RequestShell.cs
│ ├── RequestPtyReq.cs
│ ├── examples
│ │ ├── ChangePassphrase.cs
│ │ └── KeyGen.cs
│ ├── RequestExec.cs
│ ├── RequestSftp.cs
│ ├── RequestX11.cs
│ ├── ChannelSftpStreamPut.cs
│ ├── RequestWindowChange.cs
│ ├── HostKey.cs
│ ├── ChannelShell.cs
│ ├── RequestSubsystem.cs
│ ├── ChannelSession.cs
│ ├── ChannelExec.cs
│ └── ChannelSubsystem.cs
├── SharpSSH.csproj.vspscc
├── Streams
│ ├── InputStream.cs
│ ├── OutputStream.cs
│ └── NoneBufferedStream.cs
├── SshTransferException.cs
├── AssemblyInfo.cs
└── ITransferProtocol.cs
├── Blogical.Shared.Adapters.Sftp_v1.3.doc
├── Blogical.Shared.Adapters.Sftp_v1.4.doc
├── Blogical.Shared.Adapters.Sftp_v1.5.doc
├── Blogical.Shared.Adapters.Sftp_v1.6.doc
├── Blogical.Shared.Adapters.Common
├── AssemblyInfo.cs
├── BaseAdapter.snk
├── Blogical.Shared.Adapters.Common.csproj.vspscc
├── EventLogInstall.cs
├── XmlSerializerSectionHandler.cs
├── ReceiverEndpoint.cs
├── AsyncTransmitterEndpoint.cs
├── Schedules
│ └── ScheduledTask.cs
├── SyncReceiveSubmitBatch.cs
└── ControlledTermination.cs
├── Blogical.Shared.Adapters.Sftp.Schemas
├── EmptyBatch.xsd
├── app.config
├── TransmitLocation.xsd
├── Properties
│ └── AssemblyInfo.cs
└── Blogical.Shared.Adapters.Sftp.Schemas.btproj.vspscc
├── Blogical.Shared.Adapters.Sftp.Management
├── ReceiveLocation.xsd
├── TransmitLocation.xsd
├── Blogical.Shared.Adapters.Sftp.Management.csproj.vspscc
├── SelectBizTalkApplication.cs
├── Installer.Designer.cs
├── Properties
│ └── AssemblyInfo.cs
├── Installer.cs
└── SftpResource.Designer.cs
├── ..svnbridge
└── Blogical.Shared.Adapters.Sftp_v1.5.doc
├── Blogical.Adapters.Sftp.vssscc
├── Blogical.Shared.Adapters.Sftp
├── Blogical.Shared.Adapters.Sftp.csproj.vspscc
├── CommonFunctions.cs
├── SftpExceptions.cs
├── SharpSsh
│ ├── MemoryInputStream.cs
│ └── MemoryOutputStream.cs
├── Properties
│ └── AssemblyInfo.cs
├── SftpTransmitter.cs
├── BatchMessage.cs
├── SSOConfigHelper.cs
└── SftpReceiver.cs
├── Blogical.Shared.Adapters.Sftp.Setup
└── Blogical.Shared.Adapters.Sftp.Setup.vdproj.vspscc
├── README.md
└── CreateTable.sql
/key.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wmmihaa/BizTalk-Sftp-Adapter/HEAD/key.snk
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/App.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wmmihaa/BizTalk-Sftp-Adapter/HEAD/SharpSSH-1.1.1.13.src/App.ico
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp_v1.3.doc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wmmihaa/BizTalk-Sftp-Adapter/HEAD/Blogical.Shared.Adapters.Sftp_v1.3.doc
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp_v1.4.doc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wmmihaa/BizTalk-Sftp-Adapter/HEAD/Blogical.Shared.Adapters.Sftp_v1.4.doc
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp_v1.5.doc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wmmihaa/BizTalk-Sftp-Adapter/HEAD/Blogical.Shared.Adapters.Sftp_v1.5.doc
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp_v1.6.doc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wmmihaa/BizTalk-Sftp-Adapter/HEAD/Blogical.Shared.Adapters.Sftp_v1.6.doc
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/ref/DiffieHellman.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wmmihaa/BizTalk-Sftp-Adapter/HEAD/SharpSSH-1.1.1.13.src/ref/DiffieHellman.dll
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Common/AssemblyInfo.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wmmihaa/BizTalk-Sftp-Adapter/HEAD/Blogical.Shared.Adapters.Common/AssemblyInfo.cs
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Common/BaseAdapter.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wmmihaa/BizTalk-Sftp-Adapter/HEAD/Blogical.Shared.Adapters.Common/BaseAdapter.snk
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp.Schemas/EmptyBatch.xsd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wmmihaa/BizTalk-Sftp-Adapter/HEAD/Blogical.Shared.Adapters.Sftp.Schemas/EmptyBatch.xsd
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/ref/Org.Mentalis.Security.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wmmihaa/BizTalk-Sftp-Adapter/HEAD/SharpSSH-1.1.1.13.src/ref/Org.Mentalis.Security.dll
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp.Schemas/app.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp.Schemas/TransmitLocation.xsd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wmmihaa/BizTalk-Sftp-Adapter/HEAD/Blogical.Shared.Adapters.Sftp.Schemas/TransmitLocation.xsd
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp.Management/ReceiveLocation.xsd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wmmihaa/BizTalk-Sftp-Adapter/HEAD/Blogical.Shared.Adapters.Sftp.Management/ReceiveLocation.xsd
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp.Management/TransmitLocation.xsd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wmmihaa/BizTalk-Sftp-Adapter/HEAD/Blogical.Shared.Adapters.Sftp.Management/TransmitLocation.xsd
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp.Schemas/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/wmmihaa/BizTalk-Sftp-Adapter/HEAD/Blogical.Shared.Adapters.Sftp.Schemas/Properties/AssemblyInfo.cs
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/lang/Runnable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.java.lang
4 | {
5 | ///
6 | /// Summary description for Runnable.
7 | ///
8 | public interface Runnable
9 | {
10 | void run();
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/..svnbridge/Blogical.Shared.Adapters.Sftp_v1.5.doc:
--------------------------------------------------------------------------------
1 | svn:mime-typeapplication/octet-stream
--------------------------------------------------------------------------------
/Blogical.Adapters.Sftp.vssscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT"
10 | }
11 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/ForwardedTCPIPDaemon.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Tamir.SharpSsh.java.lang;
3 |
4 | namespace Tamir.SharpSsh.jsch
5 | {
6 | public interface ForwardedTCPIPDaemon : Runnable
7 | {
8 | void setChannel(ChannelForwardedTCPIP channel);
9 | void setArg(Object[] arg);
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/SharpSSH.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp/Blogical.Shared.Adapters.Sftp.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Common/Blogical.Shared.Adapters.Common.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/jce/BlowfishCBC.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch.jce
4 | {
5 | ///
6 | /// Summary description for BlowfishCBC.
7 | ///
8 | public class BlowfishCBC
9 | {
10 | public BlowfishCBC()
11 | {
12 | //
13 | // TODO: Add constructor logic here
14 | //
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp.Setup/Blogical.Shared.Adapters.Sftp.Setup.vdproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp.Schemas/Blogical.Shared.Adapters.Sftp.Schemas.btproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp.Management/Blogical.Shared.Adapters.Sftp.Management.csproj.vspscc:
--------------------------------------------------------------------------------
1 | ""
2 | {
3 | "FILE_VERSION" = "9237"
4 | "ENLISTMENT_CHOICE" = "NEVER"
5 | "PROJECT_FILE_RELATIVE_PATH" = ""
6 | "NUMBER_OF_EXCLUDED_FILES" = "0"
7 | "ORIGINAL_PROJECT_FILE_PATH" = ""
8 | "NUMBER_OF_NESTED_PROJECTS" = "0"
9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
10 | }
11 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/RuntimeException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.java
4 | {
5 | ///
6 | /// Summary description for RuntimeException.
7 | ///
8 | public class RuntimeException : Exception
9 | {
10 | public RuntimeException()
11 | {
12 | //
13 | // TODO: Add constructor logic here
14 | //
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/ServerSocketFactory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Tamir.SharpSsh.java.net;
3 |
4 | namespace Tamir.SharpSsh.jsch
5 | {
6 | ///
7 | /// Summary description for ServerSocketFactory.
8 | ///
9 | public interface ServerSocketFactory
10 | {
11 | ServerSocket createServerSocket(int port, int backlog, InetAddress bindAddr);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/Platform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.java
4 | {
5 | ///
6 | /// Summary description for Platform.
7 | ///
8 | public class Platform
9 | {
10 | public static bool Windows
11 | {
12 | get
13 | {
14 | return Environment.OSVersion.Platform.ToString().StartsWith("Win");
15 | }
16 | }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/SftpException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | public class SftpException : java.Exception
6 | {
7 | public int id;
8 | public String message;
9 | public SftpException (int id, String message):base()
10 | {
11 | this.id=id;
12 | this.message=message;
13 | }
14 | public override String toString()
15 | {
16 | return message;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/Exception.cs:
--------------------------------------------------------------------------------
1 | using Ex = System.Exception;
2 |
3 | namespace Tamir.SharpSsh.java
4 | {
5 | ///
6 | /// Summary description for Exception.
7 | ///
8 | public class Exception : Ex
9 | {
10 | public Exception() : base()
11 | {
12 | }
13 | public Exception(string msg) : base(msg)
14 | {
15 | }
16 |
17 | public virtual string toString()
18 | {
19 | return ToString();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/JSchException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | ///
6 | /// Summary description for JSchException.
7 | ///
8 | public class JSchException : java.Exception
9 | {
10 | public JSchException() : base()
11 | {
12 | //
13 | // TODO: Add constructor logic here
14 | //
15 | }
16 |
17 | public JSchException(string msg) : base (msg)
18 | {
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/lang/Integer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.java.lang
4 | {
5 | ///
6 | /// Summary description for Integer.
7 | ///
8 | public class Integer
9 | {
10 | private int i;
11 | public Integer(int i)
12 | {
13 | this.i = i;
14 | }
15 | public int intValue()
16 | {
17 | return i;
18 | }
19 | public static int parseInt(string s)
20 | {
21 | return int.Parse(s);
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/JSchAuthCancelException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | ///
6 | /// Summary description for JSchException.
7 | ///
8 | public class JSchAuthCancelException : JSchException
9 | {
10 | public JSchAuthCancelException() : base()
11 | {
12 | //
13 | // TODO: Add constructor logic here
14 | //
15 | }
16 |
17 | public JSchAuthCancelException(string msg) : base (msg)
18 | {
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/io/InputStreamWrapper.cs:
--------------------------------------------------------------------------------
1 | using Tamir.SharpSsh.java.io;
2 |
3 | namespace Tamir.Streams
4 | {
5 | ///
6 | /// Summary description for InputStreamWrapper.
7 | ///
8 | public class InputStreamWrapper : InputStream
9 | {
10 | System.IO.Stream s;
11 | public InputStreamWrapper(System.IO.Stream s)
12 | {
13 | this.s = s;
14 | }
15 |
16 | public override int Read(byte[] buffer, int offset, int count)
17 | {
18 | return s.Read(buffer, offset, count);
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/util/Arrays.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.java.util
4 | {
5 | ///
6 | /// Summary description for Arrays.
7 | ///
8 | public class Arrays
9 | {
10 | internal static bool equals(byte[] foo, byte[] bar)
11 | {
12 | int i=foo.Length;
13 | if(i!=bar.Length) return false;
14 | for(int j=0; j
6 | /// Summary description for JavaString.
7 | ///
8 | public class JavaString : Tamir.SharpSsh.java.String
9 | {
10 | public JavaString(string s) : base(s)
11 | {
12 | }
13 |
14 | public JavaString(object o):base(o)
15 | {
16 | }
17 |
18 | public JavaString(byte[] arr):base(arr)
19 | {
20 | }
21 |
22 | public JavaString(byte[] arr, int offset, int len):base(arr, offset, len)
23 | {
24 | }
25 |
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/JSchPartialAuthException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | ///
6 | /// Summary description for JSchException.
7 | ///
8 | public class JSchPartialAuthException : JSchException
9 | {
10 | string methods;
11 | public JSchPartialAuthException() : base()
12 | {
13 | methods = null;
14 | }
15 |
16 | public JSchPartialAuthException(string msg) : base (msg)
17 | {
18 | methods = msg;
19 | }
20 |
21 | public String getMethods()
22 | {
23 | return methods;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Common/EventLogInstall.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Diagnostics;
3 | using System.ComponentModel;
4 | using System.Configuration.Install;
5 | using System.Windows.Forms;
6 | using Blogical.Shared.Adapters.Common;
7 |
8 | [RunInstaller(true)]
9 | public class MyEventLogInstaller : Installer
10 | {
11 | public MyEventLogInstaller()
12 | {
13 | EventLogInstaller installer = new EventLogInstaller();
14 | installer.Log = "Application";
15 | installer.Source = EventLogSources.SFTPAdapter;
16 |
17 | Installers.Add(installer);
18 | }
19 | }
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/lang/Class.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.java.lang
4 | {
5 | ///
6 | /// Summary description for Class.
7 | ///
8 | public class Class
9 | {
10 | Type t;
11 | private Class(Type t)
12 | {
13 | this.t=t;
14 | }
15 | private Class(string typeName) : this(Type.GetType(typeName))
16 | {
17 | }
18 | public static Class forName(string name)
19 | {
20 | return new Class(name);
21 | }
22 |
23 | public object newInstance()
24 | {
25 | return Activator.CreateInstance(t);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp/CommonFunctions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.IO;
5 |
6 | namespace Blogical.Shared.Adapters.Sftp
7 | {
8 | internal static class CommonFunctions
9 | {
10 | public static string CombinePath(params string[] parts)
11 | {
12 | string path = parts[0];
13 |
14 | for (int i = 1; i < parts.Length; i++)
15 | {
16 | path = Path.Combine(path, parts[i].Trim('/', '\\'));
17 | }
18 |
19 | return path.Replace("\\", "/");
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/net/ServerSocket.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 | using System.Net.Sockets;
4 |
5 | namespace Tamir.SharpSsh.java.net
6 | {
7 | ///
8 | /// Summary description for ServerSocket.
9 | ///
10 | public class ServerSocket : TcpListener
11 | {
12 | public ServerSocket(int port, int arg, InetAddress addr) : base(addr.addr, port)
13 | {
14 | this.Start();
15 | }
16 |
17 | public Tamir.SharpSsh.java.net.Socket accept()
18 | {
19 | return new Tamir.SharpSsh.java.net.Socket( this.AcceptSocket() );
20 | }
21 |
22 | public void close()
23 | {
24 | this.Stop();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/util/Enumeration.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 |
4 | namespace Tamir.SharpSsh.java.util
5 | {
6 | ///
7 | /// Summary description for Enumeration.
8 | ///
9 | public class Enumeration
10 | {
11 | private IEnumerator e;
12 | private bool hasMore;
13 | public Enumeration(IEnumerator e)
14 | {
15 | this.e=e;
16 | hasMore = e.MoveNext();
17 | }
18 |
19 | public bool hasMoreElements()
20 | {
21 | return hasMore;
22 | }
23 |
24 | public object nextElement()
25 | {
26 | object o = e.Current;
27 | hasMore = e.MoveNext();
28 | return o;
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Common/XmlSerializerSectionHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using System.Configuration;
5 |
6 | namespace Blogical.Shared.Adapters.Common
7 | {
8 | public class XmlSerializerSectionHandler : IConfigurationSectionHandler
9 | {
10 | ///
11 | /// Create
12 | ///
13 | /// parent
14 | /// configContext
15 | /// section
16 | /// object
17 | public object Create(object parent, object configContext, System.Xml.XmlNode section)
18 | {
19 | return section;
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp/SftpExceptions.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.Serialization;
3 | using Blogical.Shared.Adapters.Common;
4 |
5 | namespace Blogical.Shared.Adapters.Sftp
6 | {
7 | internal class SftpException : ApplicationException
8 | {
9 | public static string UnhandledTransmit_Error = "The Sftp Adapter encounted an error transmitting a batch of messages.";
10 |
11 | public SftpException () { }
12 |
13 | public SftpException (string msg) : base(msg) { }
14 |
15 | public SftpException (Exception inner) : base(String.Empty, inner) { }
16 |
17 | public SftpException (string msg, Exception e) : base(msg, e) { }
18 |
19 | protected SftpException(SerializationInfo info, StreamingContext context) : base(info, context) { }
20 | }
21 | }
22 |
23 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/util/Hashtable.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Collections = System.Collections;
3 |
4 | namespace Tamir.SharpSsh.java.util
5 | {
6 | ///
7 | /// Summary description for Hashtable.
8 | ///
9 | public class Hashtable
10 | {
11 | internal Collections.Hashtable h;
12 |
13 | public Hashtable()
14 | {
15 | h= new Collections.Hashtable();
16 | }
17 | public Hashtable(Collections.Hashtable h)
18 | {
19 | this.h=h;
20 | }
21 |
22 | public void put(object key, object item)
23 | {
24 | h.Add(key, item);
25 | }
26 |
27 | public object get(object key)
28 | {
29 | return h[key];
30 | }
31 |
32 | public Enumeration keys()
33 | {
34 | return new Enumeration( h.Keys.GetEnumerator() );
35 | }
36 |
37 | public object this[object key]
38 | {
39 | get{return get(key);}
40 | set{h[key]=value;}
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/System.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.java
4 | {
5 | ///
6 | /// Summary description for System.
7 | ///
8 | public class System
9 | {
10 | public static Out Out = new Out();
11 | public static Err err = new Err();
12 | public static void arraycopy(Array a1, long sourceIndex, Array a2, long destIndex, long len)
13 | {
14 | Array.Copy(a1, sourceIndex, a2, destIndex, len);
15 | }
16 | }
17 |
18 | public class Out
19 | {
20 | public void print(string v)
21 | {
22 | Console.Write(v);
23 | }
24 |
25 | public void println(string v)
26 | {
27 | Console.WriteLine(v);
28 | }
29 | }
30 |
31 | public class Err
32 | {
33 | public void print(string v)
34 | {
35 | Console.Error.Write(v);
36 | }
37 |
38 | public void println(string v)
39 | {
40 | Console.Error.WriteLine(v);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/io/FileInputStream.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using IO = System.IO;
3 |
4 | namespace Tamir.SharpSsh.java.io
5 | {
6 | ///
7 | /// Summary description for FileInputStream.
8 | ///
9 | public class FileInputStream : InputStream
10 | {
11 | IO.FileStream fs;
12 | public FileInputStream(string file)
13 | {
14 | fs = IO.File.OpenRead(file);
15 | }
16 |
17 | public FileInputStream(File file):this(file.info.Name)
18 | {
19 | }
20 |
21 | public override void Close()
22 | {
23 | fs.Close();
24 | }
25 |
26 |
27 | public override int Read(byte[] buffer, int offset, int count)
28 | {
29 | return fs.Read(buffer, offset, count);
30 | }
31 |
32 | public override bool CanSeek
33 | {
34 | get
35 | {
36 | return fs.CanSeek;
37 | }
38 | }
39 |
40 | public override long Seek(long offset, IO.SeekOrigin origin)
41 | {
42 | return fs.Seek(offset, origin);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp.Management/SelectBizTalkApplication.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Text;
7 | using System.Windows.Forms;
8 |
9 | namespace Blogical.Shared.Adapters.Sftp.Management
10 | {
11 | public partial class SelectBizTalkApplication : Form
12 | {
13 | public SelectBizTalkApplication()
14 | {
15 | InitializeComponent();
16 | }
17 |
18 | private void btnYes_Click(object sender, EventArgs e)
19 | {
20 | this.DialogResult = DialogResult.Yes;
21 | this.Close();
22 | }
23 |
24 | private void btnNo_Click(object sender, EventArgs e)
25 | {
26 | this.Close();
27 | }
28 |
29 | private void SelectBizTalkApplication_Load(object sender, EventArgs e)
30 | {
31 | this.TopMost = true;
32 | }
33 | }
34 | }
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/util/Vector.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 |
4 | namespace Tamir.SharpSsh.java.util
5 | {
6 | ///
7 | /// Summary description for Vector.
8 | ///
9 | public class Vector : ArrayList
10 | {
11 | public int size()
12 | {
13 | return this.Count;
14 | }
15 |
16 | public void addElement(object o)
17 | {
18 | this.Add(o);
19 | }
20 |
21 | public void add(object o)
22 | {
23 | addElement(o);
24 | }
25 |
26 | public void removeElement(object o)
27 | {
28 | this.Remove(o);
29 | }
30 |
31 | public bool remove(object o)
32 | {
33 | this.Remove(o);
34 | return true;
35 | }
36 |
37 | public object elementAt(int i)
38 | {
39 | return this[i];
40 | }
41 |
42 | public object get(int i)
43 | {
44 | return elementAt(i);;
45 | }
46 |
47 | public void clear()
48 | {
49 | this.Clear();
50 | }
51 |
52 | public string toString()
53 | {
54 | return ToString();
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp/SharpSsh/MemoryInputStream.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using IO = System.IO;
3 | using Tamir.SharpSsh.java.io;
4 | using Microsoft.BizTalk.Streaming;
5 |
6 | namespace Blogical.Shared.Adapters.Sftp.SharpSsh
7 | {
8 |
9 |
10 | ///
11 | /// Summary description for MemoryOutputStream.
12 | ///
13 | class MemoryInputStream : InputStream
14 | {
15 | IO.Stream fs;
16 | public MemoryInputStream(IO.Stream memStream)
17 | {
18 | fs = memStream;
19 | }
20 |
21 | public override void Close()
22 | {
23 | fs.Close();
24 | }
25 |
26 | public override int Read(byte[] buffer, int offset, int count)
27 | {
28 | return fs.Read(buffer, offset, count);
29 | }
30 |
31 | public override bool CanSeek
32 | {
33 | get
34 | {
35 | return fs.CanSeek;
36 | }
37 | }
38 |
39 | public override long Seek(long offset, IO.SeekOrigin origin)
40 | {
41 | return fs.Seek(offset, origin);
42 | }
43 | }
44 | }
45 |
46 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp.Management/Installer.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace Blogical.Shared.Adapters.Sftp.Management
2 | {
3 | partial class Installer
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Component Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | components = new System.ComponentModel.Container();
32 | }
33 |
34 | #endregion
35 | }
36 | }
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/lang/StringBuffer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Text;
3 |
4 | namespace Tamir.SharpSsh.java.lang
5 | {
6 | ///
7 | /// Summary description for StringBuffer.
8 | ///
9 | public class StringBuffer
10 | {
11 | StringBuilder sb;
12 | public StringBuffer()
13 | {
14 | sb = new StringBuilder();
15 | }
16 |
17 | public StringBuffer(string s)
18 | {
19 | sb = new StringBuilder(s);
20 | }
21 |
22 | public StringBuffer(StringBuilder sb):this(sb.ToString())
23 | {
24 | }
25 |
26 | public StringBuffer(Tamir.SharpSsh.java.String s):this(s.ToString())
27 | {
28 | }
29 |
30 | public StringBuffer append(string s)
31 | {
32 | sb.Append(s);
33 | return this;
34 | }
35 |
36 | public StringBuffer append(char s)
37 | {
38 | sb.Append(s);
39 | return this;
40 | }
41 |
42 | public StringBuffer append(Tamir.SharpSsh.java.String s)
43 | {
44 | return append(s.ToString());
45 | }
46 |
47 | public StringBuffer delete(int start, int end)
48 | {
49 | sb.Remove(start, end-start);
50 | return this;
51 | }
52 |
53 | public override string ToString()
54 | {
55 | return sb.ToString();
56 | }
57 |
58 | public string toString()
59 | {
60 | return ToString();
61 | }
62 |
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/io/FileOutputStream.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using IO = System.IO;
3 |
4 | namespace Tamir.SharpSsh.java.io
5 | {
6 | ///
7 | /// Summary description for FileInputStream.
8 | ///
9 | public class FileOutputStream : OutputStream
10 | {
11 | IO.FileStream fs;
12 | public FileOutputStream(string file):this(file, false)
13 | {
14 | }
15 |
16 | public FileOutputStream(File file):this(file.info.Name, false)
17 | {
18 | }
19 |
20 | public FileOutputStream(string file, bool append)
21 | {
22 | if(append)
23 | fs = new IO.FileStream(file, IO.FileMode.Append); // append
24 | else
25 | fs = new IO.FileStream(file, IO.FileMode.Create);
26 | }
27 |
28 | public FileOutputStream(File file, bool append):this(file.info.Name)
29 | {
30 | }
31 |
32 | public override void Write(byte[] buffer, int offset, int count)
33 | {
34 | fs.Write(buffer, offset, count);
35 | }
36 |
37 | public override void Flush()
38 | {
39 | fs.Flush();
40 | }
41 |
42 | public override void Close()
43 | {
44 | fs.Close();
45 | }
46 |
47 | public override bool CanSeek
48 | {
49 | get
50 | {
51 | return fs.CanSeek;
52 | }
53 | }
54 |
55 | public override long Seek(long offset, IO.SeekOrigin origin)
56 | {
57 | return fs.Seek(offset, origin);
58 | }
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/net/InetAddress.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 |
4 | namespace Tamir.SharpSsh.java.net
5 | {
6 | ///
7 | /// Summary description for InetAddress.
8 | ///
9 | public class InetAddress
10 | {
11 | internal IPAddress addr;
12 | public InetAddress(string addr)
13 | {
14 | this.addr = IPAddress.Parse(addr);
15 | }
16 | public InetAddress(IPAddress addr)
17 | {
18 | this.addr = addr;
19 | }
20 |
21 | public bool isAnyLocalAddress()
22 | {
23 | return IPAddress.IsLoopback(addr);
24 | }
25 |
26 | public bool equals(InetAddress addr)
27 | {
28 | return addr.ToString().Equals( addr.ToString());
29 | }
30 |
31 | public bool equals(string addr)
32 | {
33 | return addr.ToString().Equals( addr.ToString());
34 | }
35 |
36 | public override string ToString()
37 | {
38 | return addr.ToString ();
39 | }
40 |
41 | public override bool Equals(object obj)
42 | {
43 | return equals (obj.ToString());
44 | }
45 |
46 | public string getHostAddress()
47 | {
48 | return ToString();
49 | }
50 |
51 | public override int GetHashCode()
52 | {
53 | return base.GetHashCode ();
54 | }
55 |
56 | public static InetAddress getByName(string name)
57 | {
58 | return new InetAddress( Dns.GetHostByName(name).AddressList[0] );
59 | }
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/Streams/InputStream.cs:
--------------------------------------------------------------------------------
1 | //using System;
2 | //using System.IO;
3 | //
4 | //namespace Tamir.Streams
5 | //{
6 | // ///
7 | // /// Summary description for InputStream.
8 | // ///
9 | // public abstract class InputStream : Stream
10 | // {
11 | // public override void WriteByte(byte value)
12 | // {
13 | // }
14 | //
15 | // public override void Write(byte[] buffer, int offset, int count)
16 | // {
17 | // }
18 | //
19 | // public override bool CanRead
20 | // {
21 | // get
22 | // {
23 | // return true;
24 | // }
25 | // }
26 | // public override bool CanWrite
27 | // {
28 | // get
29 | // {
30 | // return false;
31 | // }
32 | // }
33 | // public override bool CanSeek
34 | // {
35 | // get
36 | // {
37 | // return false;
38 | // }
39 | // }
40 | // public override void Flush()
41 | // {
42 | //
43 | // }
44 | // public override long Length
45 | // {
46 | // get
47 | // {
48 | // return 0;
49 | // }
50 | // }
51 | // public override long Position
52 | // {
53 | // get
54 | // {
55 | // return 0;
56 | // }
57 | // set
58 | // {
59 | // }
60 | // }
61 | // public override void SetLength(long value)
62 | // {
63 | // }
64 | // public override long Seek(long offset, SeekOrigin origin)
65 | // {
66 | // return 0;
67 | // }
68 | // }
69 | //}
70 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/Streams/OutputStream.cs:
--------------------------------------------------------------------------------
1 | //using System;
2 | //using System.IO;
3 | //
4 | //namespace Tamir.Streams
5 | //{
6 | // ///
7 | // /// Summary description for OutputStream.
8 | // ///
9 | // public abstract class OutputStream : Stream
10 | // {
11 | // public override int Read(byte[] buffer, int offset, int count)
12 | // {
13 | // return 0;
14 | // }
15 | //
16 | // public override int ReadByte()
17 | // {
18 | // return 0;
19 | // }
20 | //
21 | // public override bool CanRead
22 | // {
23 | // get
24 | // {
25 | // return false;
26 | // }
27 | // }
28 | // public override bool CanWrite
29 | // {
30 | // get
31 | // {
32 | // return true;
33 | // }
34 | // }
35 | // public override bool CanSeek
36 | // {
37 | // get
38 | // {
39 | // return false;
40 | // }
41 | // }
42 | // public override void Flush()
43 | // {
44 | // }
45 | // public override long Length
46 | // {
47 | // get
48 | // {
49 | // return 0;
50 | // }
51 | // }
52 | // public override long Position
53 | // {
54 | // get
55 | // {
56 | // return 0;
57 | // }
58 | // set
59 | // {
60 | // }
61 | // }
62 | // public override void SetLength(long value)
63 | // {
64 | // }
65 | // public override long Seek(long offset, SeekOrigin origin)
66 | // {
67 | // return 0;
68 | // }
69 | // }
70 | //}
71 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/lang/Thread.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 | using Threading = System.Threading;
4 |
5 | namespace Tamir.SharpSsh.java.lang
6 | {
7 | ///
8 | /// Summary description for Thread.
9 | ///
10 | public class Thread
11 | {
12 | Threading.Thread t;
13 |
14 | public Thread(Threading.Thread t)
15 | {
16 | this.t=t;
17 | }
18 | public Thread(ThreadStart ts):this(new Threading.Thread(ts))
19 | {
20 | }
21 |
22 | public Thread(Runnable r):this(new ThreadStart(r.run))
23 | {
24 | }
25 |
26 | public void setName(string name)
27 | {
28 | t.Name=name;
29 | }
30 |
31 | public void start()
32 | {
33 | t.Start();
34 | }
35 |
36 | public bool isAlive()
37 | {
38 | return t.IsAlive;
39 | }
40 |
41 | public void yield()
42 | {
43 | }
44 |
45 | public void interrupt()
46 | {
47 | try
48 | {
49 | t.Interrupt();
50 | }catch
51 | {
52 | }
53 | }
54 |
55 | public void notifyAll()
56 | {
57 | Monitor.PulseAll(this);
58 | }
59 |
60 | public static void Sleep(int t)
61 | {
62 | Threading.Thread.Sleep(t);
63 | }
64 |
65 | public static void sleep(int t)
66 | {
67 | Sleep(t);
68 | }
69 |
70 | public static Thread currentThread()
71 | {
72 | return new Thread( Threading.Thread.CurrentThread );
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/io/File.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 |
4 | namespace Tamir.SharpSsh.java.io
5 | {
6 | ///
7 | /// Summary description for File.
8 | ///
9 | public class File
10 | {
11 | string file;
12 | internal FileInfo info;
13 |
14 | public File(string file)
15 | {
16 | this.file = file;
17 | info = new FileInfo(file);
18 | }
19 |
20 | public string getCanonicalPath()
21 | {
22 | return Path.GetFullPath(file);
23 | }
24 |
25 | public bool isDirectory()
26 | {
27 | return Directory.Exists(file);
28 | }
29 |
30 | public long Length()
31 | {
32 | return info.Length;
33 | }
34 |
35 | public long length()
36 | {
37 | return Length();
38 | }
39 |
40 | public bool isAbsolute()
41 | {
42 | return Path.IsPathRooted(file);
43 | }
44 |
45 | public java.String[] list()
46 | {
47 | string [] dirs = Directory.GetDirectories(file);
48 | string [] files = Directory.GetFiles(file);
49 | java.String[] _list = new java.String[dirs.Length+files.Length];
50 | System.arraycopy(dirs, 0, _list, 0, dirs.Length);
51 | System.arraycopy(files, 0, _list, dirs.Length, files.Length);
52 | return _list;
53 | }
54 |
55 | public static string separator
56 | {
57 | get
58 | {
59 | return Path.DirectorySeparatorChar.ToString();
60 | }
61 | }
62 |
63 | public static char separatorChar
64 | {
65 | get
66 | {
67 | return Path.DirectorySeparatorChar;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/io/OutputStream.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 |
4 | namespace Tamir.SharpSsh.java.io
5 | {
6 | ///
7 | /// Summary description for InputStream.
8 | ///
9 | public abstract class OutputStream : Stream
10 | {
11 | public override int Read(byte[] buffer, int offset, int count)
12 | {
13 | return 0;
14 | }
15 |
16 | public override int ReadByte()
17 | {
18 | return 0;
19 | }
20 |
21 | public virtual void write(byte[] buffer, int offset, int count)
22 | {
23 | Write(buffer, offset, count);
24 | }
25 |
26 | public virtual void close()
27 | {
28 | Close();
29 | }
30 |
31 | public virtual void flush()
32 | {
33 | Flush();
34 | }
35 |
36 | public override bool CanRead
37 | {
38 | get
39 | {
40 | return false;
41 | }
42 | }
43 | public override bool CanWrite
44 | {
45 | get
46 | {
47 | return true;
48 | }
49 | }
50 | public override bool CanSeek
51 | {
52 | get
53 | {
54 | return false;
55 | }
56 | }
57 | public override void Flush()
58 | {
59 | }
60 | public override long Length
61 | {
62 | get
63 | {
64 | return 0;
65 | }
66 | }
67 | public override long Position
68 | {
69 | get
70 | {
71 | return 0;
72 | }
73 | set
74 | {
75 | }
76 | }
77 | public override void SetLength(long value)
78 | {
79 | }
80 | public override long Seek(long offset, SeekOrigin origin)
81 | {
82 | return 0;
83 | }
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Blogical.Shared.Adapters.Sftp")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Blogical")]
12 | [assembly: AssemblyProduct("Blogical.Shared.Adapters.Sftp")]
13 | [assembly: AssemblyCopyright("Copyright © Blogical 2007")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("01266b97-316d-4855-b925-290d4b734593")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp.Management/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("Blogical.Shared.Adapters.Sftp.Management")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("Blogical")]
12 | [assembly: AssemblyProduct("Blogical.Shared.Adapters.Sftp.Management")]
13 | [assembly: AssemblyCopyright("Copyright © Blogical 2007")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("9c585421-75e0-4c4c-90e3-9bbe053ef400")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Revision and Build Numbers
33 | // by using the '*' as shown below:
34 | [assembly: AssemblyVersion("1.0.0.0")]
35 | [assembly: AssemblyFileVersion("1.0.0.0")]
36 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp.Management/Installer.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Configuration.Install;
5 | using System.Windows.Forms;
6 | using System.Collections;
7 |
8 | namespace Blogical.Shared.Adapters.Sftp.Management
9 | {
10 | [RunInstaller(true)]
11 | public partial class Installer : System.Configuration.Install.Installer
12 | {
13 | public Installer()
14 | {
15 | InitializeComponent();
16 | }
17 |
18 | protected override void OnAfterInstall(System.Collections.IDictionary savedState)
19 | {
20 | string path = System.IO.Path.GetDirectoryName(Context.Parameters["assemblypath"]);
21 |
22 | string scriptArgs = "AddResource /Type:System.BizTalk:BizTalkAssembly /Overwrite /Source:\"" + path + "/Blogical.Shared.Adapters.Sftp.Schemas.dll\" /Destination:\"" + path + "/Blogical.Shared.Adapters.Sftp.Schemas.dll\" /Options:GacOnAdd";
23 |
24 | string appName = Context.Parameters["appname"];
25 | if (!String.IsNullOrEmpty(appName))
26 | {
27 | scriptArgs += " /ApplicationName:" + appName;
28 | }
29 |
30 | SelectBizTalkApplication form = new SelectBizTalkApplication();
31 | form.TopMost = true;
32 |
33 | if (!String.IsNullOrEmpty(appName) || form.ShowDialog() == DialogResult.Yes)
34 | {
35 | System.Diagnostics.Process proc = System.Diagnostics.Process.Start("BTSTask.exe", scriptArgs);
36 | proc.WaitForExit();
37 | }
38 |
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/Random.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public interface Random
35 | {
36 | void fill(byte[] foo, int start, int len);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/Request.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | internal interface Request
35 | {
36 | bool waitForReply();
37 | void request(Session session, Channel channel);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/DH.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public interface DH
35 | {
36 | void init();
37 | void setP(byte[] p);
38 | void setG(byte[] g);
39 | byte[] getE();
40 | void setF(byte[] f);
41 | byte[] getK();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/KeyPairGenDSA.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public interface KeyPairGenDSA
35 | {
36 | void init(int key_size);
37 | byte[] getX();
38 | byte[] getY();
39 | byte[] getP();
40 | byte[] getQ();
41 | byte[] getG();
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/HASH.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public abstract class HASH
35 | {
36 | public abstract void init();
37 | public abstract int getBlockSize();
38 | public abstract void update(byte[] foo, int start, int len);
39 | public abstract byte[] digest();
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/UIKeyboardInteractive.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public interface UIKeyboardInteractive
35 | {
36 | String[] promptKeyboardInteractive(String destination,
37 | String name,
38 | String instruction,
39 | String[] prompt,
40 | bool[] echo);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/MAC.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public interface MAC
35 | {
36 | String getName();
37 | int getBlockSize();
38 | void init(byte[] key);
39 | void update(byte[] foo, int start, int len);
40 | void update(int foo);
41 | byte[] doFinal();
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/SocketFactory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Tamir.SharpSsh.java.net;
3 | using System.IO;
4 |
5 | namespace Tamir.SharpSsh.jsch
6 | {
7 | /* -*-mode:java; c-basic-offset:2; -*- */
8 | /*
9 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
10 |
11 | Redistribution and use in source and binary forms, with or without
12 | modification, are permitted provided that the following conditions are met:
13 |
14 | 1. Redistributions of source code must retain the above copyright notice,
15 | this list of conditions and the following disclaimer.
16 |
17 | 2. Redistributions in binary form must reproduce the above copyright
18 | notice, this list of conditions and the following disclaimer in
19 | the documentation and/or other materials provided with the distribution.
20 |
21 | 3. The names of the authors may not be used to endorse or promote products
22 | derived from this software without specific prior written permission.
23 |
24 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
25 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
26 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
27 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
30 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
33 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 | */
35 |
36 | public interface SocketFactory
37 | {
38 | Socket createSocket(String host, int port);
39 | Stream getInputStream(Socket socket);
40 | Stream getOutputStream(Socket socket);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/UserInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public interface UserInfo
35 | {
36 | String getPassphrase();
37 | String getPassword();
38 | bool promptPassword(String message);
39 | bool promptPassphrase(String message);
40 | bool promptYesNo(String message);
41 | void showMessage(String message);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/KeyPairGenRSA.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public interface KeyPairGenRSA
35 | {
36 | void init(int key_size);
37 | byte[] getD();
38 | byte[] getE();
39 | byte[] getN();
40 |
41 | byte[] getC();
42 | byte[] getEP();
43 | byte[] getEQ();
44 | byte[] getP();
45 | byte[] getQ();
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/Identity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | internal interface Identity
35 | {
36 | bool setPassphrase(String passphrase);
37 | byte[] getPublicKeyBlob();
38 | byte[] getSignature(Session session, byte[] data);
39 | bool decrypt();
40 | String getAlgName();
41 | String getName();
42 | bool isEncrypted();
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/SignatureDSA.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public interface SignatureDSA
35 | {
36 | void init();
37 | void setPubKey(byte[] y, byte[] p, byte[] q, byte[] g);
38 | void setPrvKey(byte[] x, byte[] p, byte[] q, byte[] g);
39 | void update(byte[] H);
40 | bool verify(byte[] sig);
41 | byte[] sign();
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/SftpProgressMonitor.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public abstract class SftpProgressMonitor
35 | {
36 | public static int PUT=0;
37 | public static int GET=1;
38 | public abstract void init(int op, String src, String dest, long max);
39 | public abstract bool count(long count);
40 | public abstract void end();
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/SshTransferException.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | /*
4 | * SshTransferException.cs
5 | *
6 | * Copyright (c) 2006 Tamir Gal, http://www.tamirgal.com, All rights reserved.
7 | *
8 | * Redistribution and use in source and binary forms, with or without
9 | * modification, are permitted provided that the following conditions are met:
10 | *
11 | * 1. Redistributions of source code must retain the above copyright notice,
12 | * this list of conditions and the following disclaimer.
13 | *
14 | * 2. Redistributions in binary form must reproduce the above copyright
15 | * notice, this list of conditions and the following disclaimer in
16 | * the documentation and/or other materials provided with the distribution.
17 | *
18 | * 3. The names of the authors may not be used to endorse or promote products
19 | * derived from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
22 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
23 | * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
24 | * *OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
27 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 | *
32 | **/
33 | namespace Tamir.SharpSsh
34 | {
35 | ///
36 | /// Summary description for SshTransferException.
37 | ///
38 | public class SshTransferException : Exception
39 | {
40 | public SshTransferException(string msg):base(msg)
41 | {
42 | }
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/Proxy.cs:
--------------------------------------------------------------------------------
1 | using Tamir.SharpSsh.java;
2 | using System.IO;
3 | using Tamir.SharpSsh.java.net;
4 |
5 | namespace Tamir.SharpSsh.jsch
6 | {
7 | /* -*-mode:java; c-basic-offset:2; -*- */
8 | /*
9 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
10 |
11 | Redistribution and use in source and binary forms, with or without
12 | modification, are permitted provided that the following conditions are met:
13 |
14 | 1. Redistributions of source code must retain the above copyright notice,
15 | this list of conditions and the following disclaimer.
16 |
17 | 2. Redistributions in binary form must reproduce the above copyright
18 | notice, this list of conditions and the following disclaimer in
19 | the documentation and/or other materials provided with the distribution.
20 |
21 | 3. The names of the authors may not be used to endorse or promote products
22 | derived from this software without specific prior written permission.
23 |
24 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
25 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
26 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
27 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
30 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
33 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 | */
35 | public interface Proxy
36 | {
37 | void connect(SocketFactory socket_factory, String host, int port, int timeout);
38 | Stream getInputStream();
39 | Stream getOutputStream();
40 | Socket getSocket();
41 | void close();
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/Compression.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public abstract class Compression
35 | {
36 | public const int INFLATER=0;
37 | public const int DEFLATER=1;
38 | public abstract void init(int type, int level);
39 | public abstract int compress(byte[] buf, int start, int len);
40 | public abstract byte[] uncompress(byte[] buf, int start, int[] len);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/SignatureRSA.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public interface SignatureRSA
35 | {
36 | void init();
37 | void setPubKey(byte[] e, byte[] n);
38 | //void setPrvKey(byte[] d, byte[] n);
39 | void setPrvKey(byte[] e, byte[] n, byte[] d, byte[] p, byte[] q, byte[] dp, byte[] dq, byte[] c);
40 | void update(byte[] H);
41 | bool verify(byte[] sig);
42 | byte[] sign();
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Common/ReceiverEndpoint.cs:
--------------------------------------------------------------------------------
1 | //---------------------------------------------------------------------
2 | // File: ReceiverEndpoints.cs
3 | //
4 | // Summary: Implementation of an adapter framework sample adapter.
5 | // This class constitutes one of the BaseAdapter classes, which, are
6 | // a set of generic re-usable set of classes to help adapter writers.
7 | //
8 | // Sample: Base Adapter Class Library v1.0.2
9 | //
10 | // Description: Base implementation for a receive adapter
11 | //
12 | //---------------------------------------------------------------------
13 | // This file is part of the Microsoft BizTalk Server 2006 SDK
14 | //
15 | // Copyright (c) Microsoft Corporation. All rights reserved.
16 | //
17 | // This source code is intended only as a supplement to Microsoft BizTalk
18 | // Server 2006 release and/or on-line documentation. See these other
19 | // materials for detailed information regarding Microsoft code samples.
20 | //
21 | // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
22 | // KIND, WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
23 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
24 | // PURPOSE.
25 | //---------------------------------------------------------------------
26 |
27 | using System;
28 | using Microsoft.BizTalk.Component.Interop;
29 | using Microsoft.BizTalk.TransportProxy.Interop;
30 |
31 | namespace Blogical.Shared.Adapters.Common
32 | {
33 | ///
34 | /// Base class for end point configurations - a home for contains various helper functions.
35 | ///
36 | public abstract class ReceiverEndpoint : System.IDisposable
37 | {
38 | public abstract void Open (string uri, IPropertyBag config, IPropertyBag bizTalkConfig, IPropertyBag handlerPropertyBag, IBTTransportProxy transportProxy, string transportType, string propertyNamespace, ControlledTermination control);
39 | public abstract void Update (IPropertyBag config, IPropertyBag bizTalkConfig, IPropertyBag handlerPropertyBag);
40 | public virtual void Dispose () { }
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/Cipher.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public abstract class Cipher
35 | {
36 | internal static int ENCRYPT_MODE=0;
37 | internal static int DECRYPT_MODE=1;
38 | public abstract int getIVSize();
39 | public abstract int getBlockSize();
40 | public abstract void init(int mode, byte[] key, byte[] iv);
41 | public abstract void update(byte[] foo, int s1, int len, byte[] bar, int s2);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | **Project Description**
2 | This adapter was developed for a customer who needed to transfer files independent from any choice of platform. Much concern for security, along with already invested infrastructure, where the main reasons for choosing Sftp before other protocols like Ftps.
3 |
4 | _Blogical.Shared.Adapters.Sftp_ utilizes an open source library for the actual communication with the sftp/ssh server. The library is developed by Tamir Gal. For more information: [http://www.tamirgal.com/home/dev.aspx?Item=SharpSsh](http://www.tamirgal.com/home/dev.aspx?Item=SharpSsh).
5 |
6 | The adapter has implemented a more sophisticated scheduler for setting up the polling interval. Rather than stating this property in milliseconds, you’re able to set a timely, daily, weekly or even a monthly scheduled polling interval. This part of the code comes from the Biztalk Scheduled Task Adapter project wich you can find out more about here: [http://biztalkscheduledtask.codeplex.com/](http://biztalkscheduledtask.codeplex.com/).
7 |
8 | **+Features+**
9 | * **Receive port load balancing**
10 | * **Scheduled polling interval**
11 | * **Notify on "Empty Batch" message** - the adapter will submit an error message if the receive endpoint didn’t pick up any files. This property is disabled by default.
12 | * **Publickey authentication** - (RSA, DSA)
13 | * **Sftp connection pooling**
14 | * **Host throttling** - restrict number of open connections to any sftp host
15 |
16 | +Finally, you may use this adapter as you like, but please keep me posted for bugs you fix. This way my former customer will benefit from sharing this adapter with the open source community.+
17 |
18 | **For more information: [http://blogical.se/blogs/mikael](http://blogical.se/blogs/mikael)**
19 |
20 | **For more information about varius ftp protocols: [http://blogical.se/blogs/johan/archive/2008/02/03/what-kind-of-ftp-did-you-say-you-used.aspx](http://blogical.se/blogs/johan/archive/2008/02/03/what-kind-of-ftp-did-you-say-you-used.aspx)**
21 |
22 | **See also Blogical Database Caching Lookup Functoids: [http://www.codeplex.com/BlogicalFunctoids](http://www.codeplex.com/BlogicalFunctoids)**
23 |
--------------------------------------------------------------------------------
/CreateTable.sql:
--------------------------------------------------------------------------------
1 | /*
2 | Table [dbo].[SftpWorkingProcess]
3 | The SftpWorkingProcess table is used for load balancing between multiple hosts. The first node to pick up a file
4 | will "check-out" the file by inserting a row to the SftpWorkingProcess table. When the file is removed from its
5 | original location, the CheckInFile method in the Blogical.Shared.Adapters.Sftp.DataBaseHelper class is called. This
6 | will remove the file entry in the table.
7 |
8 | To enable load balancing:
9 | 1. Create a new database, and run the script below to create the SftpWorkingProcess table.
10 | 2. Edit the BTSNTSvc.exe.config file (default C:\Program Files\Microsoft BizTalk Server 2006) and add the connection
11 | string AT THE END OF THE FILE. Add it at the top of the config file, will cause an error, and the BizTalk host
12 | won't start.
13 |
14 | Sample:
15 |
16 |
19 |
20 |
21 | Change the "Initial Catalog" to whatever you named your database, and make sure the process running your
22 | host instance, has sufficient rights to the table.
23 |
24 | 3. Create a new Receive Location (or open an existing one), and enable the UseLoadBalancing property.
25 |
26 | */
27 |
28 | SET ANSI_NULLS ON
29 | GO
30 | SET QUOTED_IDENTIFIER ON
31 | GO
32 | SET ANSI_PADDING ON
33 | GO
34 | CREATE TABLE [dbo].[SftpWorkingProcess](
35 | [ID] [uniqueidentifier] NOT NULL CONSTRAINT [DF_SftpWorkingProcess_ID] DEFAULT (newid()),
36 | [URI] [varchar](255) NOT NULL,
37 | [Node] [varchar](255) NOT NULL,
38 | [FileName] [varchar](255) NOT NULL,
39 | [Timestamp] [datetime] NOT NULL CONSTRAINT [DF_SftpWorkingProcess_Timestamp] DEFAULT (getdate()),
40 | CONSTRAINT [PK_SftpWorkingProcess] PRIMARY KEY CLUSTERED
41 | (
42 | [ID] ASC
43 | )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
44 | ) ON [PRIMARY]
45 |
46 | GO
47 | SET ANSI_PADDING OFF
48 |
49 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp/SftpTransmitter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Xml;
3 | using Microsoft.BizTalk.Component.Interop;
4 | using Blogical.Shared.Adapters.Common;
5 | using Microsoft.BizTalk.TransportProxy.Interop;
6 | using Blogical.Shared.Adapters.Sftp.ConnectionPool;
7 | using System.Diagnostics;
8 |
9 | namespace Blogical.Shared.Adapters.Sftp
10 | {
11 | ///
12 | /// This is a singleton class for Sftp send adapter. All the messages, going to various
13 | /// send ports of this adapter type, will go through this class.
14 | ///
15 | public class SftpTransmitter : AsyncTransmitter
16 | {
17 | ///
18 | /// Constructor
19 | ///
20 | public SftpTransmitter()
21 | : base(
22 | "Sftp Transmit Adapter",
23 | "1.0",
24 | "Send files from BizTalk to ssh server",
25 | "Blogical.Shared.Adapters.Sftp",
26 | new Guid("225d6dd3-ea0f-49db-942a-61c078e7c8c0"),
27 | "Blogical.Shared.Adapters.Sftp",
28 | typeof(SftpTransmitterEndpoint),
29 | SftpTransmitProperties.BatchSize)
30 | {
31 | }
32 |
33 |
34 | ///
35 | ///
36 | ///
37 | protected override void HandlerPropertyBagLoaded ()
38 | {
39 | IPropertyBag config = this.HandlerPropertyBag;
40 | if (null != config)
41 | {
42 | XmlDocument handlerConfigDom = ConfigProperties.IfExistsExtractConfigDom(config);
43 | if (null != handlerConfigDom)
44 | {
45 | SftpTransmitProperties.ReadTransmitHandlerConfiguration(handlerConfigDom);
46 | }
47 | }
48 | }
49 | public override void Terminate()
50 | {
51 | Trace.WriteLine("[SftpTransmitterAdapter] Adapter Terminates...");
52 | try
53 | {
54 | SftpConnectionPool.Dispose();
55 | base.Terminate();
56 | }
57 | catch (Exception ex)
58 | {
59 | ExceptionHandling.HandleComponentException(System.Reflection.MethodBase.GetCurrentMethod(), ex);
60 | }
61 | Trace.WriteLine("[SftpTransmitterAdapter] Adapter Terminated");
62 | }
63 |
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/HostKeyRepository.cs:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; -*- */
2 | /*
3 | Copyright (c) 2004 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | using System;
31 |
32 | namespace Tamir.SharpSsh.jsch
33 | {
34 | public abstract class HostKeyRepository
35 | {
36 | internal const int OK=0;
37 | internal const int NOT_INCLUDED=1;
38 | internal const int CHANGED=2;
39 |
40 | public abstract int check(String host, byte[] key);
41 | public abstract void add(String host, byte[] key, UserInfo ui);
42 | public abstract void remove(String host, String type);
43 | public abstract void remove(String host, String type, byte[] key);
44 | public abstract String getKnownHostsRepositoryID();
45 | public abstract HostKey[] getHostKey();
46 | public abstract HostKey[] getHostKey(String host, String type);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/io/InputStream.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using IO = System.IO;
3 |
4 | namespace Tamir.SharpSsh.java.io
5 | {
6 | ///
7 | /// Summary description for InputStream.
8 | ///
9 | public abstract class InputStream : IO.Stream
10 | {
11 | public virtual int read(byte[] buffer, int offset, int count)
12 | {
13 | return this.Read(buffer, offset, count);
14 | }
15 |
16 | public virtual int read(byte[] buffer)
17 | {
18 | return this.Read(buffer, 0, buffer.Length);
19 | }
20 |
21 | public virtual int read()
22 | {
23 | return this.ReadByte();
24 | }
25 |
26 | public virtual void close()
27 | {
28 | Close();
29 | }
30 |
31 | public override void WriteByte(byte value)
32 | {
33 | }
34 |
35 | public override void Write(byte[] buffer, int offset, int count)
36 | {
37 | }
38 |
39 | public override bool CanRead
40 | {
41 | get
42 | {
43 | return true;
44 | }
45 | }
46 | public override bool CanWrite
47 | {
48 | get
49 | {
50 | return false;
51 | }
52 | }
53 | public override bool CanSeek
54 | {
55 | get
56 | {
57 | return false;
58 | }
59 | }
60 | public override void Flush()
61 | {
62 |
63 | }
64 | public override long Length
65 | {
66 | get
67 | {
68 | return 0;
69 | }
70 | }
71 | public override long Position
72 | {
73 | get
74 | {
75 | return 0;
76 | }
77 | set
78 | {
79 | }
80 | }
81 | public override void SetLength(long value)
82 | {
83 | }
84 | public override long Seek(long offset, IO.SeekOrigin origin)
85 | {
86 | return 0;
87 | }
88 |
89 | public long skip(long len)
90 | {
91 | //Seek doesn't work
92 | //return Seek(offset, IO.SeekOrigin.Current);
93 | int i=0;
94 | int count = 0;
95 | byte[] buf = new byte[len];
96 | while(len>0)
97 | {
98 | i=Read(buf, count, (int)len);//tamir: possible lost of pressision
99 | if(i<=0)
100 | {
101 | throw new Exception("inputstream is closed");
102 | //return (s-foo)==0 ? i : s-foo;
103 | }
104 | count+=i;
105 | len-=i;
106 | }
107 | return count;
108 | }
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/RequestSignal.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | class RequestSignal : Request
35 | {
36 | String signal="KILL";
37 | public void setSignal(String foo){ signal=foo; }
38 | public void request(Session session, Channel channel)
39 | {
40 | Buffer buf=new Buffer();
41 | Packet packet=new Packet(buf);
42 |
43 | packet.reset();
44 | buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST);
45 | buf.putInt(channel.getRecipient());
46 | buf.putString( Util.getBytes("signal"));
47 | buf.putByte((byte)(waitForReply() ? 1 : 0));
48 | buf.putString(Util.getBytes(signal));
49 | session.write(packet);
50 | }
51 | public bool waitForReply(){ return false; }
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/net/Socket.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Net;
4 | using System.Net.Sockets;
5 | using Net = System.Net;
6 | using Sock = System.Net.Sockets.Socket;
7 |
8 | namespace Tamir.SharpSsh.java.net
9 | {
10 | ///
11 | /// Summary description for Socket.
12 | ///
13 | public class Socket
14 | {
15 | internal Sock sock;
16 |
17 | protected void SetSocketOption(SocketOptionLevel level, SocketOptionName name, int val)
18 | {
19 | try
20 | {
21 | sock.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.NoDelay, val);
22 | }
23 | catch
24 | {
25 | }
26 | }
27 |
28 | // public Socket(AddressFamily af, SocketType st, ProtocolType pt)
29 | // {
30 | // this.sock = new Sock(af, st, pt);
31 | // this.sock.Connect();
32 | // }
33 |
34 | public Socket(string host, int port)
35 | {
36 | IPEndPoint ep = new IPEndPoint(Dns.GetHostByName(host).AddressList[0], port);
37 | this.sock = new Sock(ep.AddressFamily,
38 | SocketType.Stream, ProtocolType.Tcp);
39 | this.sock.Connect(ep);
40 | }
41 |
42 | public Socket(Sock sock)
43 | {
44 | this.sock = sock;
45 | }
46 |
47 | public Stream getInputStream()
48 | {
49 | return new Net.Sockets.NetworkStream(sock);
50 | }
51 |
52 | public Stream getOutputStream()
53 | {
54 | return new Net.Sockets.NetworkStream(sock);
55 | }
56 |
57 | public bool isConnected()
58 | {
59 | return sock.Connected;
60 | }
61 |
62 | public void setTcpNoDelay(bool b)
63 | {
64 | if(b)
65 | {
66 | SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.NoDelay, 1);
67 | }
68 | else
69 | {
70 | SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.NoDelay, 0);
71 | }
72 | }
73 |
74 | public void setSoTimeout(int t)
75 | {
76 | SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, t);
77 | SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendTimeout, t);
78 | }
79 |
80 | public void close()
81 | {
82 | sock.Close();
83 | }
84 |
85 | public InetAddress getInetAddress()
86 | {
87 | return new InetAddress( ((IPEndPoint) sock.RemoteEndPoint).Address );
88 | }
89 |
90 | public int getPort()
91 | {
92 | return ((IPEndPoint) sock.RemoteEndPoint).Port;
93 | }
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/UserAuth.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | abstract class UserAuth
35 | {
36 | public virtual bool start(Session session)
37 | {
38 | Packet packet=session.packet;
39 | Buffer buf=session.buf;
40 | // send
41 | // byte SSH_MSG_SERVICE_REQUEST(5)
42 | // string service name "ssh-userauth"
43 | packet.reset();
44 | buf.putByte((byte)Session.SSH_MSG_SERVICE_REQUEST);
45 | buf.putString(Util.getBytes("ssh-userauth"));
46 | session.write(packet);
47 |
48 | // receive
49 | // byte SSH_MSG_SERVICE_ACCEPT(6)
50 | // string service name
51 | buf=session.read(buf);
52 | //System.out.println("read: 6 ? "+buf.buffer[5]);
53 | return buf.buffer[5]==6;
54 | }
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/RequestShell.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | class RequestShell : Request
35 | {
36 | public void request(Session session, Channel channel)
37 | {
38 | Buffer buf=new Buffer();
39 | Packet packet=new Packet(buf);
40 |
41 | // send
42 | // byte SSH_MSG_CHANNEL_REQUEST(98)
43 | // uint32 recipient channel
44 | // string request type // "shell"
45 | // boolean want reply // 0
46 | packet.reset();
47 | buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST);
48 | buf.putInt(channel.getRecipient());
49 | buf.putString(Util.getBytes("shell"));
50 | buf.putByte((byte)(waitForReply() ? 1 : 0));
51 | session.write(packet);
52 | }
53 | public bool waitForReply(){ return false; }
54 | }
55 |
56 | }
57 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/RequestPtyReq.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | class RequestPtyReq : Request
35 | {
36 | void setCode(String cookie)
37 | {
38 | }
39 | public void request(Session session, Channel channel)
40 | {
41 | Buffer buf=new Buffer();
42 | Packet packet=new Packet(buf);
43 |
44 | packet.reset();
45 | buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST);
46 | buf.putInt(channel.getRecipient());
47 | buf.putString(Util.getBytes("pty-req"));
48 | buf.putByte((byte)(waitForReply() ? 1 : 0));
49 | buf.putString(Util.getBytes("vt100"));
50 | buf.putInt(80);
51 | buf.putInt(24);
52 | buf.putInt(640);
53 | buf.putInt(480);
54 | buf.putString(Util.getBytes(""));
55 | session.write(packet);
56 | }
57 | public bool waitForReply(){ return false; }
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/examples/ChangePassphrase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 | using System.Windows.Forms;
4 |
5 | /* ChangePassphrase.cs
6 | * ====================================================================
7 | * The following example was posted with the original JSch java library,
8 | * and is translated to C# to show the usage of SharpSSH JSch API
9 | * ====================================================================
10 | * */
11 | namespace Tamir.SharpSsh.jsch.examples
12 | {
13 | ///
14 | /// This program will demonstrate changing the passphrase for a
15 | /// private key file instead of creating a new private key.
16 | /// A passphrase will be prompted if the given private-key has been
17 | /// encrypted. After successfully loading the content of the
18 | /// private-key, the new passphrase will be prompted and the given
19 | /// private-key will be re-encrypted with that new passphrase.
20 | ///
21 | public class ChangePassphrase
22 | {
23 | public static void Main(String[] arg)
24 | {
25 | //Get the private key filename from the user
26 | Console.WriteLine("Please choose your private key file...");
27 | String pkey = InputForm.GetFileFromUser("Choose your privatekey(ex. ~/.ssh/id_dsa)");
28 | Console.WriteLine("You chose "+pkey+".");
29 |
30 | //Create a new JSch instance
31 | JSch jsch=new JSch();
32 |
33 | try
34 | {
35 | //Load the key pair
36 | KeyPair kpair=KeyPair.load(jsch, pkey);
37 |
38 | //Print the key file encryption status
39 | Console.WriteLine(pkey+" has "+(kpair.isEncrypted()?"been ":"not been ")+"encrypted");
40 |
41 | String passphrase = "";
42 |
43 | while(kpair.isEncrypted())
44 | {
45 | passphrase = InputForm.GetUserInput("Enter passphrase for "+pkey, true);
46 | if(!kpair.decrypt(passphrase))
47 | {
48 | Console.WriteLine("failed to decrypt "+pkey);
49 | }
50 | else
51 | {
52 | Console.WriteLine(pkey+" is decrypted.");
53 | }
54 | }
55 |
56 | passphrase="";
57 |
58 | passphrase=InputForm.GetUserInput("Enter new passphrase for "+pkey+
59 | " (empty for no passphrase)", true);
60 |
61 | //Set the new passphrase
62 | kpair.setPassphrase(passphrase);
63 | //write the key to file
64 | kpair.writePrivateKey(pkey);
65 | //free the resource
66 | kpair.dispose();
67 | }
68 | catch(Exception e)
69 | {
70 | Console.WriteLine(e);
71 | }
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/examples/KeyGen.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Tamir.SharpSsh.jsch;
3 |
4 | /* KeyGen.cs
5 | * ====================================================================
6 | * The following example was posted with the original JSch java library,
7 | * and is translated to C# to show the usage of SharpSSH JSch API
8 | * ====================================================================
9 | * */
10 | namespace Tamir.SharpSsh.jsch.examples
11 | {
12 | ///
13 | /// This progam will demonstrate the RSA/DSA keypair generation.
14 | /// You will be asked a passphrase for output_keyfile.
15 | /// If everything works fine, you will get the DSA or RSA keypair,
16 | /// output_keyfile and output_keyfile+".pub".
17 | /// The private key and public key are in the OpenSSH format.
18 | ///
19 | public class KeyGen
20 | {
21 | public static void Main(params string[] arg)
22 | {
23 | if(arg.Length<3)
24 | {
25 | Console.Error.WriteLine(
26 | "usage: java KeyGen rsa output_keyfile comment\n"+
27 | " java KeyGen dsa output_keyfile comment");
28 | Environment.Exit(-1);
29 | }
30 |
31 | //Get sig type ('rsa' or 'dsa')
32 | String _type=arg[0];
33 | int type=0;
34 | if(_type.Equals("rsa")){type=KeyPair.RSA;}
35 | else if(_type.Equals("dsa")){type=KeyPair.DSA;}
36 | else
37 | {
38 | Console.Error.WriteLine(
39 | "usage: java KeyGen rsa output_keyfile comment\n"+
40 | " java KeyGen dsa output_keyfile comment");
41 | Environment.Exit(-1);
42 | }
43 | //Output file name
44 | String filename=arg[1];
45 | //Signature comment
46 | String comment=arg[2];
47 |
48 | //Create a new JSch instance
49 | JSch jsch=new JSch();
50 |
51 | //Prompt the user for a passphrase for the private key file
52 | String passphrase=InputForm.GetUserInput("Enter passphrase (empty for no passphrase)", true);
53 |
54 | try
55 | {
56 | //Generate the new key pair
57 | KeyPair kpair=KeyPair.genKeyPair(jsch, type);
58 | //Set a passphrase
59 | kpair.setPassphrase(passphrase);
60 | //Write the private key to "filename"
61 | kpair.writePrivateKey(filename);
62 | //Write the public key to "filename.pub"
63 | kpair.writePublicKey(filename+".pub", comment);
64 | //Print the key fingerprint
65 | Console.WriteLine("Finger print: "+kpair.getFingerPrint());
66 | //Free resources
67 | kpair.dispose();
68 | }
69 | catch(Exception e)
70 | {
71 | Console.WriteLine(e);
72 | }
73 | Environment.Exit(0);
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/RequestExec.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Str = Tamir.SharpSsh.java.String;
3 |
4 | namespace Tamir.SharpSsh.jsch
5 | {
6 | /* -*-mode:java; c-basic-offset:2; -*- */
7 | /*
8 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without
11 | modification, are permitted provided that the following conditions are met:
12 |
13 | 1. Redistributions of source code must retain the above copyright notice,
14 | this list of conditions and the following disclaimer.
15 |
16 | 2. Redistributions in binary form must reproduce the above copyright
17 | notice, this list of conditions and the following disclaimer in
18 | the documentation and/or other materials provided with the distribution.
19 |
20 | 3. The names of the authors may not be used to endorse or promote products
21 | derived from this software without specific prior written permission.
22 |
23 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
24 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
25 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
26 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
27 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
29 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
32 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | */
34 |
35 | internal class RequestExec : Request
36 | {
37 | private String command="";
38 | internal RequestExec(String foo)
39 | {
40 | this.command=foo;
41 | }
42 | public void request(Session session, Channel channel)
43 | {
44 | Packet packet=session.packet;
45 | Buffer buf=session.buf;
46 | // send
47 | // byte SSH_MSG_CHANNEL_REQUEST(98)
48 | // uint32 recipient channel
49 | // string request type // "exec"
50 | // boolean want reply // 0
51 | // string command
52 | packet.reset();
53 | buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST);
54 | buf.putInt(channel.getRecipient());
55 | buf.putString(new Str("exec").getBytes());
56 | buf.putByte((byte)(waitForReply() ? 1 : 0));
57 | buf.putString(new Str(command).getBytes());
58 | session.write(packet);
59 | }
60 | public bool waitForReply(){ return false; }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 |
4 | //
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | //
9 | [assembly: AssemblyTitle("SharpSSH")]
10 | [assembly: AssemblyDescription("SSH library for .NET")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("tamirgal.com")]
13 | [assembly: AssemblyProduct("SharpSSH")]
14 | [assembly: AssemblyCopyright("Tamir Gal (c) 2007 and jcraft.com")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 |
18 | //
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Revision and Build Numbers
27 | // by using the '*' as shown below:
28 |
29 | [assembly: AssemblyVersion("1.1.1.13")]
30 |
31 | //
32 | // In order to sign your assembly you must specify a key to use. Refer to the
33 | // Microsoft .NET Framework documentation for more information on assembly signing.
34 | //
35 | // Use the attributes below to control which key is used for signing.
36 | //
37 | // Notes:
38 | // (*) If no key is specified, the assembly is not signed.
39 | // (*) KeyName refers to a key that has been installed in the Crypto Service
40 | // Provider (CSP) on your machine. KeyFile refers to a file which contains
41 | // a key.
42 | // (*) If the KeyFile and the KeyName values are both specified, the
43 | // following processing occurs:
44 | // (1) If the KeyName can be found in the CSP, that key is used.
45 | // (2) If the KeyName does not exist and the KeyFile does exist, the key
46 | // in the KeyFile is installed into the CSP and used.
47 | // (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
48 | // When specifying the KeyFile, the location of the KeyFile should be
49 | // relative to the project output directory which is
50 | // %Project Directory%\obj\. For example, if your KeyFile is
51 | // located in the project directory, you would specify the AssemblyKeyFile
52 | // attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
53 | // (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
54 | // documentation for more information on this.
55 | //
56 | [assembly: AssemblyDelaySign(false)]
57 | [assembly: AssemblyKeyFile("")]
58 | [assembly: AssemblyKeyName("")]
59 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/ITransferProtocol.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | /*
4 | * ITransferProtocol.cs
5 | *
6 | * Copyright (c) 2006 Tamir Gal, http://www.tamirgal.com, All rights reserved.
7 | *
8 | * Redistribution and use in source and binary forms, with or without
9 | * modification, are permitted provided that the following conditions are met:
10 | *
11 | * 1. Redistributions of source code must retain the above copyright notice,
12 | * this list of conditions and the following disclaimer.
13 | *
14 | * 2. Redistributions in binary form must reproduce the above copyright
15 | * notice, this list of conditions and the following disclaimer in
16 | * the documentation and/or other materials provided with the distribution.
17 | *
18 | * 3. The names of the authors may not be used to endorse or promote products
19 | * derived from this software without specific prior written permission.
20 | *
21 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
22 | * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
23 | * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
24 | * *OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
25 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
27 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 | *
32 | **/
33 | namespace Tamir.SharpSsh
34 | {
35 | ///
36 | /// Summary description for ITransferProtocol.
37 | ///
38 | public interface ITransferProtocol
39 | {
40 | void Connect();
41 | void Close();
42 | void Cancel();
43 | void Get(string fromFilePath, string toFilePath);
44 | void Put(string fromFilePath, string toFilePath);
45 | void Mkdir(string directory);
46 | ///
47 | /// Triggered when protocol transfer is starting
48 | ///
49 | event FileTransferEvent OnTransferStart;
50 | ///
51 | /// Triggered when protocol transfer ends
52 | ///
53 | event FileTransferEvent OnTransferEnd;
54 | ///
55 | /// Triggered on every interval with the transfer progress iformation.
56 | ///
57 | event FileTransferEvent OnTransferProgress;
58 | }
59 |
60 | public delegate void FileTransferEvent(string src, string dst, int transferredBytes, int totalBytes, string message);
61 | }
62 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp/BatchMessage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections;
3 | using System.Runtime.InteropServices;
4 | using Microsoft.BizTalk.TransportProxy.Interop;
5 | using Microsoft.BizTalk.Message.Interop;
6 |
7 | namespace Blogical.Shared.Adapters.Sftp
8 | {
9 | ///
10 | /// A BatchMessage represents a file within a batch. Each BatchMessage is added to the BatchHandler.Files
11 | /// in the BatchHandler.CreateMessage method.
12 | ///
13 | internal class BatchMessage
14 | {
15 | #region Private Members
16 | private IBaseMessage _message;
17 | private object _userData;
18 | private string _correlationToken;
19 | private BatchOperationType _operationType;
20 | private SftpReceiveProperties.AfterGetActions _aftergetaction;
21 | private string _aftergetfilename;
22 | #endregion
23 | #region Internal Members
24 | internal IBaseMessage Message
25 | {
26 | get { return this._message; }
27 | }
28 | internal object UserData
29 | {
30 | get { return this._userData; }
31 | }
32 | internal string CorrelationToken
33 | {
34 | get { return this._correlationToken; }
35 | }
36 | internal BatchOperationType OperationType
37 | {
38 | get { return this._operationType; }
39 | }
40 | internal SftpReceiveProperties.AfterGetActions AfterGetAction
41 | {
42 | get { return this._aftergetaction; }
43 | }
44 | internal string AfterGetFilename
45 | {
46 | get { return this._aftergetfilename; }
47 | }
48 | #endregion
49 | #region Constructors
50 | internal BatchMessage(IBaseMessage message, object userData, BatchOperationType oppType)
51 | {
52 | this._message = message;
53 | this._userData = userData;
54 | this._operationType = oppType;
55 | }
56 | internal BatchMessage(IBaseMessage message, object userData, BatchOperationType oppType,
57 | SftpReceiveProperties.AfterGetActions afterGetAction, string afterGetFilename)
58 | {
59 | this._message = message;
60 | this._userData = userData;
61 | this._operationType = oppType;
62 | this._aftergetaction = afterGetAction;
63 | this._aftergetfilename = afterGetFilename;
64 | }
65 | internal BatchMessage(string correlationToken, object userData, BatchOperationType oppType)
66 | {
67 | this._correlationToken = correlationToken;
68 | this._userData = userData;
69 | this._operationType = oppType;
70 | }
71 | #endregion
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/jce/SHA1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch.jce
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public class SHA1 : Tamir.SharpSsh.jsch.HASH{
35 | //MessageDigest md;
36 | internal System.Security.Cryptography.SHA1CryptoServiceProvider md;
37 | private System.Security.Cryptography.CryptoStream cs;
38 |
39 | public override int getBlockSize(){return 20;}
40 | public override void init(){
41 | try
42 | {
43 | //md=MessageDigest.getInstance("SHA-1");
44 | md=new System.Security.Cryptography.SHA1CryptoServiceProvider();
45 | cs = new System.Security.Cryptography.CryptoStream( System.IO.Stream.Null, md, System.Security.Cryptography.CryptoStreamMode.Write);
46 | }
47 | catch(Exception e){
48 | Console.WriteLine(e);
49 | }
50 | }
51 | public override void update(byte[] foo, int start, int len){
52 | //md.update(foo, start, len);
53 | cs.Write(foo, start, len);
54 | }
55 | public override byte[] digest() {
56 | //return md.digest();
57 | cs.Close();
58 | byte[] result = md.Hash;
59 | md.Clear();
60 | init(); //Reinitiazing hash objects
61 |
62 | return result;
63 | }
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/jce/MD5.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch.jce
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public class MD5 : Tamir.SharpSsh.jsch.HASH
35 | {
36 | //MessageDigest md;
37 | internal System.Security.Cryptography.MD5CryptoServiceProvider md;
38 | private System.Security.Cryptography.CryptoStream cs;
39 |
40 | public override int getBlockSize(){return 16;}
41 | public override void init()
42 | {
43 | try
44 | {
45 | //md=MessageDigest.getInstance("MD5");
46 | md = new System.Security.Cryptography.MD5CryptoServiceProvider();
47 | cs = new System.Security.Cryptography.CryptoStream( System.IO.Stream.Null, md, System.Security.Cryptography.CryptoStreamMode.Write);
48 | }
49 | catch(Exception e)
50 | {
51 | Console.WriteLine(e);
52 | }
53 | }
54 | public override void update(byte[] foo, int start, int len)
55 | {
56 | //md.update(foo, start, len);
57 | cs.Write(foo, start, len);
58 | }
59 | public override byte[] digest()
60 | {
61 | cs.Close();
62 | byte[] result = md.Hash;
63 | md.Clear();//Reinitiazing hash objects
64 | init();
65 |
66 | return result;
67 | }
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Common/AsyncTransmitterEndpoint.cs:
--------------------------------------------------------------------------------
1 | //---------------------------------------------------------------------
2 | // File: AsyncTransmitterEndpoint.cs
3 | //
4 | // Summary: Implementation of an adapter framework sample adapter.
5 | // This class constitutes one of the BaseAdapter classes, which, are
6 | // a set of generic re-usable set of classes to help adapter writers.
7 | //
8 | // Sample: Base Adapter Class Library v1.0.2
9 | //
10 | // Description: TODO:
11 | //
12 | //---------------------------------------------------------------------
13 | // This file is part of the Microsoft BizTalk Server 2006 SDK
14 | //
15 | // Copyright (c) Microsoft Corporation. All rights reserved.
16 | //
17 | // This source code is intended only as a supplement to Microsoft BizTalk
18 | // Server 2006 release and/or on-line documentation. See these other
19 | // materials for detailed information regarding Microsoft code samples.
20 | //
21 | // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
22 | // KIND, WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
23 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
24 | // PURPOSE.
25 | //---------------------------------------------------------------------
26 |
27 | using System;
28 | using System.Xml;
29 | using Microsoft.BizTalk.Message.Interop;
30 | using Microsoft.BizTalk.Component.Interop;
31 |
32 | namespace Blogical.Shared.Adapters.Common
33 | {
34 | public abstract class EndpointParameters
35 | {
36 | public abstract string SessionKey { get; }
37 | public string OutboundLocation { get { return this.outboundLocation; } }
38 | public EndpointParameters (string outboundLocation)
39 | {
40 | this.outboundLocation = outboundLocation;
41 | }
42 | protected string outboundLocation;
43 | }
44 |
45 | internal class DefaultEndpointParameters : EndpointParameters
46 | {
47 | public override string SessionKey
48 | {
49 | // the SessionKey is the outboundLocation in the default case
50 | get { return this.outboundLocation; }
51 | }
52 | public DefaultEndpointParameters (string outboundLocation) : base(outboundLocation)
53 | {
54 | }
55 | }
56 |
57 | public abstract class AsyncTransmitterEndpoint : System.IDisposable
58 | {
59 | public AsyncTransmitterEndpoint(AsyncTransmitter transmitter) { }
60 |
61 | public virtual bool ReuseEndpoint { get { return true; } }
62 | public abstract void Open (EndpointParameters endpointParameters, IPropertyBag handlerPropertyBag, string propertyNamespace);
63 | public abstract IBaseMessage ProcessMessage (IBaseMessage message);
64 | public virtual void Dispose () { }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/RequestSftp.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public class RequestSftp : Request
35 | {
36 | public void request(Session session, Channel channel)
37 | {
38 | Buffer buf=new Buffer();
39 | Packet packet=new Packet(buf);
40 |
41 | bool reply=waitForReply();
42 | if(reply)
43 | {
44 | channel.reply=-1;
45 | }
46 |
47 | packet.reset();
48 | buf.putByte((byte)Session.SSH_MSG_CHANNEL_REQUEST);
49 | buf.putInt(channel.getRecipient());
50 | buf.putString(Util.getBytes("subsystem"));
51 | buf.putByte((byte)(waitForReply() ? 1 : 0));
52 | buf.putString(Util.getBytes("sftp"));
53 | session.write(packet);
54 |
55 | if(reply)
56 | {
57 | while(channel.reply==-1)
58 | {
59 | try
60 | {
61 | System.Threading.Thread.Sleep(10);
62 | }
63 | catch
64 | {
65 | }
66 | }
67 | if(channel.reply==0)
68 | {
69 | throw new JSchException("failed to send sftp request");
70 | }
71 | }
72 | }
73 | public bool waitForReply(){ return true; }
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/jce/DH.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Org.Mentalis.Security.Cryptography; //For DiffieHellman usage
3 |
4 |
5 | namespace Tamir.SharpSsh.jsch.jce
6 | {
7 | /* -*-mode:java; c-basic-offset:2; -*- */
8 | /*
9 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
10 |
11 | Redistribution and use in source and binary forms, with or without
12 | modification, are permitted provided that the following conditions are met:
13 |
14 | 1. Redistributions of source code must retain the above copyright notice,
15 | this list of conditions and the following disclaimer.
16 |
17 | 2. Redistributions in binary form must reproduce the above copyright
18 | notice, this list of conditions and the following disclaimer in
19 | the documentation and/or other materials provided with the distribution.
20 |
21 | 3. The names of the authors may not be used to endorse or promote products
22 | derived from this software without specific prior written permission.
23 |
24 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
25 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
26 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
27 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
30 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
33 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 | */
35 |
36 | public class DH : Tamir.SharpSsh.jsch.DH
37 | {
38 | internal byte[] p;
39 | internal byte[] g;
40 | internal byte[] e; // my public key
41 | internal byte[] e_array;
42 | internal byte[] f; // your public key
43 | internal byte[] K; // shared secret key
44 | internal byte[] K_array;
45 |
46 | private DiffieHellman dh;
47 | public void init()
48 | {
49 | }
50 | public byte[] getE()
51 | {
52 | if(e_array==null)
53 | {
54 |
55 | dh = new DiffieHellmanManaged(p , g, 0);
56 | e_array = dh.CreateKeyExchange();
57 | }
58 | return e_array;
59 | }
60 | public byte[] getK()
61 | {
62 | if(K_array==null)
63 | {
64 | K_array = dh.DecryptKeyExchange( f);
65 | }
66 | return K_array;
67 | }
68 | public void setP(byte[] p){ this.p=p; }
69 | public void setG(byte[] g){ this.g=g; }
70 | public void setF(byte[] f){ this.f=f; }
71 | // void setP(BigInteger p){this.p=p;}
72 | // void setG(BigInteger g){this.g=g;}
73 | // void setF(BigInteger f){this.f=f;}
74 | }
75 |
76 | }
77 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/RequestX11.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | class RequestX11 : Request
35 | {
36 | public void setCookie(String cookie)
37 | {
38 | ChannelX11.cookie=Util.getBytes(cookie);
39 | }
40 | public void request(Session session, Channel channel)
41 | {
42 | Buffer buf=new Buffer();
43 | Packet packet=new Packet(buf);
44 |
45 | // byte SSH_MSG_CHANNEL_REQUEST(98)
46 | // uint32 recipient channel
47 | // string request type // "x11-req"
48 | // boolean want reply // 0
49 | // boolean single connection
50 | // string x11 authentication protocol // "MIT-MAGIC-COOKIE-1".
51 | // string x11 authentication cookie
52 | // uint32 x11 screen number
53 | packet.reset();
54 | buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST);
55 | buf.putInt(channel.getRecipient());
56 | buf.putString(Util.getBytes("x11-req"));
57 | buf.putByte((byte)(waitForReply() ? 1 : 0));
58 | buf.putByte((byte)0);
59 | buf.putString(Util.getBytes("MIT-MAGIC-COOKIE-1"));
60 | buf.putString(ChannelX11.getFakedCookie(session));
61 | buf.putInt(0);
62 | session.write(packet);
63 | }
64 | public bool waitForReply(){ return false; }
65 | }
66 |
67 | }
68 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/Streams/NoneBufferedStream.cs:
--------------------------------------------------------------------------------
1 | //using System;
2 | //using System.Collections.Generic;
3 | //using System.Text;
4 |
5 | //namespace Tamir.SharpSsh.Streams
6 | //{
7 | // public class NoneBufferedStream : System.IO.Stream
8 | // {
9 | // private Tamir.SharpSsh.java.io.JStream _jStream = null;
10 | // private Tamir.SharpSsh.jsch.ChannelSftp _channel = null;
11 | // private byte[] _handle = null;
12 | // private Tamir.SharpSsh.jsch.ChannelSftp.Header _header = null;
13 | // private Buffer _buffer;
14 |
15 | // public NoneBufferedStream(Tamir.SharpSsh.java.io.JStream jStream,
16 | // Tamir.SharpSsh.jsch.ChannelSftp channel,
17 | // byte[] handle,
18 | // Tamir.SharpSsh.jsch.ChannelSftp.Header header)
19 | // {
20 | // this._jStream = jStream;
21 | // this._channel = channel;
22 | // this._handle = handle;
23 | // this._header = header;
24 | // }
25 |
26 | // public override bool CanRead
27 | // {
28 | // get { return this._jStream.CanRead; }
29 | // }
30 |
31 | // public override bool CanSeek
32 | // {
33 | // get { return this._jStream.CanSeek; }
34 | // }
35 |
36 | // public override bool CanWrite
37 | // {
38 | // get { return this._jStream.CanWrite; }
39 | // }
40 |
41 | // public override void Flush()
42 | // {
43 | // this._jStream.Flush();
44 | // }
45 |
46 | // public override long Length
47 | // {
48 | // get { return this._jStream.Length; }
49 | // }
50 |
51 | // public override long Position
52 | // {
53 | // get
54 | // {
55 | // return this._jStream.Position;
56 | // }
57 | // set
58 | // {
59 | // this._jStream.Position = value;
60 | // }
61 | // }
62 |
63 | // public override int Read(byte[] buffer, int offset, int count)
64 | // {
65 | // int ret = this._jStream.Read(buffer, offset, count);
66 |
67 | // if (ret < 0) // Close
68 | // this._channel.GetComplete(this._handle, this._header);
69 |
70 | // return ret;
71 | // }
72 |
73 | // public override long Seek(long offset, System.IO.SeekOrigin origin)
74 | // {
75 | // this._jStream.Seek(offset, origin);
76 | // }
77 |
78 | // public override void SetLength(long value)
79 | // {
80 | // this._jStream.SetLength(value);
81 | // }
82 |
83 | // public override void Write(byte[] buffer, int offset, int count)
84 | // {
85 | // this._jStream.Write(buffer, offset, count);
86 | // }
87 | // }
88 | //}
89 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/ChannelSftpStreamPut.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.IO;
3 |
4 | namespace Tamir.SharpSsh.jsch
5 | {
6 | internal class OutputStreamPut : java.io.OutputStream
7 | {
8 | ChannelSftp sftp;
9 | byte[] handle;
10 | long[] _offset;
11 | SftpProgressMonitor monitor;
12 | private bool init=true;
13 | private int[] ackid=new int[1];
14 | private int startid=0;
15 | private int _ackid=0;
16 | private int ackcount=0;
17 | private ChannelSftp.Header header=new ChannelSftp.Header();
18 |
19 | internal OutputStreamPut
20 | (ChannelSftp sftp,
21 | byte[] handle,
22 | long[] _offset,
23 | SftpProgressMonitor monitor):base()
24 | {
25 | this.sftp=sftp;
26 | this.handle=handle;
27 | this._offset=_offset;
28 | this.monitor=monitor;
29 | }
30 |
31 | public override void Write(byte[] d, int s, int len)
32 | {
33 | if(init)
34 | {
35 | startid=sftp.seq;
36 | _ackid=sftp.seq;
37 | init=false;
38 | }
39 |
40 | try
41 | {
42 | int _len=len;
43 | while(_len>0)
44 | {
45 | int sent=sftp.sendWRITE(handle, _offset[0], d, s, _len);
46 | _offset[0]+=sent;
47 | s+=sent;
48 | _len-=sent;
49 | if((sftp.seq-1)==startid ||
50 | sftp.io.ins.available()>=1024)
51 | {
52 | while(sftp.io.ins.available()>0)
53 | {
54 | if(sftp.checkStatus(ackid, header))
55 | {
56 | _ackid=ackid[0];
57 | if(startid>_ackid || _ackid>sftp.seq-1)
58 | {
59 | throw new SftpException(ChannelSftp.SSH_FX_FAILURE, "");
60 | }
61 | ackcount++;
62 | }
63 | else
64 | {
65 | break;
66 | }
67 | }
68 | }
69 | }
70 | if(monitor!=null && !monitor.count(len))
71 | {
72 | close();
73 | throw new IOException("canceled");
74 | }
75 | }
76 | catch(IOException e){ throw e; }
77 | catch(Exception e){ throw new IOException(e.ToString()); }
78 | }
79 | byte[] _data=new byte[1];
80 | public void write(int foo)
81 | {
82 | _data[0]=(byte)foo;
83 | Write(_data, 0, 1);
84 | }
85 | public override void Close()
86 | {
87 | if(!init)
88 | {
89 | try
90 | {
91 | int _ackcount=sftp.seq-startid;
92 | while(_ackcount>ackcount)
93 | {
94 | if(!sftp.checkStatus(null, header))
95 | {
96 | break;
97 | }
98 | ackcount++;
99 | }
100 | }
101 | catch(SftpException e)
102 | {
103 | throw new IOException(e.toString());
104 | }
105 | }
106 |
107 | if(monitor!=null)monitor.end();
108 | try{ sftp._sendCLOSE(handle, header); }
109 | catch(IOException e){ throw e; }
110 | catch(Exception e)
111 | {
112 | throw new IOException(e.ToString());
113 | }
114 | }
115 | }
116 | }
117 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Common/Schedules/ScheduledTask.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Microsoft.BizTalk.Scheduler;
3 |
4 | namespace Blogical.Shared.Adapters.Common.Schedules
5 | {
6 | ///
7 | /// ScheduledTask Class implementing the Microsoft.BizTalk.Scheduler.ITask interface.
8 | ///
9 | public class ScheduledTask : ITask
10 | {
11 | // Events
12 |
13 | ///
14 | /// Triggerd on any task event
15 | ///
16 | public event TaskProgressHandler Progress;
17 | ///
18 | /// Event delegate
19 | ///
20 | public delegate void TaskDelegate();
21 | // Fields
22 | private string name;
23 | private ScheduledTask.TaskDelegate taskDelegate;
24 | // Properties
25 | ///
26 | /// Allways false
27 | ///
28 | public bool CanPause
29 | {
30 | get
31 | {
32 | return false;
33 | }
34 | }
35 | ///
36 | /// Allways true
37 | ///
38 | public bool CanStop
39 | {
40 | get
41 | {
42 | return true;
43 | }
44 | }
45 | ///
46 | /// Describes task (not used)
47 | ///
48 | public string Description
49 | {
50 | get
51 | {
52 | return "";
53 | }
54 | }
55 | ///
56 | /// Name of task == URI
57 | ///
58 | public string Name
59 | {
60 | get
61 | {
62 | return this.name;
63 | }
64 | }
65 | // Methods
66 | ///
67 | /// Constructor
68 | ///
69 | ///
70 | ///
71 | public ScheduledTask(string name, ScheduledTask.TaskDelegate taskDelegate)
72 | {
73 | this.name = name;
74 | this.taskDelegate = taskDelegate;
75 | }
76 |
77 | private void FireProgress(TaskProgress progress)
78 | {
79 | if (this.Progress != null)
80 | {
81 | this.Progress(this, new TaskProgressEventArgs(progress));
82 | }
83 | }
84 | ///
85 | /// Pauses the location
86 | ///
87 | public void Pause()
88 | {
89 | }
90 | ///
91 | /// Resumes execution
92 | ///
93 | public void Resume()
94 | {
95 | }
96 | ///
97 | /// Starts task
98 | ///
99 | public void Start()
100 | {
101 | try
102 | {
103 | this.FireProgress(TaskProgress.Started);
104 | this.taskDelegate();
105 | this.FireProgress(TaskProgress.Succeeded);
106 | }
107 | catch (Exception)
108 | {
109 | this.FireProgress(TaskProgress.Failed);
110 | }
111 | }
112 | ///
113 | /// Stops execution of task
114 | ///
115 | public void Stop()
116 | {
117 | }
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/RequestWindowChange.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public class RequestWindowChange : Request
35 | {
36 | internal int width_columns=80;
37 | internal int height_rows=24;
38 | internal int width_pixels=640;
39 | internal int height_pixels=480;
40 | public void setSize(int row, int col, int wp, int hp)
41 | {
42 | this.width_columns=row;
43 | this.height_rows=col;
44 | this.width_pixels=wp;
45 | this.height_pixels=hp;
46 | }
47 | public void request(Session session, Channel channel)
48 | {
49 | Buffer buf=new Buffer();
50 | Packet packet=new Packet(buf);
51 |
52 | //byte SSH_MSG_CHANNEL_REQUEST
53 | //uint32 recipient_channel
54 | //string "window-change"
55 | //boolean FALSE
56 | //uint32 terminal width, columns
57 | //uint32 terminal height, rows
58 | //uint32 terminal width, pixels
59 | //uint32 terminal height, pixels
60 | packet.reset();
61 | buf.putByte((byte) Session.SSH_MSG_CHANNEL_REQUEST);
62 | buf.putInt(channel.getRecipient());
63 | buf.putString(Util.getBytes("window-change"));
64 | buf.putByte((byte)(waitForReply() ? 1 : 0));
65 | buf.putInt(width_columns);
66 | buf.putInt(height_rows);
67 | buf.putInt(width_pixels);
68 | buf.putInt(height_pixels);
69 | session.write(packet);
70 | }
71 | public bool waitForReply(){ return false; }
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/jce/Random.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch.jce
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public class Random : Tamir.SharpSsh.jsch.Random
35 | {
36 | private byte[] tmp=new byte[16];
37 | //private SecureRandom random;
38 | private System.Security.Cryptography.RNGCryptoServiceProvider rand;
39 | public Random()
40 | {
41 | // random=null;
42 | // random = new SecureRandom();
43 | //
44 | // try{ random=SecureRandom.getInstance("SHA1PRNG"); }
45 | // catch(java.security.NoSuchAlgorithmException e){
46 | // // System.out.println(e);
47 | //
48 | // // The following code is for IBM's JCE
49 | // try{ random=SecureRandom.getInstance("IBMSecureRandom"); }
50 | // catch(java.security.NoSuchAlgorithmException ee){
51 | // System.out.println(ee);
52 | // }
53 | // }
54 | rand = new System.Security.Cryptography.RNGCryptoServiceProvider();
55 | }
56 | static int times = 0;
57 | public void fill(byte[] foo, int start, int len)
58 | {
59 | try
60 | {
61 | if(len>tmp.Length){ tmp=new byte[len]; }
62 | //random.nextBytes(tmp);
63 | rand.GetBytes(tmp);
64 | Array.Copy(tmp, 0, foo, start, len);
65 | }
66 | catch(Exception e)
67 | {
68 | times++;
69 | Console.WriteLine(times+") Array.Copy(tmp={0}, 0, foo={1}, {2}, {3}", tmp.Length, foo.Length, start, len);
70 | //Console.WriteLine(e.StackTrace);
71 | }
72 | }
73 | }
74 |
75 | }
76 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp.Management/SftpResource.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:2.0.50727.3053
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Blogical.Shared.Adapters.Sftp.Management {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class SftpResource {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal SftpResource() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Blogical.Shared.Adapters.Sftp.Management.SftpResource", typeof(SftpResource).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 | }
63 | }
64 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/jce/KeyPairGenDSA.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch.jce
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public class KeyPairGenDSA : Tamir.SharpSsh.jsch.KeyPairGenDSA
35 | {
36 | byte[] x; // private
37 | byte[] y; // public
38 | byte[] p;
39 | byte[] q;
40 | byte[] g;
41 |
42 | public void init(int key_size)
43 | {
44 | // KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DSA");
45 | // keyGen.initialize(key_size, new SecureRandom());
46 | // KeyPair pair = keyGen.generateKeyPair();
47 | // PublicKey pubKey=pair.getPublic();
48 | // PrivateKey prvKey=pair.getPrivate();
49 |
50 | System.Security.Cryptography.DSACryptoServiceProvider dsa = new System.Security.Cryptography.DSACryptoServiceProvider(key_size);
51 | System.Security.Cryptography.DSAParameters DSAKeyInfo = dsa.ExportParameters(true);
52 |
53 | // x=((DSAPrivateKey)prvKey).getX().toByteArray();
54 | // y=((DSAPublicKey)pubKey).getY().toByteArray();
55 | //
56 | // DSAParams _params=((DSAKey)prvKey).getParams();
57 | // p=_params.getP().toByteArray();
58 | // q=_params.getQ().toByteArray();
59 | // g=_params.getG().toByteArray();
60 |
61 | x = DSAKeyInfo.X;
62 | y = DSAKeyInfo.Y;
63 | p = DSAKeyInfo.P;
64 | q = DSAKeyInfo.Q;
65 | g = DSAKeyInfo.G;
66 | }
67 | public byte[] getX(){return x;}
68 | public byte[] getY(){return y;}
69 | public byte[] getP(){return p;}
70 | public byte[] getQ(){return q;}
71 | public byte[] getG(){return g;}
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Common/SyncReceiveSubmitBatch.cs:
--------------------------------------------------------------------------------
1 | //---------------------------------------------------------------------
2 | // File: SyncReceiveSubmitBatch.cs
3 | //
4 | // Summary: Implementation of an adapter framework sample adapter.
5 | // This class constitutes one of the BaseAdapter classes, which, are
6 | // a set of generic re-usable set of classes to help adapter writers.
7 | //
8 | // Sample: Base Adapter Class Library v1.0.2
9 | //
10 | // Description: TODO:
11 | //
12 | //---------------------------------------------------------------------
13 | // This file is part of the Microsoft BizTalk Server 2006 SDK
14 | //
15 | // Copyright (c) Microsoft Corporation. All rights reserved.
16 | //
17 | // This source code is intended only as a supplement to Microsoft BizTalk
18 | // Server 2006 release and/or on-line documentation. See these other
19 | // materials for detailed information regarding Microsoft code samples.
20 | //
21 | // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
22 | // KIND, WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
23 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
24 | // PURPOSE.
25 | //---------------------------------------------------------------------
26 |
27 | using System;
28 | using System.Threading;
29 | using System.Collections.Generic;
30 | using Microsoft.BizTalk.TransportProxy.Interop;
31 | using Microsoft.BizTalk.Message.Interop;
32 |
33 | namespace Blogical.Shared.Adapters.Common
34 | {
35 | public class SyncReceiveSubmitBatch : ReceiveBatch
36 | {
37 | private ManualResetEvent workDone;
38 | private bool overallSuccess = false;
39 | private ControlledTermination control;
40 |
41 | public SyncReceiveSubmitBatch(IBTTransportProxy transportProxy, ControlledTermination control, int depth)
42 | : this(transportProxy, control, new ManualResetEvent(false), depth) { }
43 |
44 | private SyncReceiveSubmitBatch(IBTTransportProxy transportProxy, ControlledTermination control,
45 | ManualResetEvent submitComplete, int depth)
46 | : base(transportProxy, control, submitComplete, depth)
47 | {
48 | this.control = control;
49 | this.workDone = submitComplete;
50 | base.ReceiveBatchComplete += new ReceiveBatchCompleteHandler(OnBatchComplete);
51 | }
52 |
53 | private void OnBatchComplete(bool overallSuccess)
54 | {
55 | this.overallSuccess = overallSuccess;
56 | }
57 |
58 | public override void Done()
59 | {
60 | bool needToLeave = control.Enter();
61 |
62 | try
63 | {
64 | base.Done();
65 | }
66 | catch
67 | {
68 | if (needToLeave)
69 | control.Leave();
70 |
71 | throw;
72 | }
73 | }
74 |
75 | public bool Wait()
76 | {
77 | this.workDone.WaitOne();
78 |
79 | return this.overallSuccess;
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/HostKey.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public class HostKey{
35 | private static byte[] sshdss= System.Text.Encoding.Default.GetBytes( "ssh-dss" );
36 | private static byte[] sshrsa= System.Text.Encoding.Default.GetBytes( "ssh-rsa" );
37 |
38 | public const int SSHDSS=0;
39 | public const int SSHRSA=1;
40 | public const int UNKNOWN=2;
41 |
42 | internal String host;
43 | internal int type;
44 | internal byte[] key;
45 | public HostKey(String host, byte[] key)
46 | {
47 | this.host=host; this.key=key;
48 | if(key[8]=='d'){ this.type=SSHDSS; }
49 | else if(key[8]=='r'){ this.type=SSHRSA; }
50 | else { throw new JSchException("invalid key type");}
51 | }
52 | internal HostKey(String host, int type, byte[] key){
53 | this.host=host; this.type=type; this.key=key;
54 | }
55 | public String getHost(){ return host; }
56 | public String getType(){
57 | if(type==SSHDSS){ return System.Text.Encoding.Default.GetString(sshdss); }
58 | if(type==SSHRSA){ return System.Text.Encoding.Default.GetString(sshrsa);}
59 | return "UNKNOWN";
60 | }
61 | public String getKey(){
62 | return Convert.ToBase64String(key, 0, key.Length);
63 | }
64 | public String getFingerPrint(JSch jsch){
65 | HASH hash=null;
66 | try{
67 | hash=(HASH)Activator.CreateInstance(Type.GetType(jsch.getConfig("md5")));
68 | }
69 | catch(Exception e){ Console.Error.WriteLine("getFingerPrint: "+e); }
70 | return Util.getFingerPrint(hash, key);
71 | }
72 | }
73 |
74 | }
75 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/ChannelShell.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Tamir.SharpSsh.java.lang;
3 |
4 | namespace Tamir.SharpSsh.jsch
5 | {
6 | /* -*-mode:java; c-basic-offset:2; -*- */
7 | /*
8 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without
11 | modification, are permitted provided that the following conditions are met:
12 |
13 | 1. Redistributions of source code must retain the above copyright notice,
14 | this list of conditions and the following disclaimer.
15 |
16 | 2. Redistributions in binary form must reproduce the above copyright
17 | notice, this list of conditions and the following disclaimer in
18 | the documentation and/or other materials provided with the distribution.
19 |
20 | 3. The names of the authors may not be used to endorse or promote products
21 | derived from this software without specific prior written permission.
22 |
23 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
24 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
25 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
26 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
27 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
29 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
32 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | */
34 |
35 | public class ChannelShell : ChannelSession
36 | {
37 | internal bool xforwading=false;
38 | internal bool pty=true;
39 | public override void setXForwarding(bool foo){ xforwading=foo; }
40 | public void setPty(bool foo){ pty=foo; }
41 | public override void start()
42 | {
43 | try
44 | {
45 | Request request;
46 | if(xforwading)
47 | {
48 | request=new RequestX11();
49 | request.request(session, this);
50 | }
51 | if(pty)
52 | {
53 | request=new RequestPtyReq();
54 | request.request(session, this);
55 | }
56 | request=new RequestShell();
57 | request.request(session, this);
58 | }
59 | catch//(Exception e)
60 | {
61 | throw new JSchException("ChannelShell");
62 | }
63 | thread=new Thread(this);
64 | thread.setName("Shell for "+session.host);
65 | thread.start();
66 | }
67 | public override void init()
68 | {
69 | io.setInputStream(session.In);
70 | io.setOutputStream(session.Out);
71 | }
72 |
73 | public void setPtySize(int col, int row, int wp, int hp)
74 | {
75 | //if(thread==null) return;
76 | try
77 | {
78 | RequestWindowChange request=new RequestWindowChange();
79 | request.setSize(col, row, wp, hp);
80 | request.request(session, this);
81 | }
82 | catch(Exception e)
83 | {
84 | throw new JSchException("ChannelShell.setPtySize: "+e.ToString());
85 | }
86 | }
87 | }
88 |
89 | }
90 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/RequestSubsystem.cs:
--------------------------------------------------------------------------------
1 |
2 | using Tamir.SharpSsh.java;
3 | using Tamir.SharpSsh.java.lang;
4 |
5 | namespace Tamir.SharpSsh.jsch
6 | {
7 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
8 | /*
9 | Copyright (c) 2005 ymnk, JCraft,Inc. All rights reserved.
10 |
11 | Redistribution and use in source and binary forms, with or without
12 | modification, are permitted provided that the following conditions are met:
13 |
14 | 1. Redistributions of source code must retain the above copyright notice,
15 | this list of conditions and the following disclaimer.
16 |
17 | 2. Redistributions in binary form must reproduce the above copyright
18 | notice, this list of conditions and the following disclaimer in
19 | the documentation and/or other materials provided with the distribution.
20 |
21 | 3. The names of the authors may not be used to endorse or promote products
22 | derived from this software without specific prior written permission.
23 |
24 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
25 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
26 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
27 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
30 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
33 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 | */
35 |
36 | public class RequestSubsystem : Request
37 | {
38 | private bool want_reply=true;
39 | private String subsystem=null;
40 | public void request(Session session, Channel channel, String subsystem, bool want_reply)
41 | {
42 | this.subsystem=subsystem;
43 | this.want_reply=want_reply;
44 | this.request(session, channel);
45 | }
46 | public void request(Session session, Channel channel)
47 | {
48 | Buffer buf=new Buffer();
49 | Packet packet=new Packet(buf);
50 |
51 | bool reply=waitForReply();
52 | if(reply)
53 | {
54 | channel.reply=-1;
55 | }
56 |
57 | packet.reset();
58 | buf.putByte((byte)Session.SSH_MSG_CHANNEL_REQUEST);
59 | buf.putInt(channel.getRecipient());
60 | buf.putString( new String( "subsystem" ).getBytes());
61 | buf.putByte((byte)(waitForReply() ? 1 : 0));
62 | buf.putString(subsystem.getBytes());
63 | session.write(packet);
64 |
65 | if(reply)
66 | {
67 | while(channel.reply==-1)
68 | {
69 | try
70 | {
71 | Thread.sleep(10);
72 | }
73 | catch
74 | {
75 | }
76 | }
77 | if(channel.reply==0)
78 | {
79 | throw new JSchException("failed to send subsystem request");
80 | }
81 | }
82 | }
83 | public bool waitForReply(){ return want_reply; }
84 | }
85 |
86 | }
87 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/ChannelSession.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Tamir.SharpSsh.java.lang;
3 | using Str = Tamir.SharpSsh.java.String;
4 |
5 | namespace Tamir.SharpSsh.jsch
6 | {
7 | /* -*-mode:java; c-basic-offset:2; -*- */
8 | /*
9 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
10 |
11 | Redistribution and use in source and binary forms, with or without
12 | modification, are permitted provided that the following conditions are met:
13 |
14 | 1. Redistributions of source code must retain the above copyright notice,
15 | this list of conditions and the following disclaimer.
16 |
17 | 2. Redistributions in binary form must reproduce the above copyright
18 | notice, this list of conditions and the following disclaimer in
19 | the documentation and/or other materials provided with the distribution.
20 |
21 | 3. The names of the authors may not be used to endorse or promote products
22 | derived from this software without specific prior written permission.
23 |
24 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
25 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
26 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
27 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
28 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
30 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
33 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 | */
35 | public class ChannelSession : Channel
36 | {
37 | private static byte[] _session=new Str("session").getBytes();
38 | public ChannelSession():base()
39 | {
40 | type=_session;
41 | io=new IO();
42 | }
43 |
44 | public override void run()
45 | {
46 | //System.out.println(this+":run >");
47 | /*
48 | if(thread!=null){ return; }
49 | thread=Thread.currentThread();
50 | */
51 |
52 | // Buffer buf=new Buffer();
53 | Buffer buf=new Buffer(rmpsize);
54 | Packet packet=new Packet(buf);
55 | int i=-1;
56 | try
57 | {
58 | while(isConnected() &&
59 | thread!=null &&
60 | io!=null &&
61 | io.ins!=null)
62 | {
63 | i=io.ins.Read(buf.buffer,
64 | 14,
65 | buf.buffer.Length-14
66 | -32 -20 // padding and mac
67 | );
68 | if(i==0)continue;
69 | if(i==-1)
70 | {
71 | eof();
72 | break;
73 | }
74 | if(_close)break;
75 | packet.reset();
76 | buf.putByte((byte)Session.SSH_MSG_CHANNEL_DATA);
77 | buf.putInt(recipient);
78 | buf.putInt(i);
79 | buf.skip(i);
80 | session.write(packet, this, i);
81 | }
82 | }
83 | catch(Exception e)
84 | {
85 | Console.WriteLine("# ChannelSession.run");
86 | Console.WriteLine(e);
87 | }
88 | if(thread!=null)
89 | {
90 | //lock(thread){ System.Threading.Monitor.PulseAll(this);/*thread.notifyAll();*/ }
91 | }
92 | thread=null;
93 | //System.out.println(this+":run <");
94 | }
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/jce/HMACMD596.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch.jce
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public class HMACMD596 : MAC
35 | {
36 | private const String name="hmac-md5-96";
37 | private const int bsize=12;
38 | private Org.Mentalis.Security.Cryptography.HMAC mentalis_mac;
39 | private System.Security.Cryptography.CryptoStream cs;
40 | //private Mac mac;
41 | public int getBlockSize(){return bsize;}
42 | public void init(byte[] key)
43 | {
44 | if(key.Length>16)
45 | {
46 | byte[] tmp=new byte[16];
47 | Array.Copy(key, 0, tmp, 0, 16);
48 | key=tmp;
49 | }
50 | // SecretKeySpec skey=new SecretKeySpec(key, "HmacMD5");
51 | // mac=Mac.getInstance("HmacMD5");
52 | // mac.init(skey);
53 | mentalis_mac = new Org.Mentalis.Security.Cryptography.HMAC(new System.Security.Cryptography.MD5CryptoServiceProvider(), key);
54 | cs = new System.Security.Cryptography.CryptoStream( System.IO.Stream.Null, mentalis_mac, System.Security.Cryptography.CryptoStreamMode.Write);
55 | }
56 | private byte[] tmp=new byte[4];
57 | public void update(int i)
58 | {
59 | tmp[0]=(byte)(i>>24);
60 | tmp[1]=(byte)(i>>16);
61 | tmp[2]=(byte)(i>>8);
62 | tmp[3]=(byte)i;
63 | update(tmp, 0, 4);
64 | }
65 | public void update(byte[] foo, int s, int l)
66 | {
67 | //mac.update(foo, s, l);
68 | cs.Write( foo, s, l);
69 | }
70 | private byte[] buf=new byte[12];
71 | public byte[] doFinal()
72 | {
73 | cs.Close();
74 | Array.Copy( mentalis_mac.Hash, 0, buf, 0, 12);
75 | return buf;
76 | }
77 | public String getName()
78 | {
79 | return name;
80 | }
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/ChannelExec.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 | using System.Net.Sockets;
4 | using System.IO;
5 | using Tamir.SharpSsh.java.lang;
6 |
7 | namespace Tamir.SharpSsh.jsch
8 | {
9 | /* -*-mode:java; c-basic-offset:2; -*- */
10 | /*
11 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
12 |
13 | Redistribution and use ins source and binary forms, with or without
14 | modification, are permitted provided that the following conditions are met:
15 |
16 | 1. Redistributions of source code must retain the above copyright notice,
17 | this list of conditions and the following disclaimer.
18 |
19 | 2. Redistributions ins binary form must reproduce the above copyright
20 | notice, this list of conditions and the following disclaimer ins
21 | the documentation and/or other materials provided with the distribution.
22 |
23 | 3. The names of the authors may not be used to endorse or promote products
24 | derived from this software without specific prior written permission.
25 |
26 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
27 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
28 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
29 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
30 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
32 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
35 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 | */
37 |
38 | public class ChannelExec : ChannelSession
39 | {
40 | bool xforwading=false;
41 | bool pty=false;
42 | String command="";
43 | /*
44 | ChannelExec(){
45 | super();
46 | type="session".getBytes();
47 | io=new IO();
48 | }
49 | */
50 | public override void setXForwarding(bool foo){ xforwading=foo; }
51 | public void setPty(bool foo){ pty=foo; }
52 | public override void start()
53 | {
54 | try
55 | {
56 | Request request;
57 |
58 | if(xforwading)
59 | {
60 | request=new RequestX11();
61 | request.request(session, this);
62 | }
63 |
64 | if(pty)
65 | {
66 | request=new RequestPtyReq();
67 | request.request(session, this);
68 | }
69 |
70 | request=new RequestExec(command);
71 | request.request(session, this);
72 | }
73 | catch(Exception e)
74 | {
75 | throw new JSchException("ChannelExec");
76 | }
77 | thread=new Thread(this);
78 | thread.setName("Exec thread "+session.getHost());
79 | thread.start();
80 | }
81 | public void setCommand(String foo){ command=foo;}
82 | public override void init()
83 | {
84 | io.setInputStream(session.In);
85 | io.setOutputStream(session.Out);
86 | }
87 | //public void finalize() throws java.lang.Throwable{ super.finalize(); }
88 | public void setErrStream(Stream Out)
89 | {
90 | setExtOutputStream(Out);
91 | }
92 | public Stream getErrStream()
93 | {
94 | return getExtInputStream();
95 | }
96 | }
97 |
98 | }
99 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/ChannelSubsystem.cs:
--------------------------------------------------------------------------------
1 | /* -*-mode:java; c-basic-offset:2; indent-tabs-mode:nil -*- */
2 | /*
3 | Copyright (c) 2005 ymnk, JCraft,Inc. All rights reserved.
4 |
5 | Redistribution and use in source and binary forms, with or without
6 | modification, are permitted provided that the following conditions are met:
7 |
8 | 1. Redistributions of source code must retain the above copyright notice,
9 | this list of conditions and the following disclaimer.
10 |
11 | 2. Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in
13 | the documentation and/or other materials provided with the distribution.
14 |
15 | 3. The names of the authors may not be used to endorse or promote products
16 | derived from this software without specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
19 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
21 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
24 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
27 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 | */
29 |
30 | using System;
31 | using Tamir.SharpSsh.java.net;
32 | using Tamir.SharpSsh.java.lang;
33 |
34 | namespace Tamir.SharpSsh.jsch
35 | {
36 | public class ChannelSubsystem : ChannelSession
37 | {
38 | bool xforwading=false;
39 | bool pty=false;
40 | bool want_reply=true;
41 | String subsystem="";
42 | public override void setXForwarding(bool foo){ xforwading=true; }
43 | public void setPty(bool foo){ pty=foo; }
44 | public void setWantReply(bool foo){ want_reply=foo; }
45 | public void setSubsystem(String foo){ subsystem=foo; }
46 | public override void start()
47 | {
48 | try
49 | {
50 | Request request;
51 | if(xforwading)
52 | {
53 | request=new RequestX11();
54 | request.request(session, this);
55 | }
56 | if(pty)
57 | {
58 | request=new RequestPtyReq();
59 | request.request(session, this);
60 | }
61 | request=new RequestSubsystem();
62 | ((RequestSubsystem)request).request(session, this, subsystem, want_reply);
63 | }
64 | catch(Exception e)
65 | {
66 | if(e is JSchException){ throw (JSchException)e; }
67 | throw new JSchException("ChannelSubsystem");
68 | }
69 | Thread thread=new Thread(this);
70 | thread.setName("Subsystem for "+session.host);
71 | thread.start();
72 | }
73 | //public void finalize() throws Throwable{ super.finalize(); }
74 | public override void init()
75 | {
76 | io.setInputStream(session.In);
77 | io.setOutputStream(session.Out);
78 | }
79 | public void setErrStream(System.IO.Stream outs)
80 | {
81 | setExtOutputStream(outs);
82 | }
83 | public java.io.InputStream getErrStream()
84 | {
85 | return getExtInputStream();
86 | }
87 | }
88 |
89 | }
90 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/jce/HMACMD5.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch.jce
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public class HMACMD5 : MAC
35 | {
36 | private const String name="hmac-md5";
37 | private const int bsize=16;
38 | private Org.Mentalis.Security.Cryptography.HMAC mentalis_mac;
39 | private System.Security.Cryptography.CryptoStream cs;
40 | //private Mac mac;
41 | public int getBlockSize(){return bsize;}
42 | public void init(byte[] key)
43 | {
44 | if(key.Length>bsize)
45 | {
46 | byte[] tmp=new byte[bsize];
47 | Array.Copy(key, 0, tmp, 0, bsize);
48 | key=tmp;
49 | }
50 | // SecretKeySpec skey=new SecretKeySpec(key, "HmacMD5");
51 | // mac=Mac.getInstance("HmacMD5");
52 | // mac.init(skey);
53 | mentalis_mac = new Org.Mentalis.Security.Cryptography.HMAC(new System.Security.Cryptography.MD5CryptoServiceProvider(), key);
54 | cs = new System.Security.Cryptography.CryptoStream( System.IO.Stream.Null, mentalis_mac, System.Security.Cryptography.CryptoStreamMode.Write);
55 | }
56 |
57 | private byte[] tmp=new byte[4];
58 | public void update(int i)
59 | {
60 | tmp[0]=(byte)(i>>24);
61 | tmp[1]=(byte)(i>>16);
62 | tmp[2]=(byte)(i>>8);
63 | tmp[3]=(byte)i;
64 | update(tmp, 0, 4);
65 | }
66 | public void update(byte[] foo, int s, int l)
67 | {
68 | //mac.update(foo, s, l);
69 | cs.Write( foo, s, l);
70 | }
71 | public byte[] doFinal()
72 | {
73 | //return mac.doFinal();
74 | cs.Close();
75 | byte[] result = mentalis_mac.Hash;
76 | byte[] key = mentalis_mac.Key;
77 | mentalis_mac.Clear();
78 | init(key);
79 |
80 | return result;
81 | }
82 | public String getName()
83 | {
84 | return name;
85 | }
86 | }
87 |
88 | }
89 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/jce/HMACSHA196.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch.jce
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public class HMACSHA196 : MAC
35 | {
36 | private const String name="hmac-sha1-96";
37 | private const int bsize=12;
38 | private Org.Mentalis.Security.Cryptography.HMAC mentalis_mac;
39 | private System.Security.Cryptography.CryptoStream cs;
40 | //private Mac mac;
41 | public int getBlockSize(){return bsize;}
42 | public void init(byte[] key)
43 | {
44 | if(key.Length>20)
45 | {
46 | byte[] tmp=new byte[20];
47 | Array.Copy(key, 0, tmp, 0, 20);
48 | key=tmp;
49 | }
50 | // SecretKeySpec skey=new SecretKeySpec(key, "HmacSHA1");
51 | // mac=Mac.getInstance("HmacSHA1");
52 | // mac.init(skey);
53 | mentalis_mac = new Org.Mentalis.Security.Cryptography.HMAC(new System.Security.Cryptography.MD5CryptoServiceProvider(), key);
54 | cs = new System.Security.Cryptography.CryptoStream( System.IO.Stream.Null, mentalis_mac, System.Security.Cryptography.CryptoStreamMode.Write);
55 | }
56 | private byte[] tmp=new byte[4];
57 | public void update(int i)
58 | {
59 | tmp[0]=(byte)(i>>24);
60 | tmp[1]=(byte)(i>>16);
61 | tmp[2]=(byte)(i>>8);
62 | tmp[3]=(byte)i;
63 | update(tmp, 0, 4);
64 | }
65 | public void update(byte[] foo, int s, int l)
66 | {
67 | //mac.update(foo, s, l);
68 | cs.Write( foo , s, l);
69 | }
70 | private byte[] buf=new byte[12];
71 | public byte[] doFinal()
72 | {
73 | // System.arraycopy(mac.doFinal(), 0, buf, 0, 12);
74 | // return buf;
75 | cs.Close();
76 | Array.Copy( mentalis_mac.Hash, 0, buf, 0, 12);
77 | return buf;
78 | }
79 | public String getName()
80 | {
81 | return name;
82 | }
83 | }
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp/SSOConfigHelper.cs:
--------------------------------------------------------------------------------
1 | //---------------------------------------------------------------------
2 | // File: SSOConfigHelper.cs
3 | //
4 | // Summary: SSOConfigHelper class for reading/writing cofiguration values to/from SSO
5 | //
6 | // Sample: SSO as Configuration Store (BizTalk Server Sample)
7 | //
8 | //---------------------------------------------------------------------
9 | // This file is part of the Microsoft BizTalk Server 2006 SDK
10 | //
11 | // Copyright (c) Microsoft Corporation. All rights reserved.
12 | //
13 | // This source code is intended only as a supplement to Microsoft BizTalk
14 | // Server 2006 release and/or on-line documentation. See these other
15 | // materials for detailed information regarding Microsoft code samples.
16 | //
17 | // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
18 | // KIND, WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
19 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
20 | // PURPOSE.
21 | //---------------------------------------------------------------------
22 |
23 |
24 | using System;
25 | using System.Collections;
26 | using System.Collections.Specialized;
27 | using Microsoft.BizTalk.SSOClient.Interop;
28 |
29 | namespace Microsoft.SSO.Utility
30 | {
31 | public class ConfigurationPropertyBag : IPropertyBag
32 | {
33 | private HybridDictionary properties;
34 | internal ConfigurationPropertyBag()
35 | {
36 | properties = new HybridDictionary();
37 | }
38 | public void Read(string propName, out object ptrVar, int errLog)
39 | {
40 | ptrVar = properties[propName];
41 | }
42 | public void Write(string propName, ref object ptrVar)
43 | {
44 | properties.Add(propName, ptrVar);
45 | }
46 | public bool Contains(string key)
47 | {
48 | return properties.Contains(key);
49 | }
50 | public void Remove(string key)
51 | {
52 | properties.Remove(key);
53 | }
54 | }
55 |
56 |
57 | public static class SSOConfigHelper
58 | {
59 | ///
60 | /// Struct to hold username+password credentials.
61 | ///
62 | public struct Credentials
63 | {
64 | public string Username;
65 | public string Password;
66 | }
67 |
68 |
69 | /// Retrieves the credentials to use.
70 | ///
71 | /// The name of the affiliate application to represent the configuration container to access
72 | /// Credentials to use.
73 | public static Credentials GetCredentials(string appName)
74 | {
75 | Credentials credentials;
76 | try
77 | {
78 | ISSOLookup1 ssoLookup = (ISSOLookup1)new SSOLookup();
79 | string[] passwords;
80 | passwords = ssoLookup.GetCredentials(appName, 0, out credentials.Username);
81 | credentials.Password = passwords[0];
82 | }
83 | catch (Exception e)
84 | {
85 | System.Diagnostics.Trace.WriteLine(e.Message);
86 | throw;
87 | }
88 | return credentials;
89 | }
90 | }
91 | }
92 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/jce/HMACSHA1.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Tamir.SharpSsh.jsch.jce
4 | {
5 | /* -*-mode:java; c-basic-offset:2; -*- */
6 | /*
7 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without
10 | modification, are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright
16 | notice, this list of conditions and the following disclaimer in
17 | the documentation and/or other materials provided with the distribution.
18 |
19 | 3. The names of the authors may not be used to endorse or promote products
20 | derived from this software without specific prior written permission.
21 |
22 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
23 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
24 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
25 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | */
33 |
34 | public class HMACSHA1 : MAC
35 | {
36 | private const String name="hmac-sha1";
37 | private const int bsize=20;
38 | private Org.Mentalis.Security.Cryptography.HMAC mentalis_mac;
39 | private System.Security.Cryptography.CryptoStream cs;
40 | //private Mac mac;
41 | public int getBlockSize(){return bsize;}
42 | public void init(byte[] key)
43 | {
44 | if(key.Length>bsize)
45 | {
46 | byte[] tmp=new byte[bsize];
47 | Array.Copy(key, 0, tmp, 0, bsize);
48 | key=tmp;
49 | }
50 | // SecretKeySpec skey=new SecretKeySpec(key, "HmacSHA1");
51 | // mac=Mac.getInstance("HmacSHA1");
52 | // mac.init(skey);
53 | mentalis_mac = new Org.Mentalis.Security.Cryptography.HMAC(new System.Security.Cryptography.SHA1CryptoServiceProvider(), key);
54 | cs = new System.Security.Cryptography.CryptoStream( System.IO.Stream.Null, mentalis_mac, System.Security.Cryptography.CryptoStreamMode.Write);
55 | }
56 | private byte[] tmp=new byte[4];
57 | public void update(int i)
58 | {
59 | tmp[0]=(byte)(i>>24);
60 | tmp[1]=(byte)(i>>16);
61 | tmp[2]=(byte)(i>>8);
62 | tmp[3]=(byte)i;
63 | update(tmp, 0, 4);
64 | }
65 | public void update(byte[] foo, int s, int l)
66 | {
67 | //mac.update(foo, s, l);
68 | cs.Write( foo , s, l);
69 | }
70 | public byte[] doFinal()
71 | {
72 | Console.WriteLine("Sha1");
73 | //return mac.doFinal();
74 | cs.Close();
75 | byte[] result = mentalis_mac.Hash;
76 | byte[] key = mentalis_mac.Key;
77 | mentalis_mac.Clear();
78 | init(key);
79 |
80 | return result;
81 | }
82 | public String getName()
83 | {
84 | return name;
85 | }
86 | }
87 |
88 | }
89 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/java/io/JStream.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using IO = System.IO;
3 |
4 | namespace Tamir.SharpSsh.java.io
5 | {
6 | ///
7 | /// Summary description for Stream.
8 | ///
9 | public class JStream : IO.Stream
10 | {
11 | internal IO.Stream s;
12 | public JStream(IO.Stream s)
13 | {
14 | this.s = s;
15 | }
16 |
17 | public override int Read(byte[] buffer, int offset, int count)
18 | {
19 | return s.Read(buffer, offset, count);
20 | }
21 |
22 | public override int ReadByte()
23 | {
24 | return s.ReadByte();
25 | }
26 |
27 | public int read(byte[] buffer, int offset, int count)
28 | {
29 | return Read(buffer, offset, count);
30 | }
31 |
32 | public int read(byte[] buffer)
33 | {
34 | return Read(buffer, 0, buffer.Length);
35 | }
36 |
37 | public int read()
38 | {
39 | return ReadByte();
40 | }
41 |
42 | public void close()
43 | {
44 | this.Close();
45 | }
46 |
47 | public override void Close()
48 | {
49 | s.Close ();
50 | }
51 |
52 | public override void WriteByte(byte value)
53 | {
54 | s.WriteByte(value);
55 | }
56 |
57 | public override void Write(byte[] buffer, int offset, int count)
58 | {
59 | s.Write(buffer, offset, count);
60 | }
61 |
62 | public void write(byte[] buffer, int offset, int count)
63 | {
64 | Write(buffer, offset, count);
65 | }
66 |
67 | public void write(byte[] buffer)
68 | {
69 | Write(buffer, 0, buffer.Length);
70 | }
71 |
72 | public override bool CanRead
73 | {
74 | get {return s.CanRead;}
75 | }
76 | public override bool CanWrite
77 | {
78 | get
79 | {
80 | return s.CanWrite;
81 | }
82 | }
83 | public override bool CanSeek
84 | {
85 | get
86 | {
87 | return s.CanSeek;
88 | }
89 | }
90 | public override void Flush()
91 | {
92 | s.Flush();
93 | }
94 | public override long Length
95 | {
96 | get
97 | {
98 | return s.Length;
99 | }
100 | }
101 | public override long Position
102 | {
103 | get
104 | {
105 | return s.Position;
106 | }
107 | set
108 | {
109 | s.Position = value;
110 | }
111 | }
112 | public override void SetLength(long value)
113 | {
114 | s.SetLength(value);
115 | }
116 | public override long Seek(long offset, IO.SeekOrigin origin)
117 | {
118 | return s.Seek(offset, origin);
119 | }
120 |
121 | public long skip(long len)
122 | {
123 | //Seek doesn't work
124 | //return Seek(offset, IO.SeekOrigin.Current);
125 | int i=0;
126 | int count = 0;
127 | byte[] buf = new byte[len];
128 | while(len>0)
129 | {
130 | i=Read(buf, count, (int)len);//tamir: possible lost of pressision
131 | if(i<=0)
132 | {
133 | throw new Exception("inputstream is closed");
134 | //return (s-foo)==0 ? i : s-foo;
135 | }
136 | count+=i;
137 | len-=i;
138 | }
139 | return count;
140 | }
141 |
142 | public int available()
143 | {
144 | if(s is Tamir.Streams.PipedInputStream)
145 | {
146 | return ((Tamir.Streams.PipedInputStream)s).available();
147 | }
148 | throw new Exception("JStream.available() -- Method not implemented");
149 | }
150 |
151 | public void flush()
152 | {
153 | s.Flush();
154 | }
155 | }
156 | }
157 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp/SftpReceiver.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Xml;
3 | using Microsoft.BizTalk.Component.Interop;
4 | using Blogical.Shared.Adapters.Common;
5 | using System.Diagnostics;
6 | using Blogical.Shared.Adapters.Sftp.ConnectionPool;
7 |
8 | namespace Blogical.Shared.Adapters.Sftp
9 | {
10 | ///
11 | /// Main class for Sftp receive adapters. It provides the implementations of
12 | /// core interfaces needed to comply with receiver adapter contract.
13 | /// (1) This class is actually a Singleton. That is there will only ever be one
14 | /// instance of it created however many locations of this type are actually defined.
15 | /// (2) Individual locations are identified by a URI and are associated with SftpReceiverEndpoint
16 | /// (3) It is legal to have messages from different locations submitted in a single
17 | /// batch and this may be an important optimization. And this is fundamentally why
18 | /// the Receiver is a singleton.
19 | ///
20 | public class SftpReceiver : Receiver
21 | {
22 | ///
23 | /// Constructor
24 | ///
25 | public SftpReceiver()
26 | : base(
27 | "Sftp Receive Adapter",
28 | "1.0",
29 | "Submits files from ssh server into BizTalk",
30 | "Blogical.Shared.Adapters.Sftp",
31 | new Guid("a55cbe83-f168-435a-b63e-a506df52e7ef"),
32 | "http://schemas.microsoft.com/BizTalk/2006/sftp-properties",
33 | typeof(SftpReceiverEndpoint))
34 | {
35 | }
36 | ///
37 | /// This function is called when BizTalk runtime gives the handler properties to adapter.
38 | ///
39 | protected override void HandlerPropertyBagLoaded ()
40 | {
41 | IPropertyBag config = this.HandlerPropertyBag;
42 | if (null != config)
43 | {
44 |
45 | XmlDocument handlerConfigDom = ConfigProperties.IfExistsExtractConfigDom(config);
46 | if (null != handlerConfigDom)
47 | {
48 | SftpReceiveProperties.ReceiveHandlerConfiguration(handlerConfigDom);
49 | }
50 | }
51 | }
52 | ///
53 | /// Overrides Initialize to show trace information
54 | ///
55 | ///
56 | public override void Initialize(Microsoft.BizTalk.TransportProxy.Interop.IBTTransportProxy transportProxy)
57 | {
58 |
59 | Trace.WriteLine("[SftpReceiveAdapter] Adapter Initializing...");
60 | base.Initialize(transportProxy);
61 | Trace.WriteLine("[SftpReceiveAdapter] Adapter Initialized");
62 | }
63 | ///
64 | /// Overrides Terminate to show trace information
65 | ///
66 | public override void Terminate()
67 | {
68 | Trace.WriteLine("[SftpReceiveAdapter] Adapter Terminates...");
69 | try
70 | {
71 | SftpConnectionPool.Dispose();
72 | base.Terminate();
73 | }
74 | catch(Exception ex)
75 | {
76 | ExceptionHandling.HandleComponentException(System.Reflection.MethodBase.GetCurrentMethod(), ex);
77 | }
78 | Trace.WriteLine("[SftpReceiveAdapter] Adapter Terminated");
79 | }
80 |
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Common/ControlledTermination.cs:
--------------------------------------------------------------------------------
1 | //---------------------------------------------------------------------
2 | // File: ControlledTermination.cs
3 | //
4 | // Summary: Implementation of an adapter framework sample adapter.
5 | // This class constitutes one of the BaseAdapter classes, which, are
6 | // a set of generic re-usable set of classes to help adapter writers.
7 | //
8 | // Sample: Base Adapter Class Library v1.0.1
9 | //
10 | // Description: This class is used to keep count of work in flight, an
11 | // adapter should not return from terminate if it has work outstanding
12 | //
13 | //---------------------------------------------------------------------
14 | // This file is part of the Microsoft BizTalk Server 2006 SDK
15 | //
16 | // Copyright (c) Microsoft Corporation. All rights reserved.
17 | //
18 | // This source code is intended only as a supplement to Microsoft BizTalk
19 | // Server 2006 release and/or on-line documentation. See these other
20 | // materials for detailed information regarding Microsoft code samples.
21 | //
22 | // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
23 | // KIND, WHETHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
25 | // PURPOSE.
26 | //---------------------------------------------------------------------
27 |
28 | using System;
29 | using System.Threading;
30 |
31 | namespace Blogical.Shared.Adapters.Common
32 | {
33 | public class ControlledTermination : IDisposable
34 | {
35 | private AutoResetEvent e = new AutoResetEvent(false);
36 | private int activityCount = 0;
37 | private bool terminate = false;
38 |
39 | // to be called at the start of the activity
40 | // returns false if terminate has been called
41 | public bool Enter ()
42 | {
43 | lock (this)
44 | {
45 | if (true == this.terminate)
46 | {
47 | return false;
48 | }
49 |
50 | this.activityCount++;
51 | }
52 | return true;
53 | }
54 |
55 | // to be called at the end of the activity
56 | public void Leave ()
57 | {
58 | lock (this)
59 | {
60 | this.activityCount--;
61 |
62 | // Set the event only if Terminate() is called
63 | if (this.activityCount == 0 && this.terminate)
64 | this.e.Set();
65 | }
66 | }
67 |
68 | // this method blocks waiting for any activity to complete
69 | public void Terminate ()
70 | {
71 | bool result;
72 |
73 | lock (this)
74 | {
75 | this.terminate = true;
76 | result = (this.activityCount == 0);
77 | }
78 |
79 | // If activity count was not zero, wait for pending activities
80 | if (!result)
81 | {
82 | this.e.WaitOne();
83 | }
84 | }
85 |
86 | public bool TerminateCalled
87 | {
88 | get
89 | {
90 | lock (this)
91 | {
92 | return this.terminate;
93 | }
94 | }
95 | }
96 |
97 | public void Dispose()
98 | {
99 | ((IDisposable)this.e).Dispose();
100 | }
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/SharpSSH-1.1.1.13.src/jsch/jce/AES128CBC.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Security.Cryptography;
3 |
4 | namespace Tamir.SharpSsh.jsch.jce
5 | {
6 | /* -*-mode:java; c-basic-offset:2; -*- */
7 | /*
8 | Copyright (c) 2002,2003,2004 ymnk, JCraft,Inc. All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without
11 | modification, are permitted provided that the following conditions are met:
12 |
13 | 1. Redistributions of source code must retain the above copyright notice,
14 | this list of conditions and the following disclaimer.
15 |
16 | 2. Redistributions in binary form must reproduce the above copyright
17 | notice, this list of conditions and the following disclaimer in
18 | the documentation and/or other materials provided with the distribution.
19 |
20 | 3. The names of the authors may not be used to endorse or promote products
21 | derived from this software without specific prior written permission.
22 |
23 | THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
24 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
25 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JCRAFT,
26 | INC. OR ANY CONTRIBUTORS TO THIS SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT,
27 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
29 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
32 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | */
34 |
35 | public class AES128CBC : Cipher
36 | {
37 | private int mode;
38 | private const int ivsize=16;
39 | private const int bsize=16;
40 | private System.Security.Cryptography.RijndaelManaged rijndael;
41 | private ICryptoTransform cipher;
42 | public override int getIVSize(){return ivsize;}
43 | public override int getBlockSize(){return bsize;}
44 | public override void init(int mode, byte[] key, byte[] iv)
45 | {
46 | this.mode=mode;
47 | rijndael = new RijndaelManaged();
48 | rijndael.Mode = CipherMode.CBC;
49 | rijndael.Padding = PaddingMode.None;
50 | //String pad="NoPadding";
51 | byte[] tmp;
52 | if(iv.Length>ivsize)
53 | {
54 | tmp=new byte[ivsize];
55 | Array.Copy(iv, 0, tmp, 0, tmp.Length);
56 | iv=tmp;
57 | }
58 | if(key.Length>bsize)
59 | {
60 | tmp=new byte[bsize];
61 | Array.Copy(key, 0, tmp, 0, tmp.Length);
62 | key=tmp;
63 | }
64 |
65 | try
66 | {
67 | // SecretKeySpec keyspec=new SecretKeySpec(key, "AES");
68 | // cipher=javax.crypto.Cipher.getInstance("AES/CBC/"+pad);
69 |
70 | // cipher.init((mode==ENCRYPT_MODE?
71 | // javax.crypto.Cipher.ENCRYPT_MODE:
72 | // javax.crypto.Cipher.DECRYPT_MODE),
73 | // keyspec, new IvParameterSpec(iv));
74 | cipher = (mode==ENCRYPT_MODE?
75 | rijndael.CreateEncryptor(key, iv):
76 | rijndael.CreateDecryptor(key, iv));
77 | }
78 | catch(Exception e)
79 | {
80 | Console.WriteLine(e);
81 | cipher=null;
82 | }
83 | }
84 | public override void update(byte[] foo, int s1, int len, byte[] bar, int s2)
85 | {
86 | //cipher.update(foo, s1, len, bar, s2);
87 | cipher.TransformBlock(foo, s1, len, bar, s2);
88 | }
89 |
90 | public override string ToString()
91 | {
92 | return "aes128-cbc";
93 | }
94 | }
95 |
96 | }
97 |
--------------------------------------------------------------------------------
/Blogical.Shared.Adapters.Sftp/SharpSsh/MemoryOutputStream.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Text;
4 | using Tamir.SharpSsh.jsch;
5 | using Microsoft.BizTalk.Streaming;
6 | using Tamir.SharpSsh.java.io;
7 | using System.IO;
8 |
9 | namespace Blogical.Shared.Adapters.Sftp.SharpSsh
10 | {
11 | class MemoryOutputStream : OutputStream, IDisposable
12 | {
13 | #region Private Members
14 | ChannelSftp _channel;
15 | string _fileName;
16 | bool _isPopulated = false;
17 | VirtualStream _stream = new VirtualStream(VirtualStream.MemoryFlag.AutoOverFlowToDisk);
18 | #endregion
19 | #region Constructors
20 | public MemoryOutputStream(ChannelSftp channel, string fileName)
21 | {
22 | this._channel = channel;
23 | this._fileName = fileName;
24 | }
25 |
26 | #endregion
27 | #region Public Methods
28 | public void Load()
29 | {
30 | _channel.get(_fileName, this);
31 | _isPopulated = true;
32 | _stream.Position = 0;
33 | }
34 | public override void Write(byte[] buffer, int offset, int count)
35 | {
36 | this._stream.Write(buffer, offset, count);
37 | }
38 | public override int Read(byte[] buffer, int offset, int count)
39 | {
40 | if (!_isPopulated)
41 | {
42 | _channel.get(_fileName, this);
43 | _isPopulated = true;
44 | _stream.Position = 0;
45 | }
46 |
47 | return this._stream.Read(buffer, offset, count);
48 | }
49 | public override long Seek(long offset, System.IO.SeekOrigin origin)
50 | {
51 | return this._stream.Seek(offset, origin);
52 | }
53 | public override void Flush()
54 | {
55 | this._stream.Flush();
56 | }
57 | public override void Close()
58 | {
59 | this._stream.Close();
60 | }
61 | public override int ReadByte()
62 | {
63 | return this._stream.ReadByte();
64 | }
65 | public override void SetLength(long value)
66 | {
67 | this._stream.SetLength(value);
68 | }
69 | #endregion
70 | #region Public Members
71 | public VirtualStream InnerStream
72 | {
73 | get { return _stream; }
74 | }
75 | public override long Position
76 | {
77 | get
78 | {
79 | return this._stream.Position;
80 | }
81 | set
82 | {
83 | this._stream.Position = value;
84 | }
85 | }
86 | public override long Length
87 | {
88 | get
89 | {
90 | return this._stream.Length;
91 | }
92 | }
93 | public override bool CanSeek
94 | {
95 | get
96 | {
97 | return this._stream.CanSeek;
98 | }
99 | }
100 | public override bool CanRead
101 | {
102 | get
103 | {
104 | return this._stream.CanRead;
105 | }
106 | }
107 | public override bool CanWrite
108 | {
109 | get
110 | {
111 | return this._stream.CanWrite;
112 | }
113 | }
114 | #endregion
115 | #region IDisposable Members
116 |
117 | void IDisposable.Dispose()
118 | {
119 | _stream.Dispose();
120 | }
121 |
122 | #endregion
123 | }
124 | }
125 |
--------------------------------------------------------------------------------