Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pull in changes from qtcreator #12

Open
wants to merge 107 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
b068eae
SSH: Add infrastructure for passing additional connection options.
Oct 1, 2012
092da31
SSH: Implement tunneling.
Jun 19, 2012
229253f
SSH: Adapt tests to API change.
Dec 11, 2012
21c35a2
SSH: Count only non-closing channels in closeAllChannels().
Oct 9, 2012
c7237e4
SSH: Make it configurable whether to check server data pedantically.
Oct 11, 2012
2ab6f8d
Fix gcc warnings about unused variables.
Mar 21, 2013
63db2c5
SSH: Implement and make use of RFC 4256.
Jun 18, 2013
1c34ca7
Fixes generated RSA private key in OpenSSL format with no crypt option
Jul 5, 2013
38c4ed3
SSH: Remove questionable warning in connection manager.
Aug 8, 2013
de188b2
SSH: Add missing library initialization.
Aug 14, 2013
9eeb286
Introduce the concept of a "device process".
Aug 8, 2013
07a737c
Clean up SshConnectionManager interface
Sep 10, 2013
ff131ad
Replace QString::fromLocal8Bit("") calls
Nov 5, 2013
6a47196
SSH: Act on failing SFTP server.
Jan 15, 2014
88fb637
Use double quotes instead of single quotes as per our guidelines.
Apr 17, 2014
aa8ab08
SSH: Avoid repetitive calls
orgads May 19, 2014
ae43cdb
Replace QLatin1String("x") with QLatin1Char('x') where possible
Aug 29, 2014
8c2d183
SSH: Fix maximum packet size check.
Sep 11, 2014
92ba3cd
SSH: Do not always emit an error if an SFTP channel exits.
Sep 11, 2014
7b905e7
SSH: Add support for the recommended cipher modes from RFC 4344.
Nov 6, 2014
2698c1f
Ssh: Remove wrong Q_ASSERT in SshRemoteProcess destructor
Nov 25, 2014
09d875d
SSH: Fix misleading error message.
Nov 26, 2014
4f85c30
Ssh: Remove indirection in AbstractSshChannel::m_timeoutTimer
Nov 26, 2014
e6adfbe
SSH: Delay channel close request to server in SessionRequested state.
Nov 27, 2014
f29c9e3
Catch exceptions by const reference.
Nov 28, 2014
9711766
SSH: implement host key checking.
Nov 12, 2014
2f96645
SSH: Close unused cached connections after a period of inactivity.
Nov 14, 2014
2d6a421
SshConnectionManager: s/break/continue
Dec 18, 2014
515265b
Fix clang warning about uninitialized variable
hunger Jan 6, 2015
f260362
Port to new connect api
Montel Feb 4, 2015
afb16d8
Misc: Remove unneeded qualifications
orgads Feb 3, 2015
ce9d57e
SSH: Add support for SHA-256 HMAC.
Feb 20, 2015
a07fce8
Don't mix iterator and const_iterator
Apr 1, 2015
6c77716
SSH: Fix TCP/IP forwarding support.
Apr 14, 2015
3f8f885
SSH: Minor refactorings in key exchange code.
May 22, 2015
a848d11
SSH: Support ECDH key exchange.
May 26, 2015
3f1d99a
SSH: SshKeyExchangeInit is a struct.
arnolddumas May 28, 2015
eb5c30f
UI text: use double quotes for emphasis
Jun 1, 2015
d44bc87
SSH: Fix wrongly emitted assert.
Jun 18, 2015
5e738e9
SSH: Do not tie key exchange methods to specific host key algorithms.
Jun 23, 2015
57a98bc
SSH: Use better member name and fix wrong comment.
Jun 27, 2015
1fde987
SSH: Give better name to member variable.
Jun 29, 2015
73888de
SSH: Fix composition of ECDH key exchange signature.
Jun 29, 2015
08134e1
SSH: Remove bogus compatibility check.
Jul 21, 2015
c46a366
SSH: Support more ECDSA public key sizes.
Jul 20, 2015
569a538
SSH: Support ECDSA user keys.
Jul 21, 2015
5fa2346
SSH: Don't assume an exact width of ECDSA keys.
Jul 23, 2015
141724e
SSH: Support creation of ECDSA keys.
Jul 22, 2015
f4c823b
SSH: Use "none" authentication type in case of an empty password.
Aug 19, 2015
b6ed843
SSH: Fix GCC 5.2.1 warning in release build
orgads Nov 20, 2015
e085755
SSH: Use categorized logging.
Jan 14, 2016
0dc9cbe
Fixed segfault in SshKeyExchange due to using object after deletion
pdima Feb 22, 2016
044cffe
Fix compiler warnings on windows.
davschul Apr 20, 2016
ff41132
Ssh: Implement tcp/ip forward tunneling
ulherman Mar 31, 2016
50b8d2c
SSH: Consistently use override in SshForwardTcpIpTunnel
hunger May 24, 2016
cf88689
SSH: Use Qt5-style connects
orgads Jun 7, 2016
6b139fb
SSH: Fix typo in key generator that leads to a crash
ckandeler Nov 28, 2016
d7d3683
make library defines more consistency
tjenssen Dec 12, 2016
b4e8779
SSH: Catch all exceptions in SshConnectionPrivate::closeConnection
rlohning Feb 22, 2017
f6d1335
Remove spaces in initializer lists
tjenssen Feb 22, 2017
8b70ce7
SSH: Add support for ssh-agent
Jul 20, 2016
310a78e
SSH: Catch std::exception rather than Botan-specific ones
ckandeler May 5, 2017
ab4c0b3
SSH: Fix enum values
ckandeler May 22, 2017
028fcbe
SshAgent.Request: Initialize member
nib952051 Aug 13, 2017
20c2444
Drop unused variables and lambda captures
Sep 7, 2017
3871865
SshExceptions derive from std::exception
nib952051 Sep 5, 2017
8edddc2
Ssh: Move some Ssh specific images from Utils to Ssh
aportale Sep 16, 2017
7f8cd31
Combine some SshConnectionParameter members
Dec 19, 2017
afaef5f
Tests: Fix compile
Dec 20, 2017
012bf28
SSH: Adapt test to signal renaming.
Sep 11, 2014
dc04362
SSH: Fix error in test.
May 27, 2015
40e7bbc
SSH: Fix exit code of tests.
Jun 29, 2015
4b3a9fb
Reduce usage of qApp in favor of static function calls
aportale Apr 24, 2017
0904e50
sftpchannel: add support for tracking upload/download progress
sandsmark Jan 20, 2018
c5c3c1d
fix compile warning about unused result
sandsmark Jan 20, 2018
a5ac220
sshlogging: default to only display warning messages
sandsmark Jan 20, 2018
0ece1b4
sftp test: fix parsing host and port
sandsmark Jan 20, 2018
10f6d35
sftpfsmodel test: fall back to trying current username and key based …
sandsmark Jan 20, 2018
e57d542
Build: support pkg-config
mardy Apr 14, 2018
7cdfbac
fix compile warnings/deprecated API
sandsmark Aug 11, 2018
2cb5a5a
Add a status enum for errors
sandsmark Aug 25, 2018
0e32953
make sure we can handle packages the same size as openssh
sandsmark Oct 28, 2018
26ec44a
SSH: Add missing check in key exchange reply handler
ckandeler Oct 19, 2018
1ab49f2
sftpchannel: handle the server not reporting timestamps
sandsmark Feb 23, 2019
7866649
sshconnection: don't work in strict mode by default, issue warnings i…
sandsmark Feb 23, 2019
187d2d1
add/port autotests
sandsmark Feb 23, 2019
6d87bd6
SSH: Remove nonsensical check
ckandeler Nov 1, 2018
cabe2ba
SSH: Introduce and handle generic "channel open" packets
ckandeler Nov 1, 2018
0a74883
SSH: Implement X11 forwarding
ckandeler Jun 14, 2017
0aa925e
SSH: Add support for "new" OpenSSH private key format
ckandeler Nov 19, 2018
19250a2
SSH: Fix autotest
ckandeler Dec 3, 2018
d791d38
always build tests, fix build
sandsmark Feb 23, 2019
72b6960
now that we don't need to care about compatibility upstream anymore s…
sandsmark Jul 16, 2019
61d6ef8
don't use ancient obsolete APIs
sandsmark Jul 16, 2019
08e4e5a
add install target
sandsmark Jul 16, 2019
83c376f
fix compatibility with new botan
sandsmark Jul 28, 2019
a1a5ed6
fix parsing file size with some broken sftp servers
sandsmark Oct 12, 2019
3f53f5f
it was the parsing of uints locally that was wrong...
sandsmark Oct 12, 2019
1248ec8
missed one (tempted to rewrite the entire thing instead)
sandsmark Oct 12, 2019
a0797ae
I'm blind
sandsmark Oct 12, 2019
22b3253
just use the Qt functions to handle the parsing of integers..
sandsmark Oct 12, 2019
0433fee
enable warnings when compiling
sandsmark Oct 20, 2019
4a85dba
update readme
sandsmark Oct 20, 2019
49d552a
add readme for the autotest
sandsmark Oct 20, 2019
47829fa
doxygen gets confused when using different header styles in markdown
sandsmark Oct 20, 2019
8a076a2
start documenting the API
sandsmark Oct 20, 2019
776125d
remove private include in public header
sandsmark Nov 30, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 0 additions & 32 deletions README

