├── SSH
├── icon.ico
├── icon.png
├── packages.config
├── App.config
├── Properties
│ ├── Settings.settings
│ └── Settings.Designer.cs
├── ISshConnection.cs
├── App.xaml
├── NativeMethods.cs
└── RelayCommand.cs
├── libsshnet
├── app.rc
├── app.ico
├── resource.h
├── Stdafx.cpp
├── Stdafx.h
├── include
│ └── libssh
│ │ ├── CMakeLists.txt
│ │ ├── knownhosts.h
│ │ ├── crc32.h
│ │ ├── threads.h
│ │ ├── options.h
│ │ ├── bignum.h
│ │ ├── string.h
│ │ ├── ecdh.h
│ │ └── ge25519.h
├── AssemblyInfo.cpp
└── ReadMe.txt
├── Ssh.Net
├── Renci.SshNet.snk
└── Renci.SshNet
│ ├── Properties
│ ├── CommonAssemblyInfo.cs
│ └── AssemblyInfo.cs
│ ├── Messages
│ ├── Transport
│ │ ├── IKeyExchangedAllowed.cs
│ │ ├── NewKeysMessage.cs
│ │ ├── UnimplementedMessage.cs
│ │ ├── KeyExchangeDhGroupExchangeInit.cs
│ │ ├── KeyExchangeDhInitMessage.cs
│ │ ├── KeyExchangeDhGroupExchangeGroup.cs
│ │ ├── ServiceAcceptMessage.cs
│ │ ├── IgnoreMessage.cs
│ │ ├── DebugMessage.cs
│ │ ├── KeyExchangeDhGroupExchangeReply.cs
│ │ ├── KeyExchangeDhReplyMessage.cs
│ │ └── KeyExchangeEcdhInitMessage.cs
│ ├── ServiceName.cs
│ ├── Connection
│ │ ├── GlobalRequestName.cs
│ │ ├── RequestFailureMessage.cs
│ │ ├── ChannelOpen
│ │ │ ├── SessionChannelOpenInfo.cs
│ │ │ └── ChannelOpenInfo.cs
│ │ ├── ChannelOpenFailureReasons.cs
│ │ ├── ChannelEofMessage.cs
│ │ ├── ChannelCloseMessage.cs
│ │ ├── ChannelSuccessMessage.cs
│ │ ├── ChannelFailureMessage.cs
│ │ ├── ChannelRequest
│ │ │ ├── ShellRequestInfo.cs
│ │ │ ├── EndOfWriteRequestInfo.cs
│ │ │ ├── KeepAliveRequestInfo.cs
│ │ │ └── RequestInfo.cs
│ │ ├── ChannelMessage.cs
│ │ └── RequestSuccessMessage.cs
│ ├── Authentication
│ │ ├── SuccessMessage.cs
│ │ ├── RequestMessageNone.cs
│ │ ├── BannerMessage.cs
│ │ ├── PasswordChangeRequiredMessage.cs
│ │ ├── PublicKeyMessage.cs
│ │ └── InformationResponseMessage.cs
│ └── MessageAttribute.cs
│ ├── Security
│ ├── Cryptography
│ │ ├── AsymmetricCipher.cs
│ │ ├── Ciphers
│ │ │ ├── CipherPadding.cs
│ │ │ └── Paddings
│ │ │ │ ├── PKCS5Padding.cs
│ │ │ │ └── PKCS7Padding.cs
│ │ ├── StreamCipher.cs
│ │ └── DigitalSignature.cs
│ ├── Algorithm.cs
│ ├── KeyExchangeDiffieHellmanGroupExchangeSha1.cs
│ ├── KeyExchangeDiffieHellmanGroupExchangeSha256.cs
│ ├── KeyExchangeDiffieHellmanGroup1Sha1.cs
│ └── HostAlgorithm.cs
│ ├── IForwardedPort.cs
│ ├── PasswordConnectionInfo.NET40.cs
│ ├── KeyboardInteractiveConnectionInfo.NET40.cs
│ ├── Shell.NET40.cs
│ ├── Compression
│ ├── CompressionMode.cs
│ ├── Zlib.cs
│ └── ZlibOpenSsh.cs
│ ├── ForwardedPortDynamic.NET40.cs
│ ├── ProxyTypes.cs
│ ├── SftpClient.NET40.cs
│ ├── PasswordAuthenticationMethod.NET40.cs
│ ├── KeyboardInteractiveAuthenticationMethod.NET40.cs
│ ├── ShellStream.NET40.cs
│ ├── SshCommand.NET40.cs
│ ├── AuthenticationResult.cs
│ ├── Channels
│ ├── ChannelDirectTcpip.NET40.cs
│ ├── ChannelTypes.cs
│ ├── ChannelForwardedTcpip.NET40.cs
│ └── IChannelForwardedTcpip.cs
│ ├── ForwardedPortLocal.NET40.cs
│ ├── ForwardedPortRemote.NET40.cs
│ ├── Sftp
│ ├── Responses
│ │ ├── ExtendedReplies
│ │ │ ├── ExtendedReplyInfo.cs
│ │ │ └── StatVfsReplyInfo.cs
│ │ ├── SftpExtendedReplyResponse.cs
│ │ ├── SftpAttrsResponse.cs
│ │ ├── SftpHandleResponse.cs
│ │ ├── SftpResponse.cs
│ │ ├── SftpDataResponse.cs
│ │ ├── SftpVersionResponse.cs
│ │ ├── StatVfsResponse.cs
│ │ ├── SftpStatusResponse.cs
│ │ └── SftpNameResponse.cs
│ ├── SftpDataMessage.cs
│ ├── Requests
│ │ ├── SftpInitRequest.cs
│ │ ├── SftpExtendedRequest.cs
│ │ ├── SftpCloseRequest.cs
│ │ ├── StatVfsRequest.cs
│ │ ├── ExtendedRequests
│ │ │ ├── FStatVfsRequest.cs
│ │ │ ├── HardLinkRequest.cs
│ │ │ ├── StatVfsRequest.cs
│ │ │ └── PosixRenameRequest.cs
│ │ ├── SftpFStatRequest.cs
│ │ ├── SftpReadDirRequest.cs
│ │ ├── PosixRenameRequest.cs
│ │ ├── SftpRmDirRequest.cs
│ │ ├── SftpRemoveRequest.cs
│ │ ├── SftpStatRequest.cs
│ │ ├── SftpLStatRequest.cs
│ │ ├── SftpOpenDirRequest.cs
│ │ ├── SftpReadLinkRequest.cs
│ │ ├── SftpFSetStatRequest.cs
│ │ ├── SftpRealPathRequest.cs
│ │ ├── SftpRenameRequest.cs
│ │ ├── SftpSetStatRequest.cs
│ │ ├── SftpWriteRequest.cs
│ │ ├── SftpUnblockRequest.cs
│ │ ├── SftpSymLinkRequest.cs
│ │ ├── SftpReadRequest.cs
│ │ ├── SftpBlockRequest.cs
│ │ └── SftpMkDirRequest.cs
│ ├── Flags.cs
│ ├── SftpListDirectoryAsyncResult.cs
│ └── SftpSynchronizeDirectoriesAsyncResult.cs
│ ├── ExpectAsyncResult.cs
│ ├── Common
│ ├── AuthenticationEventArgs.cs
│ ├── ChannelEventArgs.cs
│ ├── ExceptionEventArgs.cs
│ ├── ChannelRequestEventArgs.cs
│ ├── ObjectIdentifier.cs
│ ├── AuthenticationPasswordChangeEventArgs.cs
│ ├── ProxyException.NET40.cs
│ ├── SshException.cs
│ ├── ScpException.NET40.cs
│ ├── ShellDataEventArgs.cs
│ ├── AuthenticationBannerEventArgs.cs
│ ├── ScpException.cs
│ ├── ProxyException.cs
│ ├── SshOperationTimeoutException.NET40.cs
│ ├── SshException.NET40.cs
│ ├── NetConfServerException.cs
│ ├── SftpPathNotFoundException.cs
│ ├── SshAuthenticationException.cs
│ ├── ScpUploadEventArgs.cs
│ ├── SshConnectionException.NET40.cs
│ ├── SshOperationTimeoutException.cs
│ ├── SshAuthenticationException.NET40.cs
│ ├── SftpPathNotFoundException.NET40.cs
│ ├── SftpPermissionDeniedException.cs
│ ├── ScpDownloadEventArgs.cs
│ ├── NetConfServerException.NET40.cs
│ ├── SftpPermissionDeniedException.NET40.cs
│ ├── Extensions.NET40.cs
│ ├── SshPassPhraseNullOrEmptyException.NET40.cs
│ ├── SshPassPhraseNullOrEmptyException.cs
│ ├── ChannelOpenFailedEventArgs.cs
│ ├── PortForwardEventArgs.cs
│ ├── ChannelOpenConfirmedEventArgs.cs
│ ├── Extensions.NET.cs
│ ├── AuthenticationPromptEventArgs.cs
│ └── ChannelDataEventArgs.cs
│ ├── IServiceFactory.NET.cs
│ ├── Netconf
│ └── INetConfSession.cs
│ ├── ServiceFactory.NET.cs
│ ├── MessageEventArgs.cs
│ ├── IAuthenticationMethod.cs
│ ├── CipherInfo.cs
│ ├── HashInfo.cs
│ ├── ForwardedPortRemote.NET.cs
│ └── Session.NET40.cs
├── Terminal
├── Properties
│ ├── Settings.settings
│ └── Settings.Designer.cs
├── TerminalRun.cs
├── IStreamNotifier.cs
└── ITerminalHandler.cs
├── TerminalControl
├── Properties
│ ├── Settings.settings
│ └── Settings.Designer.cs
├── NativeMethods.cs
├── Themes
│ └── Generic.xaml
├── RelayCommand.cs
└── DebugColors.cs
├── LICENSE
├── TerminalControlTests
├── DequeTests.cs
└── Properties
│ └── AssemblyInfo.cs
└── TerminalTest
├── Properties
└── AssemblyInfo.cs
└── TerminalLineTests.cs
/SSH/icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/npcook/terminal/HEAD/SSH/icon.ico
--------------------------------------------------------------------------------
/SSH/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/npcook/terminal/HEAD/SSH/icon.png
--------------------------------------------------------------------------------
/libsshnet/app.rc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/npcook/terminal/HEAD/libsshnet/app.rc
--------------------------------------------------------------------------------
/libsshnet/app.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/npcook/terminal/HEAD/libsshnet/app.ico
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet.snk:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/npcook/terminal/HEAD/Ssh.Net/Renci.SshNet.snk
--------------------------------------------------------------------------------
/libsshnet/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by app.rc
4 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Properties/CommonAssemblyInfo.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/npcook/terminal/HEAD/Ssh.Net/Renci.SshNet/Properties/CommonAssemblyInfo.cs
--------------------------------------------------------------------------------
/SSH/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/SSH/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/libsshnet/Stdafx.cpp:
--------------------------------------------------------------------------------
1 | // stdafx.cpp : source file that includes just the standard includes
2 | // libsshnet.pch will be the pre-compiled header
3 | // stdafx.obj will contain the pre-compiled type information
4 |
5 | #include "stdafx.h"
6 |
--------------------------------------------------------------------------------
/SSH/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Terminal/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/SSH/ISshConnection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace npcook.Ssh
8 | {
9 | interface ISshConnection
10 | {
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/TerminalControl/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/libsshnet/Stdafx.h:
--------------------------------------------------------------------------------
1 | // stdafx.h : include file for standard system include files,
2 | // or project specific include files that are used frequently,
3 | // but are changed infrequently
4 |
5 | #pragma once
6 |
7 | #include "libsshnet.h"
8 |
9 | #include
10 |
--------------------------------------------------------------------------------
/SSH/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/Transport/IKeyExchangedAllowed.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Messages.Transport
2 | {
3 | ///
4 | /// Indicates that message that implement this interface is allowed during key exchange phase
5 | ///
6 | public interface IKeyExchangedAllowed
7 | {
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/TerminalControl/NativeMethods.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Runtime.InteropServices;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace npcook.Terminal.Controls
9 | {
10 | static class NativeMethods
11 | {
12 | [DllImport("user32.dll")]
13 | public static extern uint GetCaretBlinkTime();
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Security/Cryptography/AsymmetricCipher.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Security.Cryptography
2 | {
3 | ///
4 | /// Base class for asymmetric cipher implementations.
5 | ///
6 | public abstract class AsymmetricCipher : Cipher
7 | {
8 | public override byte MinimumSize
9 | {
10 | get { return 0; }
11 | }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Security/Algorithm.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Security
2 | {
3 | ///
4 | /// Represents the abstract base class from which all implementations of algorithms must inherit.
5 | ///
6 | public abstract class Algorithm
7 | {
8 | ///
9 | /// Gets algorithm name.
10 | ///
11 | public abstract string Name { get; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/IForwardedPort.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Renci.SshNet
4 | {
5 | ///
6 | /// Supports port forwarding functionality.
7 | ///
8 | public interface IForwardedPort
9 | {
10 | ///
11 | /// The event occurs as the forwarded port is being stopped.
12 | ///
13 | event EventHandler Closing;
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/ServiceName.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Messages
2 | {
3 | ///
4 | /// Specifies list of supported services
5 | ///
6 | public enum ServiceName
7 | {
8 | ///
9 | /// ssh-userauth
10 | ///
11 | UserAuthentication,
12 |
13 | ///
14 | /// ssh-connection
15 | ///
16 | Connection
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/PasswordConnectionInfo.NET40.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using System;
3 |
4 | namespace Renci.SshNet
5 | {
6 | ///
7 | /// Provides connection information when password authentication method is used
8 | ///
9 | public partial class PasswordConnectionInfo
10 | {
11 | partial void ExecuteThread(Action action)
12 | {
13 | Task.Factory.StartNew(action);
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/Connection/GlobalRequestName.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Messages.Connection
2 | {
3 | ///
4 | /// Specifies supported request names.
5 | ///
6 | public enum GlobalRequestName
7 | {
8 | ///
9 | /// tcpip-forward
10 | ///
11 | TcpIpForward,
12 | ///
13 | /// cancel-tcpip-forward
14 | ///
15 | CancelTcpIpForward,
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/KeyboardInteractiveConnectionInfo.NET40.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using System;
3 |
4 | namespace Renci.SshNet
5 | {
6 | ///
7 | /// Provides connection information when keyboard interactive authentication method is used
8 | ///
9 | public partial class KeyboardInteractiveConnectionInfo
10 | {
11 | partial void ExecuteThread(Action action)
12 | {
13 | Task.Factory.StartNew(action);
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Terminal/TerminalRun.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace npcook.Terminal
8 | {
9 | public class TerminalRun
10 | {
11 | public string Text
12 | { get; set; }
13 |
14 | public TerminalFont Font
15 | { get; set; }
16 |
17 | public TerminalRun()
18 | { }
19 |
20 | public TerminalRun(string text, TerminalFont font)
21 | {
22 | Text = text;
23 | Font = font;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Shell.NET40.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 |
4 | namespace Renci.SshNet
5 | {
6 | ///
7 | /// Represents instance of the SSH shell object
8 | ///
9 | public partial class Shell
10 | {
11 | /// is null.
12 | partial void ExecuteThread(Action action)
13 | {
14 | ThreadPool.QueueUserWorkItem(o => action());
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Compression/CompressionMode.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Compression
2 | {
3 | ///
4 | /// Specifies compression modes
5 | ///
6 | public enum CompressionMode
7 | {
8 | ///
9 | /// Specifies that content should be compressed.
10 | ///
11 | Compress = 0,
12 |
13 | ///
14 | /// Specifies that content should be decompressed.
15 | ///
16 | Decompress = 1,
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/ForwardedPortDynamic.NET40.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 |
4 | namespace Renci.SshNet
5 | {
6 | public partial class ForwardedPortDynamic
7 | {
8 | ///
9 | /// Executes the specified action in a separate thread.
10 | ///
11 | /// The action to execute.
12 | partial void ExecuteThread(Action action)
13 | {
14 | ThreadPool.QueueUserWorkItem(o => action());
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/ProxyTypes.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet
2 | {
3 | ///
4 | /// Specifies the type of proxy client will use to connect to server.
5 | ///
6 | public enum ProxyTypes
7 | {
8 | /// No proxy server.
9 | None,
10 | /// A SOCKS4 proxy server.
11 | Socks4,
12 | /// A SOCKS5 proxy server.
13 | Socks5,
14 | /// A HTTP proxy server.
15 | Http,
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/SftpClient.NET40.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 |
4 | namespace Renci.SshNet
5 | {
6 | ///
7 | ///
8 | ///
9 | public partial class SftpClient
10 | {
11 | ///
12 | /// Executes the specified action in a separate thread.
13 | ///
14 | /// The action to execute.
15 | partial void ExecuteThread(Action action)
16 | {
17 | ThreadPool.QueueUserWorkItem(o => action());
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/PasswordAuthenticationMethod.NET40.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 |
4 | namespace Renci.SshNet
5 | {
6 | public partial class PasswordAuthenticationMethod : AuthenticationMethod
7 | {
8 | ///
9 | /// Executes the specified action in a separate thread.
10 | ///
11 | /// The action to execute.
12 | partial void ExecuteThread(Action action)
13 | {
14 | ThreadPool.QueueUserWorkItem(o => action());
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/KeyboardInteractiveAuthenticationMethod.NET40.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 |
4 | namespace Renci.SshNet
5 | {
6 | public partial class KeyboardInteractiveAuthenticationMethod : AuthenticationMethod
7 | {
8 | ///
9 | /// Executes the specified action in a separate thread.
10 | ///
11 | /// The action to execute.
12 | partial void ExecuteThread(Action action)
13 | {
14 | ThreadPool.QueueUserWorkItem(o => action());
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Security/KeyExchangeDiffieHellmanGroupExchangeSha1.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Security
2 | {
3 | ///
4 | /// Represents "diffie-hellman-group-exchange-sha1" algorithm implementation.
5 | ///
6 | public class KeyExchangeDiffieHellmanGroupExchangeSha1 : KeyExchangeDiffieHellmanGroupExchangeShaBase
7 | {
8 | ///
9 | /// Gets algorithm name.
10 | ///
11 | public override string Name
12 | {
13 | get { return "diffie-hellman-group-exchange-sha1"; }
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Terminal/IStreamNotifier.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace npcook.Terminal
9 | {
10 | public class DataAvailableEventArgs : EventArgs
11 | {
12 | public int ChunkSize
13 | { get; }
14 |
15 | public DataAvailableEventArgs(int chunkSize)
16 | {
17 | ChunkSize = chunkSize;
18 | }
19 | }
20 |
21 | public interface IStreamNotifier
22 | {
23 | Stream Stream
24 | { get; }
25 |
26 | event EventHandler DataAvailable;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/ShellStream.NET40.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 |
4 | namespace Renci.SshNet
5 | {
6 | ///
7 | /// Represents instance of the SSH shell object
8 | ///
9 | public partial class ShellStream
10 | {
11 | ///
12 | /// Executes the specified action in a separate thread.
13 | ///
14 | /// The action to execute.
15 | partial void ExecuteThread(Action action)
16 | {
17 | ThreadPool.QueueUserWorkItem(o => action());
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/SshCommand.NET40.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 |
4 | namespace Renci.SshNet
5 | {
6 | ///
7 | /// Represents SSH command that can be executed.
8 | ///
9 | public partial class SshCommand
10 | {
11 | ///
12 | /// Executes the specified action in a separate thread.
13 | ///
14 | /// The action to execute.
15 | partial void ExecuteThread(Action action)
16 | {
17 | ThreadPool.QueueUserWorkItem(o => action());
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Terminal/ITerminalHandler.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading;
7 | using System.Threading.Tasks;
8 |
9 | namespace npcook.Terminal
10 | {
11 | public class TitleChangeEventArgs : EventArgs
12 | {
13 | public string Title
14 | { get; }
15 |
16 | public TitleChangeEventArgs(string title)
17 | {
18 | Title = title;
19 | }
20 | }
21 |
22 | public interface ITerminalHandler
23 | {
24 | TerminalBase Terminal
25 | { get; }
26 |
27 | TerminalFont DefaultFont
28 | { get; set; }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/AuthenticationResult.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet
2 | {
3 | ///
4 | /// Represents possible authentication methods results
5 | ///
6 | public enum AuthenticationResult
7 | {
8 | ///
9 | /// Authentication was successful.
10 | ///
11 | Success,
12 | ///
13 | /// Authentication completed with partial success.
14 | ///
15 | PartialSuccess,
16 | ///
17 | /// Authentication failed.
18 | ///
19 | Failure
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Channels/ChannelDirectTcpip.NET40.cs:
--------------------------------------------------------------------------------
1 | using System.Net.Sockets;
2 |
3 | namespace Renci.SshNet.Channels
4 | {
5 | ///
6 | /// Implements "direct-tcpip" SSH channel.
7 | ///
8 | internal partial class ChannelDirectTcpip
9 | {
10 | partial void InternalSocketReceive(byte[] buffer, ref int read)
11 | {
12 | read = this._socket.Receive(buffer);
13 | }
14 |
15 | partial void InternalSocketSend(byte[] data)
16 | {
17 | this._socket.Send(data, 0, data.Length, SocketFlags.None);
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/ForwardedPortLocal.NET40.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 |
4 | namespace Renci.SshNet
5 | {
6 | ///
7 | /// Provides functionality for local port forwarding
8 | ///
9 | public partial class ForwardedPortLocal
10 | {
11 | ///
12 | /// Executes the specified action in a separate thread.
13 | ///
14 | /// The action to execute.
15 | partial void ExecuteThread(Action action)
16 | {
17 | ThreadPool.QueueUserWorkItem(o => action());
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/ForwardedPortRemote.NET40.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading;
3 |
4 | namespace Renci.SshNet
5 | {
6 | ///
7 | /// Provides functionality for remote port forwarding
8 | ///
9 | public partial class ForwardedPortRemote
10 | {
11 | ///
12 | /// Executes the specified action in a separate thread.
13 | ///
14 | /// The action to execute.
15 | partial void ExecuteThread(Action action)
16 | {
17 | ThreadPool.QueueUserWorkItem(o => action());
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Security/Cryptography/Ciphers/CipherPadding.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Security.Cryptography.Ciphers
2 | {
3 | ///
4 | /// Base class for cipher padding implementations
5 | ///
6 | public abstract class CipherPadding
7 | {
8 | ///
9 | /// Pads specified input to match block size.
10 | ///
11 | /// Size of the block.
12 | /// The input.
13 | /// Padded data array.
14 | public abstract byte[] Pad(int blockSize, byte[] input);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Sftp/Responses/ExtendedReplies/ExtendedReplyInfo.cs:
--------------------------------------------------------------------------------
1 | using Renci.SshNet.Common;
2 | using System;
3 |
4 | namespace Renci.SshNet.Sftp.Responses
5 | {
6 | internal abstract class ExtendedReplyInfo : SshData
7 | {
8 | protected override void LoadData()
9 | {
10 | // Read Message Type
11 | var messageType = this.ReadByte();
12 |
13 | // Read Response ID
14 | var responseId = this.ReadUInt32();
15 | }
16 |
17 | protected override void SaveData()
18 | {
19 | throw new NotImplementedException();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Sftp/Responses/SftpExtendedReplyResponse.cs:
--------------------------------------------------------------------------------
1 | using Renci.SshNet.Common;
2 |
3 | namespace Renci.SshNet.Sftp.Responses
4 | {
5 | internal class SftpExtendedReplyResponse : SftpResponse
6 | {
7 | public override SftpMessageTypes SftpMessageType
8 | {
9 | get { return SftpMessageTypes.ExtendedReply; }
10 | }
11 |
12 | public SftpExtendedReplyResponse(uint protocolVersion)
13 | : base(protocolVersion)
14 | {
15 | }
16 |
17 | public T GetReply() where T : SshData, new()
18 | {
19 | return this.OfType();
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Sftp/SftpDataMessage.cs:
--------------------------------------------------------------------------------
1 | using Renci.SshNet.Messages.Connection;
2 |
3 | namespace Renci.SshNet.Sftp
4 | {
5 | internal class SftpDataMessage : ChannelDataMessage
6 | {
7 | public SftpDataMessage(uint localChannelNumber, SftpMessage sftpMessage)
8 | {
9 | this.LocalChannelNumber = localChannelNumber;
10 |
11 | var messageData = sftpMessage.GetBytes();
12 |
13 | var data = new byte[4 + messageData.Length];
14 |
15 | ((uint)messageData.Length).GetBytes().CopyTo(data, 0);
16 | messageData.CopyTo(data, 4);
17 | this.Data = data;
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Channels/ChannelTypes.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace Renci.SshNet.Channels
3 | {
4 | ///
5 | /// Lists channel types as defined by the protocol.
6 | ///
7 | internal enum ChannelTypes
8 | {
9 | ///
10 | /// session
11 | ///
12 | Session,
13 | ///
14 | /// x11
15 | ///
16 | X11,
17 | ///
18 | /// forwarded-tcpip
19 | ///
20 | ForwardedTcpip,
21 | ///
22 | /// direct-tcpip
23 | ///
24 | DirectTcpip,
25 |
26 |
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/SSH/NativeMethods.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Runtime.InteropServices;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace npcook.Ssh
9 | {
10 | internal static class NativeMethods
11 | {
12 | [StructLayout(LayoutKind.Sequential)]
13 | public struct RECT
14 | {
15 | public int left;
16 | public int top;
17 | public int right;
18 | public int bottom;
19 | }
20 |
21 | [DllImport("user32.dll")]
22 | public static extern bool GetClientRect(IntPtr hwnd, out RECT rect);
23 |
24 | [DllImport("user32.dll")]
25 | public static extern bool GetWindowRect(IntPtr hwnd, out RECT rect);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Security/Cryptography/StreamCipher.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Renci.SshNet.Security.Cryptography
4 | {
5 | ///
6 | /// Base class of stream cipher algorithms.
7 | ///
8 | public abstract class StreamCipher : SymmetricCipher
9 | {
10 | ///
11 | /// Initializes a new instance of the class.
12 | ///
13 | /// The key.
14 | /// is null.
15 | protected StreamCipher(byte[] key)
16 | : base(key)
17 | {
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Sftp/Responses/SftpAttrsResponse.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Sftp.Responses
2 | {
3 | internal class SftpAttrsResponse : SftpResponse
4 | {
5 | public override SftpMessageTypes SftpMessageType
6 | {
7 | get { return SftpMessageTypes.Attrs; }
8 | }
9 |
10 | public SftpFileAttributes Attributes { get; private set; }
11 |
12 | public SftpAttrsResponse(uint protocolVersion)
13 | : base(protocolVersion)
14 | {
15 | }
16 |
17 | protected override void LoadData()
18 | {
19 | base.LoadData();
20 | this.Attributes = this.ReadAttributes();
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Sftp/Responses/SftpHandleResponse.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Sftp.Responses
2 | {
3 | internal class SftpHandleResponse : SftpResponse
4 | {
5 | public override SftpMessageTypes SftpMessageType
6 | {
7 | get { return SftpMessageTypes.Handle; }
8 | }
9 |
10 | public byte[] Handle { get; private set; }
11 |
12 | public SftpHandleResponse(uint protocolVersion)
13 | : base(protocolVersion)
14 | {
15 | }
16 |
17 | protected override void LoadData()
18 | {
19 | base.LoadData();
20 |
21 | this.Handle = this.ReadBinaryString();
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/libsshnet/include/libssh/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | project(libssh-headers C)
2 |
3 | set(libssh_HDRS
4 | callbacks.h
5 | libssh.h
6 | ssh2.h
7 | legacy.h
8 | libsshpp.hpp
9 | )
10 |
11 | if (WITH_SFTP)
12 | set(libssh_HDRS
13 | ${libssh_HDRS}
14 | sftp.h
15 | )
16 | endif (WITH_SFTP)
17 |
18 | if (WITH_SSH1)
19 | set(libssh_HDRS
20 | ${libssh_HDRS}
21 | ssh1.h
22 | )
23 | endif (WITH_SSH1)
24 |
25 | if (WITH_SERVER)
26 | set(libssh_HDRS
27 | ${libssh_HDRS}
28 | server.h
29 | )
30 | endif (WITH_SERVER)
31 |
32 | install(
33 | FILES
34 | ${libssh_HDRS}
35 | DESTINATION
36 | ${INCLUDE_INSTALL_DIR}/${APPLICATION_NAME}
37 | COMPONENT
38 | headers
39 | )
40 |
41 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/Transport/NewKeysMessage.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Messages.Transport
2 | {
3 | ///
4 | /// Represents SSH_MSG_KEXINIT message.
5 | ///
6 | [Message("SSH_MSG_NEWKEYS", 21)]
7 | public class NewKeysMessage : Message, IKeyExchangedAllowed
8 | {
9 | ///
10 | /// Called when type specific data need to be loaded.
11 | ///
12 | protected override void LoadData()
13 | {
14 | }
15 |
16 | ///
17 | /// Called when type specific data need to be saved.
18 | ///
19 | protected override void SaveData()
20 | {
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/Transport/UnimplementedMessage.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Messages.Transport
2 | {
3 | ///
4 | /// Represents SSH_MSG_UNIMPLEMENTED message.
5 | ///
6 | [Message("SSH_MSG_UNIMPLEMENTED", 3)]
7 | public class UnimplementedMessage : Message
8 | {
9 | ///
10 | /// Called when type specific data need to be loaded.
11 | ///
12 | protected override void LoadData()
13 | {
14 | }
15 |
16 | ///
17 | /// Called when type specific data need to be saved.
18 | ///
19 | protected override void SaveData()
20 | {
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/Authentication/SuccessMessage.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Messages.Authentication
2 | {
3 | ///
4 | /// Represents SSH_MSG_USERAUTH_SUCCESS message.
5 | ///
6 | [Message("SSH_MSG_USERAUTH_SUCCESS", 52)]
7 | public class SuccessMessage : Message
8 | {
9 | ///
10 | /// Called when type specific data need to be loaded.
11 | ///
12 | protected override void LoadData()
13 | {
14 | }
15 |
16 | ///
17 | /// Called when type specific data need to be saved.
18 | ///
19 | protected override void SaveData()
20 | {
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/Connection/RequestFailureMessage.cs:
--------------------------------------------------------------------------------
1 |
2 | namespace Renci.SshNet.Messages.Connection
3 | {
4 | ///
5 | /// Represents SSH_MSG_REQUEST_FAILURE message.
6 | ///
7 | [Message("SSH_MSG_REQUEST_FAILURE", 82)]
8 | public class RequestFailureMessage : Message
9 | {
10 | ///
11 | /// Called when type specific data need to be loaded.
12 | ///
13 | protected override void LoadData()
14 | {
15 | }
16 |
17 | ///
18 | /// Called when type specific data need to be saved.
19 | ///
20 | protected override void SaveData()
21 | {
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Compression/Zlib.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Compression
2 | {
3 | ///
4 | /// Represents "zlib" compression implementation
5 | ///
6 | internal class Zlib : Compressor
7 | {
8 | ///
9 | /// Gets algorithm name.
10 | ///
11 | public override string Name
12 | {
13 | get { return "zlib"; }
14 | }
15 |
16 | ///
17 | /// Initializes the algorithm
18 | ///
19 | /// The session.
20 | public override void Init(Session session)
21 | {
22 | base.Init(session);
23 | this.IsActive = true;
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/ExpectAsyncResult.cs:
--------------------------------------------------------------------------------
1 | using Renci.SshNet.Common;
2 | using System;
3 |
4 | namespace Renci.SshNet
5 | {
6 | ///
7 | /// Provides additional information for asynchronous command execution
8 | ///
9 | public class ExpectAsyncResult : AsyncResult
10 | {
11 | ///
12 | /// Initializes a new instance of the class.
13 | ///
14 | /// The async callback.
15 | /// The state.
16 | internal ExpectAsyncResult(AsyncCallback asyncCallback, Object state)
17 | : base(asyncCallback, state)
18 | {
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/Connection/ChannelOpen/SessionChannelOpenInfo.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Messages.Connection
2 | {
3 | ///
4 | /// Used to open "session" channel type
5 | ///
6 | internal class SessionChannelOpenInfo : ChannelOpenInfo
7 | {
8 | ///
9 | /// Specifies channel open type
10 | ///
11 | public const string NAME = "session";
12 |
13 | ///
14 | /// Gets the type of the channel to open.
15 | ///
16 | ///
17 | /// The type of the channel to open.
18 | ///
19 | public override string ChannelType
20 | {
21 | get { return NAME; }
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Common/AuthenticationEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Renci.SshNet.Common
4 | {
5 | ///
6 | /// Base class for authentication events.
7 | ///
8 | public abstract class AuthenticationEventArgs : EventArgs
9 | {
10 | ///
11 | /// Gets the username.
12 | ///
13 | public string Username { get; private set; }
14 |
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | /// The username.
19 | public AuthenticationEventArgs(string username)
20 | {
21 | this.Username = username;
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Common/ChannelEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Renci.SshNet.Common
4 | {
5 | ///
6 | /// Base class for all channel related events.
7 | ///
8 | public class ChannelEventArgs : EventArgs
9 | {
10 | ///
11 | /// Gets the channel number.
12 | ///
13 | public uint ChannelNumber { get; private set; }
14 |
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | /// The channel number.
19 | public ChannelEventArgs(uint channelNumber)
20 | {
21 | this.ChannelNumber = channelNumber;
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/IServiceFactory.NET.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Renci.SshNet.NetConf;
3 |
4 | namespace Renci.SshNet
5 | {
6 | internal partial interface IServiceFactory
7 | {
8 | ///
9 | /// Creates a new in a given
10 | /// and with the specified operation timeout.
11 | ///
12 | /// The to create the in.
13 | /// The operation timeout.
14 | ///
15 | /// An .
16 | ///
17 | INetConfSession CreateNetConfSession(ISession session, TimeSpan operationTimeout);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Netconf/INetConfSession.cs:
--------------------------------------------------------------------------------
1 | using System.Xml;
2 |
3 | namespace Renci.SshNet.NetConf
4 | {
5 | internal interface INetConfSession : ISubsystemSession
6 | {
7 | ///
8 | /// Gets the NetConf server capabilities.
9 | ///
10 | ///
11 | /// The NetConf server capabilities.
12 | ///
13 | XmlDocument ServerCapabilities { get; }
14 |
15 | ///
16 | /// Gets the NetConf client capabilities.
17 | ///
18 | ///
19 | /// The NetConf client capabilities.
20 | ///
21 | XmlDocument ClientCapabilities { get; }
22 |
23 | XmlDocument SendReceiveRpc(XmlDocument rpc, bool automaticMessageIdHandling);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Sftp/Responses/SftpResponse.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Renci.SshNet.Sftp.Responses
4 | {
5 | internal abstract class SftpResponse : SftpMessage
6 | {
7 | public uint ResponseId { get; private set; }
8 |
9 | public uint ProtocolVersion { get; private set; }
10 |
11 | public SftpResponse(uint protocolVersion)
12 | {
13 | this.ProtocolVersion = protocolVersion;
14 | }
15 |
16 | protected override void LoadData()
17 | {
18 | base.LoadData();
19 |
20 | this.ResponseId = this.ReadUInt32();
21 | }
22 |
23 | protected override void SaveData()
24 | {
25 | throw new InvalidOperationException("Response cannot be saved.");
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Sftp/Requests/SftpInitRequest.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Sftp.Requests
2 | {
3 | internal class SftpInitRequest : SftpMessage
4 | {
5 | public override SftpMessageTypes SftpMessageType
6 | {
7 | get { return SftpMessageTypes.Init; }
8 | }
9 |
10 | public uint Version { get; private set; }
11 |
12 | public SftpInitRequest(uint version)
13 | {
14 | this.Version = version;
15 | }
16 |
17 | protected override void LoadData()
18 | {
19 | base.LoadData();
20 | this.Version = this.ReadUInt32();
21 | }
22 |
23 | protected override void SaveData()
24 | {
25 | base.SaveData();
26 | this.Write(this.Version);
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/Connection/ChannelOpenFailureReasons.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Messages.Connection
2 | {
3 | ///
4 | /// List channel open failure reasons defined by the protocol.
5 | ///
6 | internal enum ChannelOpenFailureReasons : uint
7 | {
8 | ///
9 | /// SSH_OPEN_ADMINISTRATIVELY_PROHIBITED
10 | ///
11 | AdministativelyProhibited = 1,
12 | ///
13 | /// SSH_OPEN_CONNECT_FAILED
14 | ///
15 | ConnectFailed = 2,
16 | ///
17 | /// SSH_OPEN_UNKNOWN_CHANNEL_TYPE
18 | ///
19 | UnknownChannelType = 3,
20 | ///
21 | /// SSH_OPEN_RESOURCE_SHORTAGE
22 | ///
23 | ResourceShortage = 4
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Common/ExceptionEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Renci.SshNet.Common
4 | {
5 | ///
6 | /// Provides data for the ErrorOccured events.
7 | ///
8 | public class ExceptionEventArgs : EventArgs
9 | {
10 | ///
11 | /// Gets the System.Exception that represents the error that occurred.
12 | ///
13 | public Exception Exception { get; private set; }
14 |
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | /// An System.Exception that represents the error that occurred.
19 | public ExceptionEventArgs(Exception exception)
20 | {
21 | this.Exception = exception;
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Common/ChannelRequestEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Renci.SshNet.Messages.Connection;
3 |
4 | namespace Renci.SshNet.Common
5 | {
6 | ///
7 | /// Provides data for event.
8 | ///
9 | public class ChannelRequestEventArgs : EventArgs
10 | {
11 | ///
12 | /// Gets request information.
13 | ///
14 | public RequestInfo Info { get; private set; }
15 |
16 | ///
17 | /// Initializes a new instance of the class.
18 | ///
19 | /// Request information.
20 | public ChannelRequestEventArgs(RequestInfo info)
21 | {
22 | this.Info = info;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Sftp/Responses/SftpDataResponse.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Sftp.Responses
2 | {
3 | internal class SftpDataResponse : SftpResponse
4 | {
5 | public override SftpMessageTypes SftpMessageType
6 | {
7 | get { return SftpMessageTypes.Data; }
8 | }
9 |
10 | public byte[] Data { get; set; }
11 |
12 | public bool IsEof { get; set; }
13 |
14 | public SftpDataResponse(uint protocolVersion)
15 | : base(protocolVersion)
16 | {
17 | }
18 |
19 | protected override void LoadData()
20 | {
21 | base.LoadData();
22 |
23 | this.Data = this.ReadBinaryString();
24 |
25 | if (!this.IsEndOfData)
26 | {
27 | this.IsEof = this.ReadBoolean();
28 | }
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Sftp/Requests/SftpExtendedRequest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Renci.SshNet.Sftp.Responses;
3 |
4 | namespace Renci.SshNet.Sftp.Requests
5 | {
6 | internal abstract class SftpExtendedRequest : SftpRequest
7 | {
8 | public const string NAME = "posix-rename@openssh.com";
9 |
10 | public override SftpMessageTypes SftpMessageType
11 | {
12 | get { return SftpMessageTypes.Extended; }
13 | }
14 |
15 | public abstract string Name { get; }
16 |
17 | public SftpExtendedRequest(uint protocolVersion, uint requestId, Action statusAction)
18 | : base(protocolVersion, requestId, statusAction)
19 | {
20 | }
21 |
22 | protected override void SaveData()
23 | {
24 | base.SaveData();
25 | this.Write(this.Name);
26 | }
27 | }
28 | }
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Sftp/Flags.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Renci.SshNet.Sftp
4 | {
5 | [Flags]
6 | internal enum Flags
7 | {
8 | None = 0x00000000,
9 | ///
10 | /// SSH_FXF_READ
11 | ///
12 | Read = 0x00000001,
13 | ///
14 | /// SSH_FXF_WRITE
15 | ///
16 | Write = 0x00000002,
17 | ///
18 | /// SSH_FXF_APPEND
19 | ///
20 | Append = 0x00000004,
21 | ///
22 | /// SSH_FXF_CREAT
23 | ///
24 | CreateNewOrOpen = 0x00000008,
25 | ///
26 | /// SSH_FXF_TRUNC
27 | ///
28 | Truncate = 0x00000010,
29 | ///
30 | /// SSH_FXF_EXCL
31 | ///
32 | CreateNew = 0x00000028
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Sftp/Responses/SftpVersionResponse.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Renci.SshNet.Sftp.Responses
5 | {
6 | internal class SftpVersionResponse : SftpMessage
7 | {
8 | public override SftpMessageTypes SftpMessageType
9 | {
10 | get { return SftpMessageTypes.Version; }
11 | }
12 |
13 | public uint Version { get; private set; }
14 |
15 | public IDictionary Extentions { get; private set; }
16 |
17 | protected override void LoadData()
18 | {
19 | base.LoadData();
20 | this.Version = this.ReadUInt32();
21 | this.Extentions = this.ReadExtensionPair();
22 | }
23 |
24 | protected override void SaveData()
25 | {
26 | throw new InvalidOperationException();
27 | }
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Common/ObjectIdentifier.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Renci.SshNet.Common
4 | {
5 | ///
6 | /// Describes object identifier for DER encoding
7 | ///
8 | public struct ObjectIdentifier
9 | {
10 | ///
11 | /// Gets the object identifier.
12 | ///
13 | public ulong[] Identifiers { get; private set; }
14 |
15 | ///
16 | /// Initializes a new instance of the class.
17 | ///
18 | /// The identifiers.
19 | public ObjectIdentifier(params ulong[] identifiers)
20 | : this()
21 | {
22 | if (identifiers.Length < 2)
23 | throw new ArgumentException("identifiers");
24 |
25 | this.Identifiers = identifiers;
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/Connection/ChannelEofMessage.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Messages.Connection
2 | {
3 | ///
4 | /// Represents SSH_MSG_CHANNEL_EOF message.
5 | ///
6 | [Message("SSH_MSG_CHANNEL_EOF", 96)]
7 | public class ChannelEofMessage : ChannelMessage
8 | {
9 | ///
10 | /// Initializes a new instance of the class.
11 | ///
12 | public ChannelEofMessage()
13 | {
14 |
15 | }
16 |
17 | ///
18 | /// Initializes a new instance of the class.
19 | ///
20 | /// The local channel number.
21 | public ChannelEofMessage(uint localChannelNumber)
22 | {
23 | this.LocalChannelNumber = localChannelNumber;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Security/Cryptography/DigitalSignature.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Security.Cryptography
2 | {
3 | ///
4 | /// Base class for signature implementations
5 | ///
6 | public abstract class DigitalSignature
7 | {
8 | ///
9 | /// Verifies the signature.
10 | ///
11 | /// The input.
12 | /// The signature.
13 | /// True if signature was successfully verified; otherwise false.
14 | public abstract bool Verify(byte[] input, byte[] signature);
15 |
16 | ///
17 | /// Creates the signature.
18 | ///
19 | /// The input.
20 | /// Signed input data.
21 | public abstract byte[] Sign(byte[] input);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/Connection/ChannelCloseMessage.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Messages.Connection
2 | {
3 | ///
4 | /// Represents SSH_MSG_CHANNEL_CLOSE message.
5 | ///
6 | [Message("SSH_MSG_CHANNEL_CLOSE", 97)]
7 | public class ChannelCloseMessage : ChannelMessage
8 | {
9 | ///
10 | /// Initializes a new instance of the class.
11 | ///
12 | public ChannelCloseMessage()
13 | {
14 |
15 | }
16 |
17 | ///
18 | /// Initializes a new instance of the class.
19 | ///
20 | /// The local channel number.
21 | public ChannelCloseMessage(uint localChannelNumber)
22 | {
23 | LocalChannelNumber = localChannelNumber;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Common/AuthenticationPasswordChangeEventArgs.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Common
2 | {
3 | ///
4 | /// Provides data for event.
5 | ///
6 | public class AuthenticationPasswordChangeEventArgs : AuthenticationEventArgs
7 | {
8 | ///
9 | /// Gets or sets the new password.
10 | ///
11 | ///
12 | /// The new password.
13 | ///
14 | public byte[] NewPassword { get; set; }
15 |
16 | ///
17 | /// Initializes a new instance of the class.
18 | ///
19 | /// The username.
20 | public AuthenticationPasswordChangeEventArgs(string username)
21 | : base(username)
22 | {
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/Connection/ChannelSuccessMessage.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Messages.Connection
2 | {
3 | ///
4 | /// Represents SSH_MSG_CHANNEL_SUCCESS message.
5 | ///
6 | [Message("SSH_MSG_CHANNEL_SUCCESS", 99)]
7 | public class ChannelSuccessMessage : ChannelMessage
8 | {
9 | ///
10 | /// Initializes a new instance of the class.
11 | ///
12 | public ChannelSuccessMessage()
13 | {
14 |
15 | }
16 |
17 | ///
18 | /// Initializes a new instance of the class.
19 | ///
20 | /// The local channel number.
21 | public ChannelSuccessMessage(uint localChannelNumber)
22 | {
23 | this.LocalChannelNumber = localChannelNumber;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/Connection/ChannelFailureMessage.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Messages.Connection
2 | {
3 | ///
4 | /// Represents SSH_MSG_CHANNEL_FAILURE message.
5 | ///
6 | [Message("SSH_MSG_CHANNEL_FAILURE", 100)]
7 | public class ChannelFailureMessage : ChannelMessage
8 | {
9 | ///
10 | /// Initializes a new instance of the class.
11 | ///
12 | public ChannelFailureMessage()
13 | {
14 |
15 | }
16 |
17 | ///
18 | /// Initializes a new instance of the class.
19 | ///
20 | /// The local channel number.
21 | public ChannelFailureMessage(uint localChannelNumber)
22 | {
23 | this.LocalChannelNumber = localChannelNumber;
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Channels/ChannelForwardedTcpip.NET40.cs:
--------------------------------------------------------------------------------
1 | using System.Net;
2 | using System.Net.Sockets;
3 |
4 | namespace Renci.SshNet.Channels
5 | {
6 | ///
7 | /// Implements "forwarded-tcpip" SSH channel.
8 | ///
9 | internal partial class ChannelForwardedTcpip
10 | {
11 | partial void OpenSocket(IPEndPoint remoteEndpoint)
12 | {
13 | this._socket = new Socket(remoteEndpoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
14 | this._socket.Connect(remoteEndpoint);
15 | this._socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, 1);
16 | }
17 |
18 | partial void InternalSocketReceive(byte[] buffer, ref int read)
19 | {
20 | read = this._socket.Receive(buffer);
21 | }
22 |
23 | partial void InternalSocketSend(byte[] data)
24 | {
25 | this._socket.Send(data);
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/ServiceFactory.NET.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using Renci.SshNet.NetConf;
6 |
7 | namespace Renci.SshNet
8 | {
9 | internal partial class ServiceFactory
10 | {
11 | ///
12 | /// Creates a new in a given
13 | /// and with the specified operation timeout.
14 | ///
15 | /// The to create the in.
16 | /// The operation timeout.
17 | ///
18 | /// An .
19 | ///
20 | public INetConfSession CreateNetConfSession(ISession session, TimeSpan operationTimeout)
21 | {
22 | return new NetConfSession(session, operationTimeout);
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/Connection/ChannelOpen/ChannelOpenInfo.cs:
--------------------------------------------------------------------------------
1 | using Renci.SshNet.Common;
2 |
3 | namespace Renci.SshNet.Messages.Connection
4 | {
5 | ///
6 | /// Base class for open channel messages
7 | ///
8 | public abstract class ChannelOpenInfo : SshData
9 | {
10 | ///
11 | /// Gets the type of the channel to open.
12 | ///
13 | ///
14 | /// The type of the channel to open.
15 | ///
16 | public abstract string ChannelType { get; }
17 |
18 | ///
19 | /// Called when type specific data need to be loaded.
20 | ///
21 | protected override void LoadData()
22 | {
23 | }
24 |
25 | ///
26 | /// Called when type specific data need to be saved.
27 | ///
28 | protected override void SaveData()
29 | {
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/MessageEventArgs.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Renci.SshNet
4 | {
5 | ///
6 | /// Provides data for message events.
7 | ///
8 | /// Message type
9 | public class MessageEventArgs : EventArgs
10 | {
11 | ///
12 | /// Gets the message.
13 | ///
14 | public T Message { get; private set; }
15 |
16 | ///
17 | /// Initializes a new instance of the class.
18 | ///
19 | /// The message.
20 | /// is null.
21 | public MessageEventArgs(T message)
22 | {
23 | if (message == null)
24 | throw new ArgumentNullException("message");
25 |
26 | this.Message = message;
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/Connection/ChannelRequest/ShellRequestInfo.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Messages.Connection
2 | {
3 | ///
4 | /// Represents "shell" type channel request information
5 | ///
6 | internal class ShellRequestInfo : RequestInfo
7 | {
8 | ///
9 | /// Channel request name
10 | ///
11 | public const string NAME = "shell";
12 |
13 | ///
14 | /// Gets the name of the request.
15 | ///
16 | ///
17 | /// The name of the request.
18 | ///
19 | public override string RequestName
20 | {
21 | get { return NAME; }
22 | }
23 |
24 | ///
25 | /// Initializes a new instance of the class.
26 | ///
27 | public ShellRequestInfo()
28 | {
29 | this.WantReply = true;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.InteropServices;
3 | using System.Runtime.CompilerServices;
4 |
5 | [assembly: AssemblyTitle("SSH.NET .NET 4.0")]
6 | [assembly: Guid("ad816c5e-6f13-4589-9f3e-59523f8b77a4")]
7 | [assembly: InternalsVisibleTo("Renci.SshNet.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f9194e1eb66b7e2575aaee115ee1d27bc100920e7150e43992d6f668f9737de8b9c7ae892b62b8a36dd1d57929ff1541665d101dc476d6e02390846efae7e5186eec409710fdb596e3f83740afef0d4443055937649bc5a773175b61c57615dac0f0fd10f52b52fedf76c17474cc567b3f7a79de95dde842509fb39aaf69c6c2")]
8 | [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]
9 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Sftp/Requests/SftpCloseRequest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Renci.SshNet.Sftp.Responses;
3 |
4 | namespace Renci.SshNet.Sftp.Requests
5 | {
6 | internal class SftpCloseRequest : SftpRequest
7 | {
8 | public override SftpMessageTypes SftpMessageType
9 | {
10 | get { return SftpMessageTypes.Close; }
11 | }
12 |
13 | public byte[] Handle { get; private set; }
14 |
15 | public SftpCloseRequest(uint protocolVersion, uint requestId, byte[] handle, Action statusAction)
16 | : base(protocolVersion, requestId, statusAction)
17 | {
18 | this.Handle = handle;
19 | }
20 |
21 | protected override void LoadData()
22 | {
23 | base.LoadData();
24 | this.Handle = this.ReadBinaryString();
25 | }
26 |
27 | protected override void SaveData()
28 | {
29 | base.SaveData();
30 | this.WriteBinaryString(this.Handle);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Channels/IChannelForwardedTcpip.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Net;
3 | using Renci.SshNet.Common;
4 |
5 | namespace Renci.SshNet.Channels
6 | {
7 | ///
8 | /// A "forwarded-tcpip" SSH channel.
9 | ///
10 | internal interface IChannelForwardedTcpip : IDisposable
11 | {
12 | ///
13 | /// Occurs when an exception is thrown while processing channel messages.
14 | ///
15 | event EventHandler Exception;
16 |
17 | ///
18 | /// Binds the channel to the specified endpoint.
19 | ///
20 | /// The endpoint to connect to.
21 | /// The forwarded port for which the channel is opened.
22 | void Bind(IPEndPoint remoteEndpoint, IForwardedPort forwardedPort);
23 |
24 | ///
25 | /// Closes the channel.
26 | ///
27 | void Close();
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/Connection/ChannelRequest/EndOfWriteRequestInfo.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Messages.Connection
2 | {
3 | ///
4 | /// Represents "eow@openssh.com" type channel request information
5 | ///
6 | public class EndOfWriteRequestInfo : RequestInfo
7 | {
8 | ///
9 | /// Channel request name
10 | ///
11 | public const string NAME = "eow@openssh.com";
12 |
13 | ///
14 | /// Gets the name of the request.
15 | ///
16 | ///
17 | /// The name of the request.
18 | ///
19 | public override string RequestName
20 | {
21 | get { return NAME; }
22 | }
23 |
24 | ///
25 | /// Initializes a new instance of the class.
26 | ///
27 | public EndOfWriteRequestInfo()
28 | {
29 | this.WantReply = false;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/Connection/ChannelRequest/KeepAliveRequestInfo.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Messages.Connection
2 | {
3 | ///
4 | /// Represents "keepalive@openssh.com" type channel request information
5 | ///
6 | public class KeepAliveRequestInfo : RequestInfo
7 | {
8 | ///
9 | /// Channel request name
10 | ///
11 | public const string NAME = "keepalive@openssh.com";
12 |
13 | ///
14 | /// Gets the name of the request.
15 | ///
16 | ///
17 | /// The name of the request.
18 | ///
19 | public override string RequestName
20 | {
21 | get { return NAME; }
22 | }
23 |
24 | ///
25 | /// Initializes a new instance of the class.
26 | ///
27 | public KeepAliveRequestInfo()
28 | {
29 | this.WantReply = false;
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Sftp/Requests/StatVfsRequest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Renci.SshNet.Sftp.Responses;
3 |
4 | namespace Renci.SshNet.Sftp.Requests
5 | {
6 | internal class StatVfsRequest : SftpRequest
7 | {
8 | public const string NAME = "statvfs@openssh.com";
9 |
10 | public override SftpMessageTypes SftpMessageType
11 | {
12 | get { return SftpMessageTypes.Extended; }
13 | }
14 |
15 | public string Path { get; private set; }
16 |
17 | public StatVfsRequest(uint protocolVersion, uint requestId, string path, Action extendedAction, Action statusAction)
18 | : base(protocolVersion, requestId, statusAction)
19 | {
20 | this.Path = path;
21 | this.SetAction(extendedAction);
22 | }
23 |
24 | protected override void SaveData()
25 | {
26 | base.SaveData();
27 | this.Write(StatVfsRequest.NAME);
28 | this.Write(this.Path);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/TerminalControl/Themes/Generic.xaml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
22 |
23 |
--------------------------------------------------------------------------------
/libsshnet/include/libssh/knownhosts.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the SSH Library
3 | *
4 | * Copyright (c) 20014 by Aris Adamantiadis
5 | *
6 | * This library is free software; you can redistribute it and/or
7 | * modify it under the terms of the GNU Lesser General Public
8 | * License as published by the Free Software Foundation; either
9 | * version 2.1 of the License.
10 | *
11 | * This library is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 | * Lesser General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU Lesser General Public
17 | * License along with this library; if not, write to the Free Software
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 | */
20 |
21 |
22 | #ifndef KNOWNHOSTS_H_
23 | #define KNOWNHOSTS_H_
24 |
25 | char **ssh_knownhosts_algorithms(ssh_session session);
26 |
27 | #endif /* KNOWNHOSTS_H_ */
28 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Sftp/Responses/StatVfsResponse.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Sftp.Responses
2 | {
3 | internal class StatVfsResponse : SftpExtendedReplyResponse
4 | {
5 | public SftpFileSytemInformation Information { get; private set; }
6 |
7 | public StatVfsResponse()
8 | : base(0)
9 | {
10 | }
11 |
12 | protected override void LoadData()
13 | {
14 | base.LoadData();
15 |
16 | this.Information = new SftpFileSytemInformation(this.ReadUInt64(), this.ReadUInt64(),
17 | this.ReadUInt64(), this.ReadUInt64(),
18 | this.ReadUInt64(), this.ReadUInt64(),
19 | this.ReadUInt64(), this.ReadUInt64(),
20 | this.ReadUInt64(), this.ReadUInt64(),
21 | this.ReadUInt64());
22 | }
23 | }
24 | }
--------------------------------------------------------------------------------
/libsshnet/include/libssh/crc32.h:
--------------------------------------------------------------------------------
1 | /*
2 | * crc32.c - simple CRC32 code
3 | *
4 | * This file is part of the SSH Library
5 | *
6 | * Copyright (c) 2005 by Aris Adamantiadis
7 | *
8 | * This library is free software; you can redistribute it and/or
9 | * modify it under the terms of the GNU Lesser General Public
10 | * License as published by the Free Software Foundation; either
11 | * version 2.1 of the License, or (at your option) any later version.
12 | *
13 | * This library is distributed in the hope that it will be useful,
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 | * Lesser General Public License for more details.
17 | *
18 | * You should have received a copy of the GNU Lesser General Public
19 | * License along with this library; if not, write to the Free Software
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 | */
22 |
23 | #ifndef _CRC32_H
24 | #define _CRC32_H
25 |
26 | uint32_t ssh_crc32(const char *buf, uint32_t len);
27 |
28 | #endif /* _CRC32_H */
29 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Messages/Authentication/RequestMessageNone.cs:
--------------------------------------------------------------------------------
1 | namespace Renci.SshNet.Messages.Authentication
2 | {
3 | ///
4 | /// Represents "none" SSH_MSG_USERAUTH_REQUEST message.
5 | ///
6 | internal class RequestMessageNone : RequestMessage
7 | {
8 | ///
9 | /// Gets the name of the authentication method.
10 | ///
11 | ///
12 | /// The name of the method.
13 | ///
14 | public override string MethodName
15 | {
16 | get
17 | {
18 | return "none";
19 | }
20 | }
21 |
22 | ///
23 | /// Initializes a new instance of the class.
24 | ///
25 | /// Name of the service.
26 | /// Authentication username.
27 | public RequestMessageNone(ServiceName serviceName, string username)
28 | : base(serviceName, username)
29 | {
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Sftp/Requests/ExtendedRequests/FStatVfsRequest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Renci.SshNet.Sftp.Responses;
3 |
4 | namespace Renci.SshNet.Sftp.Requests
5 | {
6 | internal class FStatVfsRequest : SftpExtendedRequest
7 | {
8 | public override SftpMessageTypes SftpMessageType
9 | {
10 | get { return SftpMessageTypes.Extended; }
11 | }
12 |
13 | public override string Name
14 | {
15 | get { return "fstatvfs@openssh.com"; }
16 | }
17 |
18 | public byte[] Handle { get; private set; }
19 |
20 | public FStatVfsRequest(uint protocolVersion, uint requestId, byte[] handle, Action extendedAction, Action statusAction)
21 | : base(protocolVersion, requestId, statusAction)
22 | {
23 | this.Handle = handle;
24 | this.SetAction(extendedAction);
25 | }
26 |
27 | protected override void SaveData()
28 | {
29 | base.SaveData();
30 | this.WriteBinaryString(this.Handle);
31 | }
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Sftp/Requests/SftpFStatRequest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Renci.SshNet.Sftp.Responses;
3 |
4 | namespace Renci.SshNet.Sftp.Requests
5 | {
6 | internal class SftpFStatRequest : SftpRequest
7 | {
8 | public override SftpMessageTypes SftpMessageType
9 | {
10 | get { return SftpMessageTypes.FStat; }
11 | }
12 |
13 | public byte[] Handle { get; private set; }
14 |
15 | public SftpFStatRequest(uint protocolVersion, uint requestId, byte[] handle, Action attrsAction, Action statusAction)
16 | : base(protocolVersion, requestId, statusAction)
17 | {
18 | this.Handle = handle;
19 | this.SetAction(attrsAction);
20 | }
21 |
22 | protected override void LoadData()
23 | {
24 | base.LoadData();
25 | this.Handle = this.ReadBinaryString();
26 | }
27 |
28 | protected override void SaveData()
29 | {
30 | base.SaveData();
31 | this.WriteBinaryString(this.Handle);
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Ssh.Net/Renci.SshNet/Sftp/Requests/SftpReadDirRequest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Renci.SshNet.Sftp.Responses;
3 |
4 | namespace Renci.SshNet.Sftp.Requests
5 | {
6 | internal class SftpReadDirRequest : SftpRequest
7 | {
8 | public override SftpMessageTypes SftpMessageType
9 | {
10 | get { return SftpMessageTypes.ReadDir; }
11 | }
12 |
13 | public byte[] Handle { get; private set; }
14 |
15 | public SftpReadDirRequest(uint protocolVersion, uint requestId, byte[] handle, Action nameAction, Action statusAction)
16 | : base(protocolVersion, requestId, statusAction)
17 | {
18 | this.Handle = handle;
19 | this.SetAction(nameAction);
20 | }
21 |
22 | protected override void LoadData()
23 | {
24 | base.LoadData();
25 | this.Handle = this.ReadBinaryString();
26 | }
27 |
28 | protected override void SaveData()
29 | {
30 | base.SaveData();
31 | this.WriteBinaryString(this.Handle);
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/SSH/RelayCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows.Input;
7 |
8 | namespace npcook.Ssh
9 | {
10 | class RelayCommand : ICommand
11 | {
12 | readonly Action