This file was deleted.

33 changes: 20 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,34 @@ About QSsh
QSsh provides SSH and SFTP support for Qt applications. The aim of this project
is to provide a easy way to use these protocols in any Qt application.

This project is based on Qt Creator's libQtcSsh.so. All the credits to
Qt Creator's team! (http://qt.gitorious.org/qt-creator)
This project is based on Qt Creator's libQtcSsh.so. All credits to
Qt Creator's team!

Unfortunately Qt Creator has decided to start using openssh instead, so this is
now the most up to date maintained version.

### Compiling QSsh

Compiling QSsh
--------------

Prerequisites:
* Qt 4.7.4 (May work with older versions)
* On Windows: MinGW 4.4 or later, Visual Studio 2008 or later
* On Mac: XCode 2.5 or later, compiling on 10.4 requires setting the
environment variable QTC_TIGER_COMPAT before running qmake
* [Qt](https://www.qt.io/)
* [Botan](https://botan.randombit.net/)

Steps:
```bash
mkdir $BUILD_DIRECTORY
cd $BUILD_DIRECTORY
qmake $SOURCE_DIRECTORY/qssh.pro
git clone https://github.com/sandsmark/QSsh.git
cd QSsh
mkdir build
cd build
qmake ../qssh.pro
make (or mingw32-make or nmake depending on your platform)
```

### Examples
Examples
--------

Directory examples/SecureUploader/ contains an example on how to upload
a file using SFTP
* [ssh shell](tests/manual/ssh/shell/), similar to a normal command line `ssh` client.
* [Graphical SFTP browser](tests/manual/ssh/sftpfsmodel/), how to use the SFTP file system model with a QTreeView.
* [Auto tests](tests/auto/ssh/), how to do X11 forwarding, remote command execution, file upload and download, and basically everything else that is supported.
* [Secure Uploader](examples/SecureUploader/), how to upload a file.
10 changes: 5 additions & 5 deletions examples/SecureUploader/securefileuploader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ void SecureFileUploader::upload(const QString &localFile, const QString &dest, c
m_remoteFilename = dest + "/" + info.fileName();

QSsh::SshConnectionParameters params;
params.host = host;
params.userName = username;
params.password = passwd;
params.authenticationType = QSsh::SshConnectionParameters::AuthenticationByPassword;
params.setHost(host);
params.setUserName(username);
params.setPassword(passwd);
params.authenticationType = QSsh::SshConnectionParameters::AuthenticationTypeTryAllPasswordBasedMethods;
params.timeout = 30;
params.port = 22;
params.setPort(22);

m_connection = new QSsh::SshConnection(params, this); // TODO free this pointer!

Expand Down
121 changes: 11 additions & 110 deletions qssh.pri
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,13 @@
QSSH_PRI_INCLUDED = 1

isEmpty(QSSH_PREFIX) {
unix:!macx: QSSH_PREFIX = /usr/local
unix:!macx: QSSH_PREFIX = $$[QT_INSTALL_PREFIX]
}

isEqual(QT_MAJOR_VERSION, 5) {

defineReplace(cleanPath) {
return($$clean_path($$1))
}

defineReplace(targetPath) {
return($$shell_path($$1))
}

} else { # qt5

defineReplace(cleanPath) {
win32:1 ~= s|\\\\|/|g
contains(1, ^/.*):pfx = /
else:pfx =
segs = $$split(1, /)
out =
for(seg, segs) {
equals(seg, ..):out = $$member(out, 0, -2)
else:!equals(seg, .):out += $$seg
}
return($$join(out, /, $$pfx))
}

defineReplace(targetPath) {
return($$replace(1, /, $$QMAKE_DIR_SEP))
}

} # qt5

defineReplace(qtLibraryName) {
unset(LIBRARY_NAME)
LIBRARY_NAME = $$1
Expand All @@ -49,69 +22,10 @@ defineReplace(qtLibraryName) {
return($$RET)
}

defineTest(minQtVersion) {
maj = $$1
min = $$2
patch = $$3
isEqual(QT_MAJOR_VERSION, $$maj) {
isEqual(QT_MINOR_VERSION, $$min) {
isEqual(QT_PATCH_VERSION, $$patch) {
return(true)
}
greaterThan(QT_PATCH_VERSION, $$patch) {
return(true)
}
}
greaterThan(QT_MINOR_VERSION, $$min) {
return(true)
}
}
greaterThan(QT_MAJOR_VERSION, $$maj) {
return(true)
}
return(false)
}

isEqual(QT_MAJOR_VERSION, 5) {

# For use in custom compilers which just copy files
defineReplace(stripSrcDir) {
return($$relative_path($$absolute_path($$1, $$OUT_PWD), $$_PRO_FILE_PWD_))
}

} else { # qt5

# For use in custom compilers which just copy files
win32:i_flag = i
defineReplace(stripSrcDir) {
win32 {
!contains(1, ^.:.*):1 = $$OUT_PWD/$$1
} else {
!contains(1, ^/.*):1 = $$OUT_PWD/$$1
}
out = $$cleanPath($$1)
out ~= s|^$$re_escape($$_PRO_FILE_PWD_/)||$$i_flag
return($$out)
}

} # qt5

isEmpty(TEST):CONFIG(debug, debug|release) {
!debug_and_release|build_pass {
TEST = 1
}
}

isEmpty(IDE_LIBRARY_BASENAME) {
IDE_LIBRARY_BASENAME = lib
}

equals(TEST, 1) {
QT +=testlib
DEFINES += WITH_TESTS
}

IDE_SOURCE_TREE = $$PWD
isEmpty(IDE_BUILD_TREE) {
sub_dir = $$_PRO_FILE_PWD_
sub_dir ~= s,^$$re_escape($$PWD),,
Expand All @@ -125,7 +39,7 @@ macx {
IDE_LIBEXEC_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/Resources
IDE_BIN_PATH = $$IDE_APP_PATH/$${IDE_APP_TARGET}.app/Contents/MacOS
copydata = 1
isEmpty(TIGER_COMPAT_MODE):TIGER_COMPAT_MODE=$$(QTC_TIGER_COMPAT)
isEmpty(TIGER_COMPAT_MODE):TIGER_COMPAT_MODE=$$(QSSH_TIGER_COMPAT)
isEmpty(TIGER_COMPAT_MODE) {
QMAKE_CXXFLAGS *= -mmacosx-version-min=10.5
QMAKE_LFLAGS *= -mmacosx-version-min=10.5
Expand All @@ -136,17 +50,21 @@ macx {
IDE_LIBRARY_PATH = $$IDE_BUILD_TREE/$$IDE_LIBRARY_BASENAME
IDE_LIBEXEC_PATH = $$IDE_APP_PATH # FIXME
IDE_BIN_PATH = $$IDE_APP_PATH
!isEqual(IDE_SOURCE_TREE, $$IDE_BUILD_TREE):copydata = 1
}

INCLUDEPATH += \
$$IDE_BUILD_TREE/src \ # for <app/app_version.h>
$$IDE_SOURCE_TREE/src/libs
QT += widgets

CONFIG += warn_on

# Find botan2
CONFIG += link_pkgconfig
PKGCONFIG += botan-2

CONFIG += depend_includepath

LIBS += -L$$IDE_LIBRARY_PATH
LIBS += -lbotan-2
LIBS += -l$$qtLibraryName(botan-2)
INCLUDEPATH += $${PWD}/src/libs/

!isEmpty(vcproj) {
DEFINES += IDE_LIBRARY_BASENAME=\"$$IDE_LIBRARY_BASENAME\"
Expand All @@ -158,24 +76,7 @@ LIBS += -lbotan-2
DEFINES += QT_NO_CAST_TO_ASCII
!macx:DEFINES += QT_USE_FAST_OPERATOR_PLUS QT_USE_FAST_CONCATENATION

unix {
CONFIG(debug, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/debug-shared
CONFIG(release, debug|release):OBJECTS_DIR = $${OUT_PWD}/.obj/release-shared

CONFIG(debug, debug|release):MOC_DIR = $${OUT_PWD}/.moc/debug-shared
CONFIG(release, debug|release):MOC_DIR = $${OUT_PWD}/.moc/release-shared

RCC_DIR = $${OUT_PWD}/.rcc
UI_DIR = $${OUT_PWD}/.uic
}

win32-msvc* {
#Don't warn about sprintf, fopen etc being 'unsafe'
DEFINES += _CRT_SECURE_NO_WARNINGS
}

qt:greaterThan(QT_MAJOR_VERSION, 4) {
contains(QT, core): QT += concurrent
contains(QT, gui): QT += widgets
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x040900
}
4 changes: 2 additions & 2 deletions qssh.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ CONFIG += ordered

SUBDIRS = \
src \
examples \
tests
examples \
tests
Binary file added src/libs/ssh/images/dir.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/libs/ssh/images/help.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/libs/ssh/images/unknownfile.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.